Adept Scientific - English
The world's best software for research, science and engineering.
flag arrow
clearclear
 

 Adept Store | register Join My Adept | Flags  
Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055  
UKusdedksvnofi
Home
Products
Training
Consultancy
 Buy Online
Downloads
Education
Support
My Adept
International |  About Us |  Contact Us |  Press Room |  Jobs


The Next Steps

• Ask us a question
• Maple Product Tour
• Buy Maple Now
• View Maple Pricing
• Download a Brochure
• Request a Brochure
• Download a Demo
• Request a Demo
• Meet Our Team
• Read our RSS Feeds

Learn More

Maple Home
Maple 12 Professional
Maple 12 Academic
Maple 12 Student Use
Recorded Online Seminars
FREE Training Resources
Maple Application Briefs
Maple Adoption Program

MapleNet
Maple T.A.
MapleConnect
BlockImporter for Simulink
BlockBuilder for Simulink
Maple Toolboxes
Maple Rave Reviews
Maple Study Guides
Books about Maple
System Requirements

Latest Information

New Features: Professional
New Features: Academic
The Maple Reporter Online
Numerical Algorithms Group
(NAG)


Service & Support

Maple Primes
blogs, forums etc

Elite Maintenance Program
Application Centre
Powertools
Search the Knowledge Base
Technical Support request

List Archives >  Maple User Group List Archive >  Archive by date >  This Month By Date >  This Month By Topic

[MUG] why the plot is not consistent with evaluated value?

Search email archive for  

[MUG] why the plot is not consistent with evaluated value?
Author: Xiaoyan Li    Posted: Fri, 22 Nov 2002 04:21:58 -0500

>> From: Xiaoyan Li "xili"

Hello,

I am using maple to plot an expression using the following file. The
strange thing is, some of the plotted value don't comply with the
evaluated value.

In the bottom of the file, I have purposely evaluated expression value at
some particular points, you can see the discreprency directly.

Could some one help me figure out why this is happening?

--------------------------------------------------------------

g := Pi*((2*R-x)^2-R^2);
Fx := exp(-m*g*(1-exp(-n*2)));
fx := diff(Fx,x);
Ex := int(x*fx,x=0..R);
tmpEx := subs(m=1/Pi,n=0.2,Ex);
plot(tmpEx,R=0..40);
v_5_tmp:= eval(tmpEx,R=5);
v_5 := evalf(v_5_tmp,9);
v_20 := eval(tmpEx,R=20);
v_30 := eval(tmpEx,R=30);
v_40 := eval(tmpEx,R=40);

------------------------------------------------------------

Thanks,
Xiaoyan
==============================

[MUG] Re: why the plot is not consistent with evaluated value?
Author: Maple User Group    Posted: Wed, 27 Nov 2002 10:34:48 -0500

>> From: Maple User Group "maple_gr"

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Fri, 22 Nov 2002 00:37:28 -0400
From: C W "sylvester7"
To: "maple-list"
Subject: why the plot is not consistent with evaluated value?

You might observe a difference with the following code :

g := Pi*((2*R-x)^2-R^2);
Fx := exp(-m*g*(1-exp(-n*2)));
fx := diff(Fx,x);
Ex := (int)(x*fx,x=0..R);
Ex2:=collect(expand(Ex),exp,factor);
plot((evalf@subs)(m=1/Pi,n=0.2,[Ex,Ex2]),R=0..40,view=[DEFAULT,0..40]);

With my version of Maple, that is Maple V R4, Ex and Ex2 do not evaluate to the
same.


Chris


-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Fri, 22 Nov 2002 00:41:22 -0400
From: C W "sylvester7"
To: "maple-list"
Subject: why the plot is not consistent with evaluated value?

Hi !

Also try changing Digits and You will see that Ex evaluates differently. There
is a round off error someplace here...


Chris


-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Sat, 23 Nov 2002 10:54:45 -0400
From: Vladimir Bondarenko "vvb"
To: "maple-list"
Subject: why the plot is not consistent with evaluated value?

You have just come across a treacherous loss of accuracy (10 digits
by default). Add Digits := 15: before your plot() and enjoy ;-)


Best wishes,

Vladimir Bondarenko
Mathematical and Production Director
Symbolic Testing Group
Email: "vvb"

Web : http://www.CAS-testing.org/ (under development, 95% ready)
http://maple.bug-list.org/ (under development, 20% ready)

Voice: (380)-652-447325 Mon-Fri 6 a.m. - 3 p.m. GMT
Mail : 76 Zalesskaya Str, Simferopol, Crimea, Ukraine



-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

From: "Dr Francis J. Wright" "F.J.Wright"
To: "xili"
Subject: why the plot is not consistent with evaluated value?
Date: Tue, 26 Nov 2002 17:10:43 -0000


It appears to be a problem of numerical error caused by the cancellation of
large terms in tmpEx. By default, plot uses hardware floating point (for
speed), which is not quite sufficiently precise to handle the numerical
cancellation in this particular problem. One easy way to avoid this is to
set a high enough value for Digits; on my system Digits := 15 was enough to
give the almost-straight-line plot that you (presumably) expect. Setting
Digits to a value larger than evalhf(Digits) forces plot to use software
floating point, and on my system evalhf(Digits) is 14. But for safety I
suggest setting Digits to 20 for this problem.

Francis

Previous by date: [MUG] isqrt command, Adalberto Ayjara Dornelles Filho
Next by date: [MUG] Re: Limit Superior & Limit Inferior, Barsuhn
Previous thread: [MUG] Numerical error, Madham53
Next thread: [MUG] Limit Superior & Limit Inferior,  Classen, Manfred



Ready to buy?

Maple - single user licence
Add to shopping basket
$ 1,895.00
Upgrade to Maple 12 from v11
Add to shopping basket
$ 995.00
Upgrade to Maple 12 from v10 & below
Add to shopping basket
$ 1,395.00

Featured Downloads

Maple White Paper: Technical Knowledge - An Asset You Can Afford to Lose?
Maple in Electronics Application Pack
Maple in Robotics & Aerospace Application Pack
Maple in Finance Application Pack

Product Reviews

"Without the Maple software, we would have to spend weeks generating the equations of motion for every experiment. Then the chances that we did it right would basically be near zero. There would always be a mistake somewhere. It is very difficult to set up a dynamic motion model by hand."
- Jean-Claude PiedBeouf, Ph.D Manager of Robotics, Canadian Space Agency

"Its very good - highly accurate and easy to use. The speed of Maple allows me to change equations and quickly reintegrate them into the application, so more possibilities can be explored to achieve the precise effect desired."
Shawn Neely, Senior R & D Director for PDI/Dreamworks
adept

Top of the Page

Our Privacy and Terms and Conditions Statement
All Trademarks Recognised. Copyright © 2007, Adept Scientific plc.
Site designed and maintained by Adeptise

Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055