Re: Manipulate Series Expansions

• To: mathgroup at smc.vnet.net
• Subject: [mg112989] Re: Manipulate Series Expansions
• From: "Nasser M. Abbasi" <nma at 12000.org>
• Date: Sun, 10 Oct 2010 06:40:36 -0400 (EDT)
• References: <i8pgeo\$fgh\$1@smc.vnet.net>

```On 10/9/2010 3:34 AM, Daniel wrote:
> I'm new to Mathemtica and have been searching the net for a while
> regarding using Manipulate to compare a series expansion to the
> original function, but haven't found an adequate solution to my
> errors.
>
> Why doesn't this work:
>
> Manipulate[
>   Plot[{Normal[Series[Sin[x], {x, 0, n}]], Sin[x]}, {x, -10 Pi,
>     10 Pi}, PlotRange ->  2], {n, 1, 100, 1}]
>
> I can do this to make it work as intended:
>
> p[x_, n_] := Normal[Series[Sin[y], {y, 0, n}]] /. y ->  x
> Manipulate[
>   Plot[{p[x, n], Sin[x]}, {x, -10 Pi, 10 Pi}, PlotRange ->  2], {n, 1,
>    100, 1}]
>
> Any information would be helpful.
>
>

Because the Series commands does not like 'x' to be number. You are
using x in the range, and are also using x inside the series command.

Try something like for now

Manipulate[
Plot[{Normal[Series[Sin[z], {z, 0, n}]] /. z -> x,
Sin[x]}, {x, -10 Pi, 10 Pi}, PlotRange -> 2], {n, 1, 100, 1}, {z,
ControlType -> None}]

--Nasser

```

• Prev by Date: Re: Generation of polynomials
• Next by Date: Re: Further expanding d[xy]/dx in the output of a Dt calculation
• Previous by thread: Re: Manipulate Series Expansions
• Next by thread: Re: Manipulate Series Expansions