I am working on a code that has a system of ODEs, but I have never worked with systems with ode45. In the part of the code that I have included, S is the arclength (which is basically the time step of this problem), th is the angle (theta) of the graph, R is the x coordinate, and Z is the y coordinate.
When I run the program as shown below, I get simply a matrix full of NaN, even when I change the initial R value to 0.0001 or something.
Any help would be appreciated.
Also, what is the output? I only want to graph R and Z, not theta
yp=[dthdS; dRdS; dZdS];
[S,Y]=ode45(@program, [0, 1], [0, 0, 0])