Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
Hello there,
Listen, I'm try to use a 3D function to describe a path of an ant in a surface.
The surface rotate at 2*pi/ sec and the ant walks in line from center to away 1 cm/s. The surface is a circle with 1m radius.
After all parametrizations, i have problem to draw it. (you can see document attached)
This is the function that indicates the position of the ant dependent on time:
Then I CreateMesh and this came:
From 0 to 50, it should draw a spiral with 50 lines, or I'm I wrong? And how can i chose Step size in CreateMesh?
I want like t:=0, 1, 2, 3 .. 100. How can i do that on CreateMesh?
Regards,
L. L.
Solved! Go to Solution.
From 0 to 50, it should draw a spiral with 50 lines, or I'm I wrong? And how can i chose Step size in CreateMesh?
You get what you demand! What do you mean with "50 lines"??? You set the number of steps (not the step size) to 50. So your curve is drawn by connecting 40 line segments. Your time is going from 0 second to 50 seconds and because you use a speed of 2*pi/second this means you would get 50 turns/rounds of your spiral. 50 turns with just 40 points??? Thats exactly what you get in your plot and i understand that you are not very happy with that. I guess you would need about 24 points (every 15 degree) per pound (better more) to get an approximately smooth curve. That would mean that you have to set t.step to 1200 which will make the plot fail because of a limit of total number of points allowed in a 3D plot. Add a last argument 2 to Createmesh as we dont need 1200 values for the argument v, which is not used anyway.
Prime can work with units, so why don't you add units to your calculations instead of writing them aside manually. That way you can use Prime to check your units for correctness. Prime does not accept units at the x and y axis of a 3D plot, though, so we have to divide the result of CreateMesh by the unit before we can use it for the 3D plot. In the picture I changed t.end to 10 s
The curve you want to plot is a 2D curve in a horizontal plane only. So why not just use an ordinary 2D plot?
From 0 to 50, it should draw a spiral with 50 lines, or I'm I wrong? And how can i chose Step size in CreateMesh?
You get what you demand! What do you mean with "50 lines"??? You set the number of steps (not the step size) to 50. So your curve is drawn by connecting 40 line segments. Your time is going from 0 second to 50 seconds and because you use a speed of 2*pi/second this means you would get 50 turns/rounds of your spiral. 50 turns with just 40 points??? Thats exactly what you get in your plot and i understand that you are not very happy with that. I guess you would need about 24 points (every 15 degree) per pound (better more) to get an approximately smooth curve. That would mean that you have to set t.step to 1200 which will make the plot fail because of a limit of total number of points allowed in a 3D plot. Add a last argument 2 to Createmesh as we dont need 1200 values for the argument v, which is not used anyway.
Prime can work with units, so why don't you add units to your calculations instead of writing them aside manually. That way you can use Prime to check your units for correctness. Prime does not accept units at the x and y axis of a 3D plot, though, so we have to divide the result of CreateMesh by the unit before we can use it for the 3D plot. In the picture I changed t.end to 10 s
The curve you want to plot is a 2D curve in a horizontal plane only. So why not just use an ordinary 2D plot?
Hello Werner,
You are right. I justo think 3D becouse of ant is in one surface for z=0.03m
You idea makes it ver simple.
Thank you. And thank you for the CreatMesh explanation.
Regards,
LL