Build a program that utilises the "leapfrog" method of numerical integration
The equation for the leapfrog method are given as: \[x_{n+1} = x_n+v_{n+1/2}\delta t\\v_{n+1/2} =v_{n-1/2}+a_n\delta t\\v_{1/2} = v_0+\tfrac12a_0\delta t\]
The Non-linear equation is \[\frac{\mathrm d^2 x}{\mathrm dt^2}=-\omega_0^2x+\beta x^2\] Initial conditions are \(x_0 = A\), \(v_0=0\), \(a_0=-\omega_0^2x_0+\beta x_0^2\) \(\omega_0=2\pi\), \(T=2\pi/\omega_0\)
This is what i have at the moment, but it is clearly not quite right
matlab?
yes MATLAB.
@dan815
ok
okay lemme get wht u are trying to do so we can code this fast
can u explain leapfrop method with a picture
the green line should be more like this |dw:1417060575412:dw|
k so what is leapfrop integration though
is it like i just take a look at the slope, see where i end up with a linear estimation plot point there and continue
ud have to do 2 approximations for first integration and then 2nd
dy/dx numerical approxximation, then y
right?
Join our real-time social learning platform and learn together with your friends!