Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MegaSignal

macrumors 6502
Original poster
Oct 20, 2003
304
0
Good afternoon.

I have been having trouble with graphing piecewise funcitons with Tiger's Grapher application.

A condition such as x>0 works just fine, but I need a segment, such as:

1 < x < 3

which causes Grapher to produce an error.

Is there any way to graph a segment?

Thanks all in advance!

ms
 
When all else fails, read the manual or, in this case, the Help file.

Grapher Help said:
Entering a piecewise defined function

A piecewise equation has more than one formula. You need to enter each formula and the condition under which it should be used.
  1. Choose Equation > New Equation.
  2. Choose Condition from the pop-up menu next to the Equation field.
  3. Enter the number of conditions in the equation.
  4. Enter the conditions and expressions in the template.
Make sure the conditions are either all on the left or all on the right. If the last entry has no condition, that expression is used if none of the other conditions apply.

You can also enter a piecewise function with this format:

y = condition ? expression1 : expression2

or

y = condition : expression1 : expression2

In these examples, expression1 is used if the condition is true. Otherwise, expression2 is used. You can leave out expression2 if it's not needed.

See also
Creating graphs
 
MisterMe, your reply wasn't really helpful. He knows how to use conditions, he's asking a rather specific question about how to use conditions that include more than one greater-than/less-than expression in a single condition.

The way to do it is actually not hard, but I only figured it out by trying a few things. Just use the ampersand symbol to AND two conditions together. For example, if you wanted to specify the condition 1<x<3, enter it as (x>1)&(x<3).

Grapher is a wonderful little app, and it's quite sophisticated. Unfortunately, I don't think Apple did a very good job with the help for it. I've frequently had trouble getting it to do what I wanted to do. There's almost always a way, but it's not always explained very well or particularly intuitive.
 
Wow - a special Thanks-A-Million to mduser63!

Thanks, my friend! I am now able to complete my assignment!

I can't express how greatful I am for your help; I must agree, Grapher is a great application, but the help file (as quoted above) is not the best; ironically, the screen shot above is a familiar one to me.

After having tried commas and various iterations of parenthesies, I never thought of the "&" symbol.

I've tried it and it works!

All the best,


M_S_ (a.k.a. a humble calculus student)

By the way - what do you think of Mathematica? Do you think that i might be interested in this app?
 
I actually have never used Mathematica. I've got a lot of experience with Matlab, and some with Maple.

Maple is really nice for pure math. It's got a really good computer algebra system, and can do a lot of really powerful things with symbolic math. It will symbolically perform complicated derivatives, integrals, solve functions symbolically, etc. It's good for graphs too. If you've ever used a TI-89 or HP-49 calculator, Maple is like one of those on steroids.

Matlab is really nice for "practical/engineering" math. Although it does have some support for symbolic math, it's not (IMO) particularly good for that. However, its main strength is really good tools for doing numerical math and matrix stuff. Signal processing, manipulation of large amounts of numerical data, etc are easily done with Matlab.

I've heard that Mathematic is sort of in between those two. Better at symbolic math than Matlab, and better at numerical stuff than Maple. Like I said though, I've never used it so I can't give my own opinion on it.
 
Thanks so Much!

I just found this thread using Google, and I MUST thank you. I'm taking Algebra II and we are require to graph piecewise functions that use compound inqualities, and I was really stumped until I found this thread.

Thanks so much!!

:) :cool:
 
Save a graph

Is there any way to save a picture of the graph when you finish one as in a picture format such as .jpg or .png. Also can you print the graph?


This is such a great App!
 
Eraserhead's method is good, but there is a better way to take a picture. If you go to the file menu of the grapher, and then click on export, it will give you options for exporting the graph as a TIFF, PDF, PNG, and even a quicktime file if it is a moving 3-d graph.
 
I discovered by accident that it works with the colon as well as the & symbol. So you can type in x>2:x<5 and it will be the same as 2<x<5.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.