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

9 ビュー (過去 30 日間)
aneps
aneps 2015 年 5 月 26 日
コメント済み: Walter Roberson 2015 年 5 月 27 日
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 Center および File Exchange3-D Function Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by