Mathematica Can I solve a system of P.D.E's in mathematica symbolically?

  • Thread starter Thread starter andresordonez
  • Start date Start date
  • Tags Tags
    Mathematica System
AI Thread Summary
The discussion revolves around solving a set of equations in Mathematica 7 to find a generating function that demonstrates a canonical transformation in phase space. The user initially attempted to use DSolve but encountered limitations, leading to a search for alternative methods. They provided code snippets that involve solving for variables p1, p2, P1, and P2 based on given equations and then applying DSolve to derive relationships involving the generating function F. The user acknowledges that while using the symplectic condition would be simpler, they are required to approach the problem through both methods for homework purposes. They also mention having success with breaking down the problem into a series of ordinary differential equations (ODEs) and share their approach to constructing the trial function FTrial, which they plan to test against the derived conditions.
andresordonez
Messages
65
Reaction score
0
SOLVED
I tried (with DSolve) but it just returned the input code, so I guess it can't. I also looked for it in the documentation center with no luck. Is there another way?

By the way, I'm using mathematica 7
 
Last edited:
Physics news on Phys.org
Mathematica will solve some PDEs with DSolve, if it can. Often you can help it along if you can simplify things. What is the system you are trying to solve?
 
Thanks for the early reply!
I have a transformation in the phase space from (q1,q2,p1,p2) to (Q1,Q2,P1,P2) and I'm looking for the generating function to demonstrate that the transformation is canonical.
I guess the rest there is to say about it is in the equations.

This is my code:
Code:
sol = Solve[{
    q1 == 1/\[Alpha] (Sqrt[2 P1] Sin[Q1] + P2), 
    q2 == 1/\[Alpha] (Sqrt[2 P1] Cos[Q1] + Q2), 
    p1 == \[Alpha]/2 (Sqrt[2 P1] Cos[Q1] - Q2), 
    p2 == -(\[Alpha]/2) (Sqrt[2 P1] Sin[Q1] - P2)}, {p1, p2, P1, P2}] // Simplify

DSolve[{
   p1 == D[F[q1, q2, Q1, Q2], q1],
   p2 == D[F[q1, q2, Q1, Q2], q2],
   P1 == -D[F[q1, q2, Q1, Q2], Q1],
   P2 == -D[F[q1, q2, Q1, Q2], Q2]} /. sol[[1]],
 F[q1, q2, Q1, Q2], {q1, q2, Q1, Q2}]

PS:
I know it would be simpler to use the symplectic condition, but it is part of a homework and I need to do it both ways. I also know it's simple to do it by hand (in this case) but it can become a tedious procedure really fast as the number of degrees of freedom increases.
 
I've had some success on these types of problems on Mathematica by breaking them up into a series of ODEs. That works in this case. Here's the code:

sol = Solve[{q1 == 1/\[Alpha] (Sqrt[2 P1] Sin[Q1] + P2),
q2 == 1/\[Alpha] (Sqrt[2 P1] Cos[Q1] + Q2),
p1 == \[Alpha]/2 (Sqrt[2 P1] Cos[Q1] - Q2),
p2 == -(\[Alpha]/2) (Sqrt[2 P1] Sin[Q1] - P2)}, {p1, p2, P1,
P2}] // Simplify

DSolve[{p1 == D[F[q1, q2, Q1, Q2], q1]} /. sol[[1]],
F[q1, q2, Q1, Q2], {q1, q2, Q1, Q2}]

DSolve[{p2 ==
D[1/2 q1 (-2 Q2 \[Alpha] + q2 \[Alpha]^2) + C[1][q2, Q1, Q2],
q2]} /. sol[[1]], C[1][q2, Q1, Q2], {q2, Q1, Q2}]

DSolve[{P1 == -D[
1/2 q1 (-2 Q2 \[Alpha] + q2 \[Alpha]^2) +
q2 Q2 \[Alpha] Tan[Q1] - 1/2 q2^2 \[Alpha]^2 Tan[Q1] +
C[2][Q1, Q2], Q1]} /. sol[[1]], C[2][Q1, Q2], {Q1, Q2}]

DSolve[{P2 == -D[
1/2 q1 (-2 Q2 \[Alpha] + q2 \[Alpha]^2) +
q2 Q2 \[Alpha] Tan[Q1] - 1/2 q2^2 \[Alpha]^2 Tan[Q1] -
1/2 Q2^2 Tan[Q1] + C[3][Q2], Q2]} /. sol[[1]], C[3][Q2], {Q2}]

FTrial = 1/2 q1 (-2 Q2 \[Alpha] + q2 \[Alpha]^2) +
q2 Q2 \[Alpha] Tan[Q1] - 1/2 q2^2 \[Alpha]^2 Tan[Q1] -
1/2 Q2^2 Tan[Q1] + C[4]

Test = {p1 == D[FTrial, q1], p2 == D[FTrial, q2],
P1 == -D[FTrial, Q1], P2 == -D[FTrial, Q2]} /. sol[[1]] //
Simplify
 
That should do it. Thank you phyzguy!
 
Back
Top