# How to plot with Matlab a motion equation (in Frenet Serret coordinate)

I am stuck for a little while on a problem that I don't really know where I should start.

The aim is to plot in Matlab the motion of a ball governed by the following equation:

$$M \frac{d\mathbf{U}}{ds}U\mathbf{t}+M\frac{d\theta}{ds}\mathbf{n}=-\frac{1}{2} \rho U^2 S C_D \mathbf{t} + \rho R^3 {\Omega_0}{U}C_\Omega \mathbf{n}$$

knowing that:

$$\mathbf{U}(s)=U_0 \times e^{-\frac s {C_2}}$$

$$\frac{d\theta}{ds}=\frac{1}{C_1} e^{\frac s {C_2}}$$

I am trying from these equations to get back to cartesian coordinates in order to plot them but I fail every time.

Do someone have hints about where to start ?

• Just out of curiosity, where did thid equation come from? Oct 29, 2015 at 17:16
• Do you need to plot the solution obtained numerically or you want to solve these equatoins? Oct 29, 2015 at 17:20
• @RobertLewis : this equation is the PFD applied to a ball when the gravity is neglected. Then it is just transposed in the Frenet Serret coordinate system. Oct 29, 2015 at 19:37
• @MichaelMedvinsky : Well I'd like to plot the solution numerically obtained in the beginning. But I'm really lost on where to start... Oct 29, 2015 at 19:39

For a numerically obtained solution in a form of real valued matrix, say A, you can try

mesh(A)
surf(A)
pcolor(A)
surface(A)


If the data isn't scattered, just in different coordinates than cartesian, these will visualize your result without the link to the coordinates, i.e. the indices of the matrix will be considered coordinates. This won't work with a scattered data though.

The first two will show you the density, the later two will colorize the height. For a non real matrix you can use visualize abs(A), real(A), imag(A)

If you know the connection between the coordinate in which you have the solution, then you compute x and y and use with any of the above plotting functions. x,y can be either vectors or meshgrid. if x,y are vectors, then you can make them mesh using [X,Y]=meshgrid(x,y);

example mesh(x,y',A) or mesh(X,Y,A)