Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-linear action principles #60

Open
supercuerda opened this issue Oct 23, 2017 · 2 comments
Open

Non-linear action principles #60

supercuerda opened this issue Oct 23, 2017 · 2 comments
Labels
enhancement Not strictly a bug but more of a feature enhancement request

Comments

@supercuerda
Copy link

Suppose you want to compute the equations of motion of a non-linear action principle, such as the Sine-Gordon model:

S:= \int { (\partial_t \phi)^2-(\partial_x \phi)^2 -2 + 2 \cos(\phi) }{x};

Can you compute the equations of motion? I tried using

vary(S, $\phi -> \delta{\phi}$)

But is seems not to work, as it keeps computing forever...

Is Cadabra equipped to deal with non-linear potentials? It seems to me that it only admits polynomial terms.

@kpeeters
Copy link
Owner

This is somewhat related to https://cadabra.science/qa/79/error-in-using-vary . The problem is that it requires knowing the derivative of the cosine, and I would really like to avoid adding all that logic into cadabra itself (sympy should be taking care of that). At the moment, the way to solve this is to help cadabra a bit: if you start from

{t,x}::Coordinate;
\partial{#}::PartialDerivative;
\phi::Depends(\partial{#});
S:= \int{ (\partial_{t}{\phi})**2-(\partial_{x}{\phi})**2 -2 + 2 \cos(\phi) }{x};

just do the variation with

vary(S, $\cos(\phi) -> -\sin(\phi)\delta{\phi}, \phi -> \delta{\phi}$);

@supercuerda
Copy link
Author

Yes, I was hopping sympy would understand that. I will use your approach. Thanks!

@kpeeters kpeeters added the enhancement Not strictly a bug but more of a feature enhancement request label Jan 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Not strictly a bug but more of a feature enhancement request
Projects
None yet
Development

No branches or pull requests

2 participants