Maple plot3d variable increment

  • Thread starter Thread starter dank0608
  • Start date Start date
  • Tags Tags
    Maple Variable
Click For Summary

Discussion Overview

The discussion revolves around plotting a 3D function using Maple, specifically the cosine function with two variables, x and y. Participants explore how to set specific increment values for these variables and how to display the computed values for the function at those increments.

Discussion Character

  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant asks how to modify the increment values of x and y in the plot3d command for a cosine function.
  • Another participant suggests using the grid option in the plot3d command to specify the number of grid points based on the desired increments.
  • A follow-up question is posed about how to display the values of the function being plotted, seeking a method to generate a sequence of function values at specified increments.
  • A later reply provides a code snippet to generate and display the function values for the specified increments of x and y.

Areas of Agreement / Disagreement

Participants generally agree on the use of the grid option to control the number of plotted points, and the responses to the second question provide a method for displaying function values. However, there is no explicit consensus on alternative methods or additional details regarding the implementation.

Contextual Notes

Limitations include assumptions about the increments and the specific range of values for x and y, as well as potential dependencies on the definitions of the functions used.

dank0608
Messages
2
Reaction score
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
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]);
 
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.
 
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.
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 1 ·
Replies
1
Views
991
  • · Replies 5 ·
Replies
5
Views
2K