Non trivial series in Matematica

  • Thread starter Thread starter unih
  • Start date Start date
  • Tags Tags
    Series
Click For Summary

Discussion Overview

The discussion revolves around expanding a functional in Mathematica using perturbation theory, specifically focusing on the expansion in terms of a small parameter ε. Participants explore how to account for both functions and their derivatives in the series expansion, aiming to express the functional up to the order of ε².

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant seeks guidance on expanding a functional that includes functions and their derivatives in terms of ε, aiming for a series expansion up to ε².
  • Another participant suggests that a Taylor power series expansion might be applicable but notes the need for clearer information to provide a precise answer.
  • A different participant expresses familiarity with series expansions but indicates that they do not meet the specific needs of the original query.
  • Further clarification is requested from the original poster, including a more detailed example of the desired input and output.
  • The original poster provides an example of their expression and the scaling of terms with respect to ε, showing how they categorize each term by its order.
  • One participant proposes a method involving the substitution of higher-order terms with zero, cautioning that this approach may be fragile and sensitive to input changes.
  • Another participant suggests a rescaling of variables by ε followed by a Taylor expansion, providing a simple example and a function to automate this process.

Areas of Agreement / Disagreement

Participants do not reach a consensus on a single method for achieving the desired expansion. Multiple approaches are proposed, and the discussion remains unresolved regarding the best automated method for the task.

Contextual Notes

Some participants express uncertainty about the effectiveness of their proposed methods, indicating that the solutions may depend on specific details of the problem that have not been fully articulated.

unih
Messages
27
Reaction score
0
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!
 
Physics news on Phys.org
I know what is Series. They don't do what i need
 
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:
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~ε , ∂t2 and alculate the orders of every part of expression

u1(t,x,y)~ε
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
u1(t,x,y)+u1(t,x,y)2+∂xu2(t,x,y)+∂tf(t,x,y)+O(ε3)
 
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:
Thank you. I did smth like that
The problem is not a subscript (in matematika code I don't 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.
 
Just rescale all your variables by epsilon, then Taylor expand that. Here's a simple example:

Code:
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:
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
Code:
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.
 
Thank you very much!
 

Similar threads

  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 24 ·
Replies
24
Views
5K
  • · Replies 7 ·
Replies
7
Views
9K
  • · Replies 5 ·
Replies
5
Views
3K