1

我正在尝试在 MuPad 中绘制以下管

X := 0.4448-0.1423*cos(t*0.0013)+0.0236*sin(t*0.0013)+0.0180*cos(2*t*0.0013)-0.0818*sin(2*t*0.0013);
Y := -0.2619+0.1274*cos(t*0.001)+0.0828*sin(t*0.001)-0.0108*cos(2*t*0.001)+0.0707*sin(2*t*0.001);
Z := 0.2493+ 0.2703*cos(t*0.0009) + 0.1823*sin(t*0.0009) + 0.0349*cos(2*t*0.0009) + 0.0991*sin(2*t*0.0009);
plot(plot::Tube([X, Y, Z],0.1*cos(t),t=0..2*PI));

这给出了以下错误:

Error: The index is invalid. [list]
  Evaluating: plot

函数和系数在 MATLAB 中计算并在 MuPad 中复制粘贴,应该没问题。我的 MATLAB 版本是 2015b,以下命令可以正常工作:

X := sin(t);
Y := cos(t);
Z := t;    
plot(plot::Tube([X,Y,Z],0.3*cos(t),t=0..2*PI))

更新:

这也有效:

plot(plot::Tube([X, t, Z],0.2*cos(t),t=0..2*PI))

我也试图改变表示,它也没有工作。

sx := t*0.0013:
sy := t*0.001:
sz := t*0.00088:
b := matrix([[0.4448,-0.1423,0.0236,0.0180,-0.0818],[-0.2619,0.1274,0.0828,-0.0108,0.0707],[0.2493,0.2703,0.1823,0.0349,0.0991]]):
a := matrix([[1,cos(sx),sin(sx),cos(2*sx),sin(2*sx)],[1,cos(sy),sin(sy),cos(2*sy),sin(2*sy)],[1,cos(sz),sin(sz),cos(2*sz),sin(2*sz)]]):
at := transpose(a):
Xn := b[1,1..5]*at[1..5,1];
Yn := b[2,1..5]*at[1..5,2];
Zn := b[3,1..5]*at[1..5,3];
plot(plot::Tube([Xn[1], Yn[1], Zn[t]],2*cos(t),t=0..2*PI))
4

0 回答 0