Thank you a lot!

> Just a warning. In SPAD this means
>
> poissonBracket f g is the same as poissonBracket(f(g)).

Yes, it is a common mistake of mine.

I've almost done. Now I have

q : Integer -> Symbol
q i == subscript(q', [1::OutputForm])

p : Integer -> Symbol
p i == subscript(p', [1::OutputForm])

Hamiltonian : Expression(Float)
Hamiltonian == (p 1)^2 + (q 1)^2

PoissonBracket : (Expression(Float), Expression(Float)) ->
Expression(Float)
PoissonBracket(f, g) == D(f, q 1) * D(g, p 1) - D(f, p 1) * D(g, q 1)

and a small test

(10) -> PoissonBracket(q 1, Hamiltonian)

   (10)  2.0 p'
               1
 
Type: Expression(Float)
(11) -> PoissonBracket(p 1, Hamiltonian)

   (11)  - 2.0 q'
                 1
 
Type: Expression(Float)

suggests everything is ok --- as it was expected I've obtained
Hamiltonian equations. However I would really appreciate having just q
or p instead of q' or p'. But I can't use

q i == subscript(q, [1::OutputForm])

since it is recursion (no wonder though). Is there a way to have a
single notion "q" for several entities?

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to