MATLAB: How to solve the differential equation numerically which is of the form : (z”/[1+(z’​)^2]^(3/2)​)+(0.19285​29/x)=2+(5​0.99203)*z ? I need to get the x and z values.

differential equationsnumerical integrationodeode45

Initial conditions are x=0 and z=0

Best Answer

Start with this:
(z"/[1+(z')^2]^(3/2))+(0.1928529/x)=2+(50.99203)*z
Solve for the highest order derivative z"
z" = [1+(z')^2]^(3/2) * (2 + (50.99203)*z - (0.1928529/x))
And then follow the examples in the ode45 doc for solving a 2nd order ODE. E.g., the derivative function
dzdx = @(x,z) [z(2); ((1+z(2)^2)^(3/2)) * (2 + (50.99203)*z(1) - (0.1928529/x))
The initial vector assuming the initial value z' = 0 (you didn't specify)
z0 = [0;0];