Drawing a ParametricPlot3D in Mathematica with n & t

  • Context: Mathematica 
  • Thread starter Thread starter andlook
  • Start date Start date
  • Tags Tags
    Mathematica Programming
Click For Summary

Discussion Overview

The discussion revolves around plotting a function in Mathematica using "ParametricPlot3D" for multiple discrete values of a parameter \( n \) while keeping another parameter \( t \) in the range [0,1]. Participants explore different methods to achieve this, focusing on how to visualize the function for specific intervals of \( n \) rather than a continuous range.

Discussion Character

  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant seeks a way to plot a function for a large number of discrete values of \( n \) within a defined interval [a,b] while \( t \) varies from 0 to 1.
  • Another participant suggests using "Plot3D" to visualize the function for all values of \( n \) in the interval, but this does not meet the original request for discrete points.
  • A later reply proposes plotting the function separately for each value of \( n \) using "Table" and "Show," indicating that this approach should work for the desired visualization.
  • Another participant mentions that if the function is listable, it can be plotted directly using "Plot" with "Evaluate" and "Table" to generate the necessary values of \( n \).

Areas of Agreement / Disagreement

Participants present various methods to achieve the desired plotting, but there is no consensus on a single best approach. Multiple competing views on how to implement the plotting exist.

Contextual Notes

Some methods depend on the function being listable, and there may be limitations based on the specific version of Mathematica being used. The discussion does not resolve the best method for all scenarios.

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
[tex]f: \mathbb{R}^2 \to \mathbb{R}, (n, t) \mapsto f(n, t)[/tex]
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 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K