I have the following equations of motion of a point:
x(t):=r*cos(t^2)$
y(t):=r*sin(t^2)$
z(t):=b*t$
I already calculated the velocities and accelerations but now I would like to plot a path in 3D for this data:
r:5;
b:2;
It should look like a kind of spiral.
I tried various commands to create this 3D plot but none of them worked. All the examples of 3D plots in wxMaxima that I've found are surfaces while in this case, I want to create a curve. Is it possible in this software?
Here are two of the failed attempts:
wxplot3d([x(t), y(t), z(t)], [t, 0, 45]);
wxplot3d([parametric, x(t), y(t), z(t), [t, 0, 45]]);
UPDATE: The command below works but the plot is incorrect for some reason (I attached it as a picture). Is that because of the characteristics of these functions? Do I need some additional input?
wxdraw3d(parametric (x(t), y(t), z(t), t, 0, 45));
UPDATE 2: I tried the following command:
wxdraw3d(nticks = 10, parametric (x(t), y(t), z(t), t, 0, 45));
and the plot looks better (only with nticks=10
):
But it's still not what I would expect. Here's a reference plot from a Polish book describing MathCAD use in mechanics (so I can't utilize the code presented there directly):
Maybe the problem lies in the fact that the authors of this book use some tricks ("auxiliary variables scaling the argument of the function") to obtain the plot. But I assume that it's only necessary in MathCAD. I can be wrong though...
If you know how to define a range variable in Maxima, I can try to replicate the approach from the book in Maxima.
UPDATE 3: Here's what was done in the book to obtain that plot using MathCAD:
define auxiliary variables scaling the argument of the function:
M:=1000
K:=0,1.. 45
for which the time domain is given by:
t_k:=k*sqrt(π/M)
define the functions for plotting as:
X_k:=r*cos(((k^2)/M)*π)
Y_k:=r*sin(((k^2)/M)*π)
Z_k:=b*k
And here's my attempt to translate this to Maxima:
M:1000$
assume(k >= 0, k <= 45);
t_k:k*sqrt(%pi/M);
X_k(t_k):=r*cos(((k^2)/M)*%pi);
Y_k(t_k):=r*sin(((k^2)/M)*%pi);
Z_k(t_k):=b*k;
wxdraw3d(nticks = 10, parametric (X_k(t_k), Y_k(t_k), Z_k(t_k), t_k, 0, 45));
Unfortunately, I get the following error:
draw3d (parametric): non defined variable
That's likely because of the way k
was defined. Can such a range variable be defined differently in Maxima?