Setting up and solving this second order nonlinear differential equation

287 Views Asked by At

Background

I'm trying to model a system where there are two magnets oriented such that they have attraction forces toward each other. One magnet is in a fixed position and the other magnet, $M$, is in free space and starts at the origin which is some distance away from the fixed magnet.

As $M$ approaches the fixed magnet due to the attraction force, the force will increase with the square of the distance from the origin.

$$F = C{y^2}$$

I want to model this part of the system where $M$ begins moving toward the fixed magnet and can ignore what happens when they collide.

The problem

I figure this is a second order non-linear differential equation.

$$my'' = C{y^2}$$

Or

$$y'' = Cy^{2}$$

For some coefficient $C$.

How do I go about solving this equation?

I would expect $y(t)$ grow exponentially and I haven't been able to find a solution that does this.

Initial position (with respect to origin) is zero. Initial velocity is zero.

$$y(0) = 0$$ $$ y'(0) = 0$$

2

There are 2 best solutions below

2
On

Using chain rule, you can rewrite the equation:

$$\frac{d^2 y}{dt^2} = C y^2 \\ \dot{y}\frac{d\dot{y}}{dy} = Cy^2 \\ $$

Integrating, you get:

$$\frac{\dot{y}^2}{2}=\frac{C}{3}y^3+D \\ \frac{dy}{dt} = \sqrt{\frac{2}{3}Cy^3 + E}$$

As far as I know, there is no simplification for the last integral. You will have to resort to numerical calculations.

1
On

There is an analytical solution to the equation $$y''=C\, y^2$$ It is given as $$y=\sqrt[3]{\frac 6 C}\,\wp \left(\sqrt[3]{\frac C6} \left(x+c_1\right);0,c_2\right)$$ where appears the Weierstrass elliptic function ( have a look here and here).