Post Reply 
Help with Piecewise function
02-01-2015, 03:10 PM
Post: #9
RE: Help with Piecewise function
(02-01-2015 02:55 PM)parisse Wrote:  Just define
f(t):=piecewise(t<0,-1, 1),
it's the same as your function on [-pi,pi] but in a much simpler form that int can handle.
Then (in Xcas), assume(n,integer); fourier_bn(f(t),t,2*pi,n,-pi) returns (-(-1)^n*2+2)/(n*pi)
As the warning explains, int can not handle piecewise condition that are not linear, in other words you must cut the definition interval in parts, each part being defined by one linear condition and implicit conditions deduced from the fact that previous case were not taken. For example, if a function is defined in [-inf,-2] as blabla, in [-2,0] as blurp, and in [0,inf] as gasp, do f(t):=piecewise(t<-2,blabla,t<0,blurp,gasp)

I hope they would implement fourier_an, fourier_bn and fourier_cn soon in the Prime's CAS!
This will solve my case Wink

However here, even if I try with your new piecewise, I get (with my program for Fourier Coefficient) {1, 0,0} always, and it's wrong...

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Help with Piecewise function - salvomic - 02-01-2015, 10:46 AM
RE: Help with Piecewise function - Snorre - 02-01-2015, 12:34 PM
RE: Help with Piecewise function - Snorre - 02-01-2015, 02:00 PM
RE: Help with Piecewise function - Snorre - 02-01-2015, 02:47 PM
RE: Help with Piecewise function - parisse - 02-01-2015, 02:55 PM
RE: Help with Piecewise function - salvomic - 02-01-2015 03:10 PM
RE: Help with Piecewise function - parisse - 02-01-2015, 04:10 PM
RE: Help with Piecewise function - Han - 02-01-2015, 06:09 PM
RE: Help with Piecewise function - parisse - 02-01-2015, 05:44 PM



User(s) browsing this thread: 1 Guest(s)