Maple plot3d variable increment

In summary, you would use the grid =[a,b] specification to specify the number of grid points to plot. You would use the plot3d command to plot the cosine function with x and y as parameters. You would modify the increment values of x and y which are plotted using the grid =[9,21] specification. Lastly, you would use the restart command to restart the plot.
  • #1
dank0608
2
0
I have an equation with two variables x and y.

I wish to plot a function in 3d (let's say cosine) with x and y as parameters.

I know the plot3d command in Maple is as follows:

Code:
plot3d(cos(x+y),x=-1..1, y =-1..1);

My question is this: how would I modify the increment values of x and y which are plotted?

For instance I want x=-1 to 1 but only in 0.25 increments and y=-1 to 1 in 0.1 increments.

A second question is: How do I display each value for what maple is plotting in 3d?
for instance:
f(x,y) = cos(x+y) => f(x,y) = ?
x = some value between -1 and 1 (in 0.25 increments)
y = some value between -1 and 1 (in 0.1 increments)

for question 2, basically I'm looking for something like [seq(f(x),x=a..b,increment)]
 
Physics news on Phys.org
  • #2
dank0608 said:
I have an equation with two variables x and y.

I wish to plot a function in 3d (let's say cosine) with x and y as parameters.

I know the plot3d command in Maple is as follows:

Code:
plot3d(cos(x+y),x=-1..1, y =-1..1);

My question is this: how would I modify the increment values of x and y which are plotted?

For instance I want x=-1 to 1 but only in 0.25 increments and y=-1 to 1 in 0.1 increments.

I will answer your first question for the moment. You want to use the grid =[a,b] specification. That tells you how many grid points to plot. So if you want to go from -1 to 1 with 8 intervals of length .25, you need 9 grid points counting the start and end point. To go from -1 to 1 with 20 intervals of length .1 you need 21 grid points. So use:

plot3d(cos(x+y),x=-1..1, y =-1..1, grid = [9,21]);
 
  • #3
dank0608 said:
A second question is: How do I display each value for what maple is plotting in 3d?
for instance:
f(x,y) = cos(x+y) => f(x,y) = ?
x = some value between -1 and 1 (in 0.25 increments)
y = some value between -1 and 1 (in 0.1 increments)

for question 2, basically I'm looking for something like [seq(f(x),x=a..b,increment)]

For your second question try this:
Code:
restart;
f := (x, y) → cos(x+y);
for k from 0 to 20
   do
      seq(f(-1+.25*j, -1+.1*k), j = 0 .. 7)
   end;

I have used your 20 and 8 intervals as an example.
 
  • #4
Awesome, this is exactly what I was looking for. I figured the first one I would need to specify a plot option but missed 'grid'.

Thanks for your help.
 
  • #5


I would suggest using the "grid" option in the plot3d command to modify the increment values for x and y. This allows you to specify the number of points along each axis rather than a specific increment value. For example, you could use the following command:

plot3d(cos(x+y),x=-1..1, y =-1..1, grid=[5, 11]);

This would create a grid with 5 points along the x-axis and 11 points along the y-axis, resulting in increments of 0.25 for x and 0.1 for y.

To display the values being plotted, you can use the "values" option in the plot3d command. This will show the numerical values of the function at each point in the plot. For example, you could use the following command:

plot3d(cos(x+y),x=-1..1, y =-1..1, values=true);

This would display the values of cos(x+y) at each point in the plot.

For the second question, you could use the "seq" command to generate a sequence of values for x and y and then plug those values into the function f(x,y). For example, you could use the following command:

seq(f(x,y), x=-1..1, 0.25), y=-1..1, 0.1));

This would generate a sequence of values for x and y in the specified increments and then plug them into the function f(x,y). You could then use this sequence to display the values being plotted.
 

Related to Maple plot3d variable increment

1. What is the purpose of using the "Maple plot3d variable increment" function?

The "Maple plot3d variable increment" function is used to plot three-dimensional graphs in Maple. It allows you to specify the increment or spacing between points on the x and y axes, giving you more control over the appearance of your graph.

2. How do I use the "Maple plot3d variable increment" function?

To use the "Maple plot3d variable increment" function, you first need to define your function or equation. Then, you can use the plot3d command, followed by the function and the variable increments specified using the 'xincrement' and 'yincrement' arguments. For example, plot3d(sin(x*y), x = 0 .. 2*Pi, y = 0 .. 2*Pi, xincrement = Pi/4, yincrement = Pi/4) would plot the sine function with increments of Pi/4 on both the x and y axes.

3. Can I change the increments after I have already plotted the graph?

Yes, you can change the increments by modifying the 'xincrement' and 'yincrement' arguments in the plot3d command and re-executing the code. This will update the graph with the new increments specified.

4. What happens if I don't specify the variable increments in the "Maple plot3d variable increment" function?

If you do not specify the variable increments, Maple will automatically choose the increments based on the range of values in your function. This may result in a graph that is too crowded or too sparse, so it is recommended to specify the increments for better control over the appearance of your graph.

5. Can the "Maple plot3d variable increment" function be used for any type of graph?

No, the "Maple plot3d variable increment" function can only be used for three-dimensional graphs. For two-dimensional graphs, you can use the plot command and specify the 'step' argument to control the spacing between points on the graph.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
10
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
905
  • Engineering and Comp Sci Homework Help
Replies
11
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
2K
Replies
18
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
6
Views
3K
Replies
17
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
3K
  • Differential Equations
Replies
5
Views
2K
Back
Top