How to plot a function which is in cylindrical coordinates - A 3D plot?

조회 수: 21 (최근 30일)
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
Walter Roberson 2015년 5월 26일
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.
  댓글 수: 2
aneps
aneps 2015년 5월 27일
I never knew about MuPAD. Do I need to install MuPAD? After installing can I work from the Matlab?
Walter Roberson
Walter Roberson 2015년 5월 27일
MuPAD is the formal name of the Symbolic Toolkit implementation. When you have that toolkit installed there are a number of interface routines that take care of communicating with MuPAD automatically, but from time to time in order to access functionality there is no interface for, you need to
evalin(symengine, 'MUPAD COMMAND STRING');
I have never had access to the MuPAD version of the Symbolic Toolkit (I used to have the Maple based Symbolic Toolkit), so one of the things I do not know is whether you can call upon the MuPAD graphics from MATLAB using evalin() or feval(). Possibly you would just get back the graphics data structure without it being drawn. (MuPAD plots are represented as data structures that can be manipulated as data, with the user interface having special rules about how to display those kinds of data structures.)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 3-D Function Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by