5. Lagrangians and Hamiltonians

Legal Notice, Disclaimer, and Book Ordering Information:

Null

Setup

\(Clear["Global`*"]; 
Off[General::spell]; 
Off[General::spell1]; 
    \)

Needs["Calculus`VectorAnalysis`"]

Needs["Graphics`PlotField`"]

Needs["Graphics`PlotField3D`"]

<< "D:\Mma\Inits\ch5init.m"

Clear["Global`*"];

5.2 Problems

5.2.2  Cartesian and Cylindrical Coordinates

Problem 2:  Potential with a Rectangular Groove

Consider a rectangular groove that runs from z=+∞ to -∞ and is open in the positive y direction.  The groove is bounded by three walls: y=0, x=0, and x=a.  The walls at x=0 and x=a are at zero potential and the wall at y=0 is at a specified potential V[x,0] (independent of the z coordinate).

Part (a)   Find a series expansion for the potential inside the groove for an arbitrary V[x,0].

pot[f_,n_]:=Sum[A[f,m] Sin[π m x/a] Exp[-π m y/b],{m,1,n}]

A[f_,m_]:=2/a Integrate[f Sin[π m x/a],{x,0,a}]

Part (b)   Write thr first few terms for the potential if V[x,0]=Sin[x] and separately, if V[x,0]==1.  Plot the potentials and use VEPlot to plot the equipotentials and electric field lines.

pot1 = pot[Sin[x],6]//Expand//Simplify

values={a->1,b->1,V0->1}

Plot3D[pot1//.values//Evaluate,{x,0,1},{y,0,0.5}];

VEPlot[pot1//.values,{x,0,1},{y,0,0.5}];

pot2=pot[1,4]//.values

Plot3D[pot2,{x,0,1},{y,0,0.5}];

Plot3D[pot[1,15]//.values//Evaluate,{x,0,1},{y,0,0.5}];

VEPlot[pot[1,15]//.values//Evaluate,{x,0,1},{y,0,0.5}];

Part (c)   Sum the series for V[x,0]=V0 and get a closed form for the solution.

pot3=pot[V0,Infinity]//TrigToExp//Simplify

Plot3D[pot3//.values//Evaluate,{x,0.001,0.999},{y,0,0.5}];