Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Series Expansions in Mathematica
Replies: 1   Last Post: Feb 20, 2013 10:26 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View  
Bob Hanlon

Posts: 895
Registered: 10/29/11
Re: Series Expansions in Mathematica
Posted: Feb 20, 2013 10:26 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Manipulate[
Module[
{expr, expansion, approx, t1, t2, repl},
repl = {t1 -> 0, t2 -> 0};
expr = (Exp[4 x] - c Exp[3 y] Exp[4 x] + c - 1) x^t1 y^t2;
Column[{
Row[{Style["expansion = ", Bold], (expansion =
Series[expr,
{x, 0, maxOrder},
{y, 0, maxOrder}] //
Normal // Expand) /.
repl}],
Row[{Style["approx = ", Bold], approx = (Cases[expansion,
a_. * x^n_ * y^m_ /;
((n + m) /. repl) <= maxOrder] //
Total) /.
repl}],
ContourPlot[approx == 0,
{x, -range, range}, {y, -range, range},
FrameLabel -> {"x", "y"},
ImageSize -> 300]},
Alignment -> Center]],
{{maxOrder, 5, "Max Order"}, Range[5]},
{{range, .1, "Plot Range"}, .05, .75, .05,
Appearance -> "Labeled"},
{{c, 0.5}, -10, 10, 0.1,
Appearance -> "Labeled"}]


Bob Hanlon


On Tue, Feb 19, 2013 at 6:53 PM, Samuel Mark Young <sy81@sussex.ac.uk> wrote:
> Hello,
> I am attempting to expand an equation, and then solve the 1st, 2nd, 3rd, 4th and 5th order expressions one at a time.
>
> The equation is:
>
> Exp[4 x] - c Exp[3 y] Exp[4 x] + c - 1 = 0
>
> With, x and y small variables to be expanded and c a constant. Once this is expanded, the variables x and y are in turn replaced with expansions written as:
>
> x = x[1] + x[2]/2 + x[3]/6 + x[4]/24 + x[5]/120 (to 5th order)
>
> By the time I have completed these expansions, I have a somewhat long expression. Does Mathematica have an intelligent way of deciding which terms would be 1st/2nd/etc order? For example, x[1] y[2] and x[1]^2 y[1] would both be third order.
>
> Many thanks,
> Sam Young
>
>





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.