Adept Scientific - English
The world's best software and hardware 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  
UKdedksvnofi
Home
Products
Training
Events
 Buy Online
Downloads
Academic Discounts
Support
My Adept
International |  About Us |  Adept Scientific Blog |  Contact Us |  Press Room |  Jobs
Adept Scientific on Facebook Adept Scientific on Twitter Adept Scientific on YouBube Adept Scientific on LinkedIn


The Next Steps

• Ask us a question
• Watch Maple Video Demonstrations
• Buy Maple Now
• View Maple Pricing
• Download a Brochure
• Request an Evaluation
• Meet Our Team
• Read our RSS Feeds

Learn More

Maple Home
Maple 17 Overview
Maple 17 Professional
Maple 17 Academic
Maple 17 Student Use
What's New in Maple 17
Maple Features
Maple History
Recorded Online Seminars

MapleSim
MapleNet
Maple T.A.
BlockImporter™
Maple Toolboxes
The Möbius Project

Maple Rave Reviews
Maple Study Guides
Books about Maple
System Requirements

Latest Information

New Features: Professional
New Features: Academic
Maple Features
The Maple Reporter Online

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] Re: Curiosity

Search email archive for  

[MUG] Re: Curiosity
Author: Maple Group    Posted: 26/10/2000 19:19:25 GDT
Subject: Curiosity


Problem is in the rounding that occurs in the top line due to x^2+25 term,
which converts the top line to a step function as seen (Maple Vr5.1) in:
plot((sqrt(x^2+25)-5),x=-0.0000003..0.0000003);
The divisor then converts this to a saw tooth.

Regards,

-----------
Bill Whiten,
Julius Kruttschnitt Mineral Research Centre,
The University Of Queensland, Tel: int +61 7 3365 5888
Isles Rd, Indooroopilly, Fax: int +61 7 3365 5999
Brisbane Qld 4068, AUSTRALIA.




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

Date: Mon, 23 Oct 2000 16:25:23 -0700 (PDT)
From: Robert Israel
To: maple
Subject: Curiosity

A closer inspection reveals that the "sines" are actually sawtooths. The
explanation is this. To simplify matters slightly, let's look at
the slightly simpler (sqrt(x^2+1)-1)/x^2.

Suppose x is positive but small. Maple is computing sqrt(x^2 + 1) (using
evalhf) to a certain accuracy. Since the derivative of this function is
very close to 0 when x is small, the result will be constant over
substantial intervals: if epsilon is the smallest positive number such
that 1+epsilon has a representation different from 1, it appears that
sqrt(x^2+1) will be computed as 1 for x < sqrt(3 epsilon/2), then
1+j*epsilon for sqrt((2 j - 1/2) epsilon) < x < sqrt((2 j + 3/2) epsilon)
for each small positive integer j. Thus (sqrt(x^2+1)-1)/x^2 will be
computed as j*epsilon/x^2 in this interval. The first "tooth" in the plot
of (sqrt(x^2+1)-1)/x^2, corresponding to j=1, will go from
[sqrt(3/2 epsilon), 2/3] to [sqrt(7/2 epsilon), 2/7], the second from
[sqrt(7/2 epsilon), 4/7] to [sqrt(11/2 epsilon), 4/11], etc.
You can get epsilon from
> evalhf(DBL_EPSILON);
On my machine it is .222044604925031308e-15.

If the use of evalhf is prevented, e.g. by using (sqrt(Re(x^2)+1)-1)/x^2,
the pattern is a bit more complicated. I think this is because there
are two separate rounding steps in this case (while under evalhf the
numeric processor may store intermediate results at higher precision than
what it uses to report the output).

Robert Israel
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2





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

Date: Tue, 24 Oct 2000 09:34:54 +0200
From: Heike Koch-Beuttenmueller
To:
Subject: Curiosity

> Treating TRUE as 1 and FALSE as 0, was unexpected.
Why true is plotted as 1 and false as 0 I don't know, but I would be
interested to know it.

You have written an inequality. Multiplying it, is possible in Maple.
Both sides are multiplied with 3. But adding 2 to both sides is not
possible.
> >plot(2+((x-2)*(x+1)<0),x=-2..3,thickness=3);

For example:
2*((x-2)*(x+1)<1);
2 (x - 2) (x + 1) < 2

> 2+((x-2)*(x+1)<0);
Error, (in simpl/relopsum) invalid terms in sum


The normal accuracy Digits:=10 is not enough for plotting in this
domain. So you get a lot of numerical errors .
Try Digits:=30; and set the region for y=0..0.2 for example, then the
numerical calculations are more stable. Have a look at the numerical
behaviour when you calculate x^2 +25 for small x ...


Mit freundlichen Gruessen

Heike Koch-Beuttenmuller

[View Complete Thread]



Previous by date: [MUG] Re: Bug in contourplot in Maple6, Maple Group
Next by date: [MUG] Re: table -> plot3d in Maple V R 4, Maple Group
Previous thread: [MUG] rootof and allvalues, Don Hartig
Next thread: [MUG] table -> plot3d in Maple V R 4, Franck Courchamp



Ready to buy?

Maple Professional
Add to shopping basket
£ 1,695.00
Maple - for academic use
Add to shopping basket
£ 940.00
Maple - for registered students
Add to shopping basket
£ 95.00

Featured Downloads

Maplesoft Product Catalogue
Maple Player for iPad - Datasheet
Maple 17 What's New datasheet
Maple 17 Professional Datasheet
Maple Whitepaper: Driving Innovation - How mathematical modeling and optimisation increase efficiency and productivity in vehicle design.
MapleSim Whitepaper - Technological Superiority in Multi-Domain Physical Modelling and Simulation

Latest Downloads

Maple - Global Optimization Toolbox
The Möbius Project - Create it, Share it, Grade it
Maple 17 Programming Guide
Maple 17 User Manual
Maplesoft Product Catalogue - Academic Maths

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

Latest News

New MapleSim release delivers advanced model development and analysis, extended toolchain connectivity and quicker results
Maple 17 offers advanced solving and application development capabilities
New release of Maple advances teaching and research
New release of Maple advances teaching and research
Maplesoft introduces The Möbius Project for creating, sharing and grading interactive maths apps
adept

Top of the Page

Popular Links: ChemDraw | ChemOffice | Data Acquisition | Data Analysis | EndNote | Maple | MapleSim | Mathcad | MathType | Quality Analyst | Reference Manager | VisSim

EU ePrivacy Directive | Our Privacy and Terms and Conditions Statement
All Trademarks Recognised. Copyright © 2013, Adept Scientific Ltd.
Site designed and maintained by Lyndon Ash

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