Mathematica Drawing a ParametricPlot3D in Mathematica with n & t

AI Thread Summary
The discussion revolves around plotting a function that depends on two variables, n and t, using Mathematica's ParametricPlot3D. The user seeks to visualize the function for specific discrete values of n within a defined interval [a, b], rather than for all values in that range. The goal is to plot the function at intervals of size (b-a)/m, effectively selecting m points from the interval. Several solutions are proposed, including using Plot3D with a specified step size for n, and utilizing Table to create a list of function values. The suggested commands include Plot and Show, which allow for the plotting of multiple discrete function values for n while keeping t in the range [0, 1]. The conversation emphasizes the importance of ensuring the function is listable for these methods to work effectively.
andlook
Messages
32
Reaction score
0
Hi
I have a function that relies on n and t. I am presently drawing it with "ParametricPlot3D." I am drawing it for all t in [0,1]. Now I can either draw this for all values of n in a defined interval, say [a,b], just as I define it to draw all t. Or I can draw one value of n by using the "Manipulate[ ParametricPlot3D[" and changing the value of n in [a,b].

My problem is I want to draw the function for a large number of values of n in [a,b] in the same diagram. t always runs through [0,1].

I can't find a command for this, is there one? I'm sure that this can be done some how... Any thoughts?

Thanks
 
Physics news on Phys.org
What kind of a function is it? If it is a function
f: \mathbb{R}^2 \to \mathbb{R}, (n, t) \mapsto f(n, t)
then something like
Plot3D[f[n, t], {t, 0, 1}, {n, a, b}]
will do the trick, won't it?
 
Yeah that is the general function I am trying to plot.

But Plot3D[f[n, t], {t, 0, 1}, {n, a, b}] plots all the values of n from a through to b. I want only draw the function at, for example, a, a+1, a+2, a+3, ... b. but nothing in the interval (a+i,a+i+1).

So a command that says draw m points of the function for intervals of size (b-a)/m points in [a,b].

So if the function was f(n,t) = t.sin(n), t is [0,1] and n in [0,Pi] I want mathematica to plot, 0 , Pi/4, Pi/2, 3.Pi/4.

something like Plot3D[f[n, t], {t, 0, 1}, {n, ? }]
 
How about you plot them separatel:

Code:
Plot[Table[f[n, t], {n, a, b, (b - a)/m}], {t, 0, 1}]
Show[Table[Plot[f[n, t], {t, 0, 1}], {n, a, b, (b - a)/m}]]]

(I think the first one should work, the second one definitely does) or, in older versions of Mathematica,
Code:
Plot[Table[f[n, t], {n, a, b, (b - a)/m}] // Evaluate, {t, 0, 1}]
Show[Table[Plot[f[n, t], {t, 0, 1}], {n, a, b, (b - a)/m}], DisplayFunction -> None], DisplayFunction -> $DisplayFunction]
 
As long as your function is listable you should be able to simply do:

Plot[Evaluate[f[Table[n,{n,-5,5}],t]],{t,0,1}]
 

Similar threads

Replies
4
Views
3K
Replies
2
Views
2K
Replies
1
Views
2K
Replies
2
Views
2K
Replies
2
Views
2K
Replies
2
Views
3K
Replies
9
Views
3K
Replies
6
Views
2K
Back
Top