Re: Series Expansions in Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg129874] Re: Series Expansions in Mathematica
- From: Bob Hanlon <hanlonr357 at gmail.com>
- Date: Wed, 20 Feb 2013 22:26:49 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-newout@smc.vnet.net
- Delivered-to: mathgroup-newsend@smc.vnet.net
- References: <20130219235354.DF485695C@smc.vnet.net>
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 at 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 > >
- References:
- Series Expansions in Mathematica
- From: Samuel Mark Young <sy81@sussex.ac.uk>
- Series Expansions in Mathematica