- #1

- 180

- 8

Here is the code:

Code:

```
soln = NDSolve[{eqn1[[1]], eqn1[[2]], x[0] == y[0] == 0, x'[0] == 1,
y'[0] == 0}, {x, y}, t];
```

Code:

```
Clear[soln, eqn1, xeqn, yeqn, eqn, sink, source, field, k, m, a, f, F, U]
a = 1;
sink = {0,
a} - (1/(x^2 + (y - a)^2))*(x^2 + (y - a)^2)^(-1/2)*{x, y - a};
source = {0, -a} + (1/(x^2 + (y + a)^2))*(x^2 + (y + a)^2)^(-1/2)*{x,
y + a};
field = sink + source;
F = m*k*field;
U[x_, y_] = Integrate[F[[1]], x] + Integrate[F[[2]], y];
T = (m/2) (x'[t]^2 + y'[t]^2);
L = T - U[x[t], y[t]];
xeqn = D[L, x[t]] == D[D[L, x'[t]], t];
yeqn = D[L, y[t]] == D[D[L, y'[t]], t];
eqn = {xeqn, yeqn};
eqn1 = eqn /. {k -> 1, m -> 1}
```

Code:

```
NDSolve::deqn: Equation or list of equations expected instead of False in the first argument
{eqn1[[1]], eqn1[[2]], x[0] == y[0] == 0, False, False}
```