Mathematica Asked by David Sola Gil on January 9, 2021
I am working with Poisson brackets of Angular momentum, and I want Mathematica to be able to return the angular momentum function if the Poisson bracket yields that result. I.e. provided
PoissonBracket[a_ , b_] :=
Module[{position, momentum},
position = {x, y, z};
momentum = {px, py, pz};
result =
D[a, {position}].D[b, {momentum}] - D[a, {momentum}].D[b, {position}]]
FLx[x_, y_, z_, px_, py_, pz_] := y*pz - z*py;
Lx = FLx[x, y, z, px, py, pz];
FLy[x_, y_, z_, px_, py_, pz_] := z*px - x*pz;
Ly = FLy[x, y, z, px, py, pz];
FLz[x_, y_, z_, px_, py_, pz_] := x*py - y*px;
Lz = FLz[x, y, z, px, py, pz];
(I did this to be able to compute actual values later on and to take Jacobians in an easier way)
If I compute
PoissonBracket[Lx, Ly]
I get pz y - py z
, but I want to get Lz
straight away instead. I have tried using simplify with assumptions in various ways, but
FullSimplify[PoissonBracket[Ly, Lz], Lx]
returns True
FullSimplify[PoissonBracket[Ly, Lz], Lx == pz y - py z]
returns pz y - py z
, so it does nothing.
What am I doing wrong?
Clear["Global`*"]
PoissonBracket[a_, b_] := Module[{position, momentum}, position = {x, y, z};
momentum = {px, py, pz};
result =
D[a, {position}].D[b, {momentum}] - D[a, {momentum}].D[b, {position}]]
FLx[x_, y_, z_, px_, py_, pz_] := y*pz - z*py;
FLy[x_, y_, z_, px_, py_, pz_] := z*px - x*pz;
FLz[x_, y_, z_, px_, py_, pz_] := x*py - y*px;
If you Set
(=
) the values of Lx
, Ly
, and Lz
then these can never appear in a result since they will always be evaluated to their Set
values. Perhaps you want replacement rules.
rules = {FLx[x, y, z, px, py, pz] -> Lx,
FLy[x, y, z, px, py, pz] -> Ly,
FLz[x, y, z, px, py, pz] -> Lz}
(* {pz y - py z -> Lx, -pz x + px z -> -pz x + px z, py x - px y -> Lz} *)
PoissonBracket[FLx[x, y, z, px, py, pz], FLy[x, y, z, px, py, pz]] /. rules
{* Lz *)
Answered by Bob Hanlon on January 9, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP