Results 1 to 3 of 3

Math Help - Maple: Only getting partial plot. Something wrong with function I guess!

  1. #1
    Newbie
    Joined
    May 2009
    Posts
    1

    Maple: Only getting partial plot. Something wrong with function I guess!

    Hello =)
    I have the following code:
    > fracy := proc (d, r) if r < d then 1 else 1-arccos(sqrt(r^2-d^2))/pi end if end proc;

    > plot('fracy(x, 1)', x = 0 .. 2);

    But this plots only x=1..2, not x=0..1
    It only does part of the plot!
    I needed to use to ' ' else it would complain that it cannot evaluate the if.

    Thanks,
    Remy.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Rhymes with Orange Chris L T521's Avatar
    Joined
    May 2008
    From
    Santa Cruz, CA
    Posts
    2,844
    Thanks
    3
    Quote Originally Posted by steenreem View Post
    Hello =)
    I have the following code:
    > fracy := proc (d, r) if r < d then 1 else 1-arccos(sqrt(r^2-d^2))/pi end if end proc;

    > plot('fracy(x, 1)', x = 0 .. 2);

    But this plots only x=1..2, not x=0..1
    It only does part of the plot!
    I needed to use to ' ' else it would complain that it cannot evaluate the if.

    Thanks,
    Remy.
    It worked for me. See Attachment.
    Attached Files Attached Files
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor
    Jester's Avatar
    Joined
    Dec 2008
    From
    Conway AR
    Posts
    2,346
    Thanks
    29
    Quote Originally Posted by steenreem View Post
    Hello =)
    I have the following code:
    > fracy := proc (d, r) if r < d then 1 else 1-arccos(sqrt(r^2-d^2))/pi end if end proc;

    > plot('fracy(x, 1)', x = 0 .. 2);

    But this plots only x=1..2, not x=0..1
    It only does part of the plot!
    I needed to use to ' ' else it would complain that it cannot evaluate the if.

    Thanks,
    Remy.
    Two things
    (1) Are you using pi or Pi. It makes a difference.
    (2) You can use the piecewise function command

    fracy:=(d,r)->piecewise(r<d,1,1-arccos(sqrt(r^2-d^2))/Pi);
    plot(fracy(x, 1), x = 0 .. 2);

    which gives Chris's picture.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Help to plot a complex function in Maple
    Posted in the Calculus Forum
    Replies: 0
    Last Post: April 1st 2011, 12:19 AM
  2. I have little problem with 3D plot in Maple
    Posted in the Calculus Forum
    Replies: 1
    Last Post: April 17th 2010, 05:45 AM
  3. maple box plot fences
    Posted in the Advanced Statistics Forum
    Replies: 0
    Last Post: June 14th 2009, 05:33 PM
  4. Maple 12/ Sigma Plot 11.0
    Posted in the Math Software Forum
    Replies: 0
    Last Post: June 6th 2009, 05:33 PM
  5. how to plot a graph in maple 11
    Posted in the Math Software Forum
    Replies: 0
    Last Post: March 27th 2008, 10:11 PM

Search Tags


/mathhelpforum @mathhelpforum