Variational Calculus

Written by Lic. Renan Cabrera Lafuente
Supported by "Academia Nacional de Ciencias de Bolivia"

renanbo@hotmail.com
rencabla@ceibo.entelnet.bo
La Paz Bolivia -2000

This notebook needs the package versora.m which can be found at:
http://www.mathsource.com/Content/Applications/Mathematics/0211-363

Needs["versora`", "f:\\renan\\fiscom\\book\\versora.m"]<< Calculus`VariationalMethods`

Lorentz Force

First of all we define output formats for functions we are going to use

\(rP\  = \ x[t]\ \ e[x] + y[t]\ e[y] + z[t]\ e[z]; 
\ 

    Format[ϕ[_, _, _]] = \ \ ϕ[Vec[r]\ ]; 


    Format[\ 
		\ \(\(Derivative[\ n___\ ]\)[ϕ]\)\ [\ _, _, _]\ \ 

        		\ \ \ \ \ \ \ \ \ ]\  := \ \(\(Derivative[n]\)[ϕ]\)[Vec[r]]

    \)\(Format[Ax[_, _, _]] = \ \ Ax[Vec[r]\ ]; 

    Format[Ay[_, _, _]] = \ \ Ay[Vec[r]]\ ; 

    Format[Az[_, _, _]] = \ \ Az[Vec[r]]\ ; 


    Format[\ 
		\ \(\(Derivative[\ n___\ ]\)[Ax]\)\ [\ _, _, _]\ \ 

        		\ \ \ \ \ \ \ \ \ ]\  := \ \(\(Derivative[n]\)[Ax]\)[Vec[r]]
\)\(Format[\ 
		\ \(\(Derivative[\ n___\ ]\)[Ay]\)\ [\ _, _, _]\ \ 

        		\ \ \ \ \ \ \ \ \ ]\  := \ \(\(Derivative[n]\)[Ay]\)[Vec[r]]
\)\(Format[\ 
		\ \(\(Derivative[\ n___\ ]\)[Az]\)\ [\ _, _, _]\ \ 

        		\ \ \ \ \ \ \ \ \ ]\  := \ \(\(Derivative[n]\)[Az]\)[Vec[r]]

    \)

Now we define the Velocity and the Potential Vector

\(V\  = \ D[rP, t]; 

    A\  = \ Ax[x[t], y[t], z[t]\ \ \ ]\ e[x] + \ Ay[x[t], y[t], z[t]]\ e[y] + 
        \ Az\ [x[t], y[t], z[t]]\ e[z]\)

Here we define the Lagrangian

\(T\  = \ m/2\ PE[V, V]; 

    U\  = \ q\ ϕ[x[t], y[t], z[t]]\ \  - \((q/c)\)\ PE[\ A\ , \ V\ ]\ ; 
    

Lag\  = \ T\  - \ U\)

And finaly we obtain its Euler Lagrange Equations

Ec  =  EulerEquations[Lag, {x[t], y[t], z[t] }, t] // ExpandAll

Now lets calculate the above from its direct formula to compare

\(\(\(LorentzF\  = \ q \((\ \ cE\  + \ \((1/c)\)\ \ PV[v, B]\ \ )\)\ ; 
    \)
\)\)

\(v\  = \ \(x'\)[t]\ e[x] + \ \(y'\)[t]\ e[y]\  + \ \(z'\)[t]\ e[z]; 

    		
B\ \ \  = \ 
      Rot[Ax[x, y, z]\ e[x] + Ay[x, y, z]\ e[y] + Az[x, y, z]\ e[z]]\ \  /. \ 
        Rot[Cartesian]; 


    cE\  = \ \ \ \(-Grad[\ ϕ[x, y, z]\ ]\)\  /. Grad[Cartesian]\ \ ; \)

Collect[ExpandAll[LorentzF], {e[x], e[y], e[z]}]

Schrodinger Equation

Now is the time for the Schrodinger Equation. As later we define output formats , but also a rule to reshape the Laplacian

\(VectorSimplify[w_] := 
      w /. \ {
\ \ \ \ \ \ 	
          a_. \(\( Derivative[2, 0, 0, 0]\)[f_]\)[x__] + 
              a_. \(\( Derivative[0, 2, 0, 0]\)[f_]\)[x__] + 
              a_. \(\( Derivative[0, 0, 2, 0]\)[f_]\)[x__] :> 
            a\ Laplacian[f[x]]
		}\)

\(\(
	
    Format[\ \(\(Derivative[d___]\)[ψ]\)[x, y, z, t]\ ] = \ \ \ 
      \(\(Derivative[d]\)[ψ]\)[Vec[r], t]; 

	
    Format[\ \(\(Derivative[d___]\)[ψc]\)[x, y, z, t]\ ] = \ \ \ 
      \(\(Derivative[d]\)[\ Superscript[ψ, "*"]\ ]\)[Vec[r], t]; 


    \ Format[\ ψ[x, y, z, t]\ ] = ψ[Vec[r], t]; 

\ 
    Format[\ ψc[x, y, z, t]\ ] = \ 
      Superscript[ψ[Vec[r], t], "*"]; 


    Format[\ \(\(Derivative[0, 0, 0, 1]\)[ψ]\)[x, y, z, t]\ ] = \ \ \ 
      HoldForm[\ D[ψ[Vec[r]], t]]; 


    Format[\ \(\(Derivative[0, 0, 0, 1]\)[ψc]\)[x, y, z, t]\ ] = \ \ 

      		\ HoldForm[\ \ \ \ \ 
			\ \ 
        Superscript[\ \ \ \ \ \ D[ψ[Vec[r]], t]\ \ \ \ \ , "*"\ \ ]
          \ \ \ \ 
\ \ \ \ \ \ \ \ \ \ \ \ \ ]; 
\)\)

Now we define the Lagarangian

\(Clear[V]; 


    h^2/\((8\ Pi^2\ m\ )\)\ 
        PE[Grad[ψ[x, y, z, t]], Grad[ψc[x, y, z, t]]] + \ 
      V\ ψ[x, y, z, t]\ \ ψc[x, y, z, t] + \ 
      h/\((2  Pi\ I)\) 
        \((\ ψc[x, y, z, t]\ D[ψ[x, y, z, t], t]\  - 
            ψ\ \ D[\ ψc[x, y, z, t], t]\ )\)\ 
\)L  =  %  /.  Grad[Cartesian];

And finaly we obtain the Schrodinger Equation as we know

EC  =  
      EulerEquations[
          L, {ψ[x, y, z, t], ψc[x, y, z, t]}, {x, y, z, t}] // 
        ExpandAll;

EC  // VectorSimplify