View Full Version : Non trivial series in Matematica
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~ε, ∂t~ε2 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!
Bill Simpson
Jan12-12, 03:10 PM
Is there any chance that a Taylor power series expansion might do what you need?
http://reference.wolfram.com/mathematica/tutorial/MakingPowerSeriesExpansions.html
Without more clear information about your problem it is difficult to answer.
I know what is Series. They dont do what i need
Bill Simpson
Jan13-12, 11:02 AM
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."
Thank you for your replay!
For example
u1(t,x,y)+u1(t,x,y)2+∂xu2(t,x,y)+∂tu1(t,x,y)+∂tu2( t,x,y)+u1(t,x,y)∂tu2(x,y,z)+∂tf(t,x,y)
now I take into account that u1~u1~∂x~∂y~ε , ∂t~ε2 and alculate the orders of every part of expression
u1(t,x,y)~ε
u1(t,x,y)2~ε2 (=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
u1(t,x,y)+u1(t,x,y)2+∂xu2(t,x,y)+∂tf(t,x,y)+O(ε3)
Bill Simpson
Jan14-12, 02:14 PM
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.
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.
Simon_Tyler
Jan16-12, 06:43 AM
Just rescale all your variables by epsilon, then Taylor expand that. Here's a simple example:
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
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]
then
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.
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.