Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
2D graph modulus
16-11-2011, 02:59 PM (This post was last modified: 16-11-2011 09:23 PM by cliverlong.)
Post: #1
2D graph modulus
Hello,

If I graph an equation with one modulus e.g.

y = (|x| − 1)

Autograph (3.3) shows the expected "V" shape

If I plot

y = |(|x| − 1)|

which Wolfram Alpha shows as a "W" - Autograph cannot handle this - nothing is plotted

Clive
see some screen shots


Attached File(s) Thumbnail(s)
       
Find all posts by this user
Quote this message in a reply
16-11-2011, 09:27 PM
Post: #2
RE: 2D graph modulus
Attached are two screen shots of how Wolfram Alpha plots the two equations - correctly in my opinion.

I have updated the original post a "few" times to correct errors Blush

Clive
       
Find all posts by this user
Quote this message in a reply
17-11-2011, 10:39 AM
Post: #3
RE: 2D graph modulus
Hello

This issue is caused by the ambiguity of the modulus symbol. Unlike brackets there is no distinct open and close modulus symbol so it is not always easy to determine nested expressions.

In order to resolve the abiguity you can use the alternative syntax for the nested modulus. e.g.

y = |(abs(x) − 1)|

Hope this helps.

Regards
Mark
Visit this user's website Find all posts by this user
Quote this message in a reply
17-11-2011, 06:43 PM (This post was last modified: 17-11-2011 06:48 PM by cliverlong.)
Post: #4
RE: 2D graph modulus
(17-11-2011 10:39 AM)Support Wrote:  Hello

This issue is caused by the ambiguity of the modulus symbol. Unlike brackets there is no distinct open and close modulus symbol so it is not always easy to determine nested expressions.

In order to resolve the abiguity you can use the alternative syntax for the nested modulus. e.g.

y = |(abs(x) − 1)|

Hope this helps.

Regards
Mark

Thanks for the reply.

I thought that the answer would be difficulty in getting a program to parse a statement such as

| X|a||

However, in the example I gave I deliberately used brackets to overcome such a potential ambiguity, not just to a human reader but to Autograph. Also, Wolfram can handle the expression (with brackets) correctly.

But at least by using the abs() function I can enter the expression in a way that produces the expected results - in fact, I will check it now.

Clive
The abs function works well. See attached example.

Thanks

clive


Attached File(s)
.pdf  w.pdf (Size: 36.21 KB / Downloads: 6)
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)