I have a PDE from my model's equation of motion(step.3) and I was suggested to use NDSolve to solve it, I was wondering how many boundary conditions(in step.4 and I currently had used 3 boundary conditions) I would need in order to successfully solve this PDE and produce a time evolution simulation(step.5) using the result produced with 'ndsolve'? And why? (And if I made a mistake somewhere since my code seems to produce an invariant straight line?). Thank you for reading my question!
(*Step1.Define and plot the field*)
lhs = 24
rhs = 40
beta = 0
field = -2/(1 + Exp[-x + rhs]) + 2/(1 + Exp[-x + lhs]) - 1 +
beta (*our field value v.s.spatial dimension*)
Plot[field, {x, 0,
64}, PlotRange -> {{0, 64}, {-1, 2}}]
(*Step.2 Define the field potential derivative dv/dphi*)
b = 0.1
dv = (y[t, x]^2 - 1)*(y[t, x] +
b) (*dv actually denotes dv/dphi*)
(*Step3.Define PDE from our E.O.M*)
pde = -D[y[t, x], {t, 2}] +
D[y[t, x], {x, 2}] + dv == 0
(*Step4.Use NDSolve to solve PDE with the help of known initial \
condition-field value v.s.spatial coordinate at t0*)
nsol =
NDSolve[{pde, y[0, x] == 0.9, D[y[t, 0], x] == 0,
D[y[t, 64], x] == 0}, y[t, x], {t, 0, 1}, {x, 0, 64}]
(*Step5.plot the field in spatial dimension at different times*)
\
nsol2 = nsol[[1, 1, 2]]
nsol3[t_, x_] = nsol2;
ListAnimate[
Table[Plot[nsol3[t, x], {x, 0, 64}, PlotLabel -> t,
PlotRange -> {-1.5, 1.5}], {t, 0, 1, 0.01}]]
```
NDSolve
is throwing an error and returning the input unevaluated, and you're then picking out part[[1,1,2]]
of the original input (which happens to be0
.) As to how to fix it, I'm writing up something now. $\endgroup$