How to plot a function which is in cylindrical coordinates - A 3D plot?
19 visualizzazioni (ultimi 30 giorni)
I am learning about traps in physics. I want to plot the following function on Matlab to visualize (A 3D plot):
F(r,z) = k/2 (z^2 - r^2/2) + k/2 * R^2 * ln(r/R) + C
This is in cylindrical coordinates. Let us take constants k=1, R=1 and C=1.
After plotting this, I want to plot one more thing,
z(r) = [r^2/2 - R^2/2 + R^2 *ln(R/2)]^0.5.
My aim is to visualize F(r,z) and z(r).
These equations are related to an ion trap mass spectrometer called Orbitrap.
Walter Roberson il 26 Mag 2015
If you are willing to work inside a MuPAD notebook, then you could use Plot::Cylinder. I do not know if those plots can be exported as MATLAB objects.
Otherwise, use pol2cart() on your [theta,r] coordinates to get [x,y] coordinates, and then use your defined z for the z coordinate.