1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Maple plot3d variable increment

  1. Nov 25, 2011 #1
    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 (Text):

    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)]
     
  2. jcsd
  3. Nov 27, 2011 #2

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    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]);
     
  4. Nov 28, 2011 #3

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    For your second question try this:
    Code (Text):

    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.
     
  5. Nov 28, 2011 #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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Maple plot3d variable increment
  1. Maple 17 (Replies: 3)

Loading...