- #1
Catria
- 152
- 4
Homework Statement
Here I am, trying to get the trajectory $(x(t),y(t))$ that will minimize the following Lagrangian (i.e. the integrand of the functional) between $(-1,-1)$ and $(-1,y_{eff})$ where $x_{eff}$ is defined as the point where $V(x_{eff},-1)=V(-1,-1),x<0$.
So here's the integrand of the functional:
$L=\frac{1}{2}((\partial_tx)^2+(\partial_ty)^2)-V(x(t),y(t))$
with $V(x(t),y(t))$ defined as follows:
$(x(t)^2-1)^2(x(t)^2-\delta_1)+\frac{(y(t)^2-1)^2-\frac{\delta_2}{4}(y(t)-2)(y(t)+1)^2}{x(t)^2+\gamma}$
and
$x(0.0001)=-1=y(0.0001)$
$x(10)=x_{eff},y(10)=-1$
Homework Equations
The polar-coordinate Euler-Lagrange equation
The Attempt at a Solution
Code:
Needs["VariationalMethods`"];
gamma = 0.1;
delta1 = 0.1;
delta2 = 0.1;
tmin = 0.0001;
tmax = 10;
V[x[t_], y[
t_]] := (x[t]^2 - 1)^2 (x[t]^2 -
delta1) + ((y[t]^2 - 1)^2 - (delta2 (y[t] - 2) (y[t] + 1)^2)/
4)/(x[t]^2 + gamma);
U[x_, y_] := (x^2 - 1)^2 (x^2 - delta1) + ((y^2 - 1)^2 -
delta2 (y - 2) (y + 1)^2/4)/(x^2 + gamma);
ftn = 2*Pi*
t (1/2 (D[x[t], t]^2 + D[y[t], t]^2) +
V[x[t], y[t]]); (* Le Lagrangien *)
Veff[x_] := U[x, -1];
x0 = x /. FindRoot[Veff[x] == U[-1, -1], {x, -0.2}]
sln = EulerEquations[ftn, {x[t], y[t]}, t]
solution =
NDSolve[{sln, x[tmin] == -1, y[tmin] == -1, x[tmax] == x0,
y[tmax] == -1}, {x[t], y[t]}, {t, tmin, tmax}];
psi[t_] = x[t] /. solution[[1, 1]];
phi[t_] = y[t] /. solution[[1, 2]];
NIntegrate[
t (1/2 (D[psi[t], t]^2 +
D[phi[t], t]^2) + ((psi[t]^2 - 1)^2 (psi[t]^2 -
delta1) + ((phi[t]^2 - 1)^2 -
delta2 (phi[t] - 2) (phi[t] + 1)^2/4)/(psi[t]^2 +
gamma))), {t, tmin, tmax}]
Plot[{psi[t], phi[t]}, {t, tmin, tmax}, PlotRange -> All]
ParametricPlot[{psi[t], phi[t]}, {t, tmin, tmax}, PlotRange -> All]
But, when I run that piece of Mathematica code, I run into an error message:
Code:
NDSolve::ndsz: At t == 0.004410099463404809`, step size is effectively zero; singularity or stiff system suspected.
Because of the stiffness of the system the numerical solution has a strange behavior...