Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Non trivial series in Matematica

  1. Jan 11, 2012 #1
    Hi dear all
    I have some functional in Mathematica that depends on the functions (for example u1(x,y,t) u2(x,y,t) and others) and its derivatives.
    I want to expand this functional in series of ε.
    Its perturbation theory as you understand, and I should take into account that not only functions but also
    derivatives (by themselfes) are also have scale, i.e (in my example) u1~u2~∂x~∂y~ε, ∂t2 and I want to get smth up to ε2 (like for example u1(x,y)+u2(x,y)+u1(x,y)*u2(x,y)+∂xu1(x,y)+∂xu2(x,y)+∂yu1(x,y)+∂tf(x,y))
    How to do it?
    Thank you very much!
  2. jcsd
  3. Jan 12, 2012 #2
  4. Jan 13, 2012 #3
    I know what is Series. They dont do what i need
  5. Jan 13, 2012 #4
    Describe more precisely what you need.

    Perhaps give a simple, but not too simple, example that shows exactly what the input should be and what the output should be and why.

    Please be certain to show and explain what you mean by "get smth up to epsilon^2."
    Last edited: Jan 13, 2012
  6. Jan 14, 2012 #5
    Thank you for your replay!
    For example
    now I take into account that u1~u1~∂x~∂y~ε , ∂t2 and alculate the orders of every part of expression

    u1(t,x,y)22 (=1+1)
    xu2(t,x,y)~ε2 (=1+1)
    tu1(t,x,y)~ε3 (=2+1)
    tu2(t,x,y)~ε2 (=2+1)
    u1(t,x,y)∂tu2(x,y,z)~ε4 (=1+2+1)
    tf(t,x,y)~ε2 (=2+0)

    Now I want this expression up to ε2, so I get
  7. Jan 14, 2012 #6
    Possibly something like

    Subscript[u,1][t,x,y] + Subscript[u,1][t,x,y]^2 + ∂x Subscript[u,2][t,x,y] + ∂t Subscript[u,1][t,x,y] + ∂t Subscript[u,2][t,x,y] + Subscript[u,1][t,x,y] ∂t Subscript[u,2][x,y,z] + ∂t f[t,x,y] //. {∂t Subscript[u,1][t,x,y]->0, Subscript[u,1][t,x,y] ∂t Subscript[u,2][x,y,z]->0}

    which, if I have not made any mistakes, replaces each of your higher order terms with zero which Mathematica then drops.

    I don't know if this is what you really want or not. I don't know of any simple automated method that will do this for you. I believe this method is "brittle", which means that tiny changes in your input may make it fail for reasons that are very hard to understand. Perhaps someone with more skill than I can show you a better way of doing what you want.

    I do understand that people see subscripts used widely in mathematical publications, they see that Mathematica has some ability to display subscripts and that some people have a compulsion to use subscripts in Mathematica that cannot be overcome, but again and again and again people find or create problems for themselves when trying to use subscripts. Plan for that.
    Last edited: Jan 14, 2012
  8. Jan 15, 2012 #7
    Thank you. I did smth like that
    The problem is not a subscript (in matematika code I dont use them, here they are just for beaty). the problem is that i want to do smth automatically and up to the order I want.
  9. Jan 16, 2012 #8
    Just rescale all your variables by epsilon, then Taylor expand that. Here's a simple example:

    Code (Text):
    In[18]:= f[x, y] /. a : (x | y) :> eps a
             % + O[eps]^2

    Out[18]= f[eps x, eps y]

    Out[19]= f[0,0]+(y (f^(0,1))[0,0]+x (f^(1,0))[0,0]) eps+O[eps]^2
    This can be packaged into a function such as

    Code (Text):
    EpsExpand[fn_, vars_List, ord_Integer] := Module[{eps},
      Normal[Series[fn /. a : (Alternatives @@ vars) :> eps a, {eps, 0, ord}]] /. eps -> 1]
    EpsExpand[fn_, vars_, ord_Integer] := EpsExpand[fn, {vars}, ord]
    Code (Text):
    In[25]:= EpsExpand[f[x, y], {x, y}, 2]

    Out[25]= f[0,0]+y (f^(0,1))[0,0]+x (f^(1,0))[0,0]+1/2 (y^2 (f^(0,2))[0,0]+2 x y (f^(1,1))[0,0]+x^2 (f^(2,0))[0,0])
    You should be able to generalize this to the case that interests you.
  10. Jan 16, 2012 #9
    Thank you very much!
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: Non trivial series in Matematica
  1. Non exact integral (Replies: 2)