Post Reply 
Help with Piecewise function
02-01-2015, 02:55 PM
Post: #8
RE: Help with Piecewise function
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)
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 - 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)