Re: (N)FourierTrigSeries
- To: mathgroup at smc.vnet.net
- Subject: [mg45135] Re: (N)FourierTrigSeries
- From: "Martin Manscher" <reversed-email-rehcsnam at kd.utd.tac>
- Date: Wed, 17 Dec 2003 07:54:48 -0500 (EST)
- Organization: UNI-C
- References: <brchua$2of$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Seems the problem is the usual symbolic-vs-numeric. If I redefine f2, In[7]:=Clear[f2] In[8]:=f2[x_?NumberQ] := f[If[EvenQ[Floor[2x]], Mod[x, 1/2], 1/2 - Mod[x, 1/2]]] In[9]:=Chop[NFourierTrigSeries[f2[x], x, 3, AccuracyGoal -> 10]] Out[9]=-1.27324 Cos[2 \[Pi] x]+0.424413 Cos[6 \[Pi] x] I get the correct result. It seems that EvenQ[Floor[2x]] evaluates to False if x does not have a value: In[1]:= EvenQ[x] Out[1]= False In[2]:= x = 2; In[3]:= EvenQ[x] Out[3]= True Seems to me it would be more logical if EvenQ[x] evaluated to EvenQ[x] if x is symbolic? Martin