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] rootof and allvalues

Search email archive for  

[MUG] rootof and allvalues
Author: Don Hartig    Posted: 26/10/2000 00:51:55 GDT
>> From: Don Hartig

# What is going on with "allvalues" in Maple 6?
#
#
> eqn := x^3-sin(x-1)=0;

3
eqn := x - sin(x - 1) = 0

> soln := solve(eqn);

3 2
soln := 1 + RootOf(sin(_Z) - _Z - 1 - 3 _Z - 3 _Z )

> allvalues(soln);

3 2
1 + RootOf(sin(_Z) - _Z - 1 - 3 _Z - 3 _Z , -1.972700767)

#
# OK, the documentation says that allvalues no longer returns numerical
# values.
#
# That means evalf will, right?
#
> evalf(soln);

-.972700767

# Right.
#
# The next example is an easier equation to solve. Maple 5 (and my teen
# age son) can find the exact solution immediately.
#
> eqn := x^3-sin(x)=0;

3
eqn := x - sin(x) = 0

> soln := solve(eqn);

3
soln := RootOf(_Z - sin(_Z), label = _L1)

> allvalues(soln);

3
RootOf(_Z - sin(_Z), label = _L1)

> evalf(soln);

3
RootOf(_Z - sin(_Z), label = _L1)

>
#
# What's with this? I guess I do not understand the label business. The
# help page is not very helpful.



****************************************************************************
Donald Hartig | Telephone: (805) 756 1684
Professor of Mathematics | Fax: (805) 756 6537
Mathematics Department | e-mail:
California Polytechnic State U. |
San Luis Obispo, CA 93407 |
USA |

Web page: http://www.calpoly.edu/~dhartig
****************************************************************************

[MUG] Re: rootof and allvalues
Author: Maple Group    Posted: 01/11/2000 15:07:58 GMT
>> From: Maple Group

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

Date: Fri, 27 Oct 2000 00:27:24 +0200
From: Theodore Kolokolnikov
To:
Subject: rootof and allvalues

| >> From: Don Hartig
| eqn1 := x^3-sin(x-1)=0;
| eqn2 := x^3-sin(x)=0;
| ...
| finds a numerical solution for the first
| but not second example.

I'm am not exactly sure why, but the first example has only one real
solution whereas the second example has at least 2 real solutions...
and the non-zero one cannot be expressed in terms of elementary
functions.

fsolve works in both cases. Use it instead if you need numerical
solutions.

Regards,
Theodore.


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

Date: Thu, 26 Oct 2000 15:49:39 -0700 (PDT)
From: Robert Israel
To:
Subject: rootof and allvalues



On Wed, 25 Oct 2000, Don Hartig wrote:

> # What is going on with "allvalues" in Maple 6?

> > soln := solve(eqn);
> > allvalues(soln);

> 3 2
> 1 + RootOf(sin(_Z) - _Z - 1 - 3 _Z - 3 _Z , -1.972700767)

> # OK, the documentation says that allvalues no longer returns numerical
> # values.

Well, it does sometimes. In this case, the relevant paragraph from the
help page ?allvalues is
--------------------------------
If solve cannot find symbolic representations of the roots, then fsolve is
used to search for numerical approximations. If numerical approximations
are found, RootOfs with a numerical selector are returned. If it cannot be
determined that fsolve has found all the roots then the global variable
_ValuesMayBeLost will be set to true.
------------------------------

In this case, _ValuesMayBeLost has indeed been set to true. So what
allvalues is saying is that one solution is 1+R, where R is the solution
of sin(_Z)-_Z^3-3*_Z^2-3*_Z-1=0 which is approximately -1.972700767
(corresponding to -.972700767 as a solution for your equation). In this
case it turns out that Maple is unnecessarily pessimistic, as this is
in fact the only real solution.

> # That means evalf will, right?
> #
> > evalf(soln);

> -.972700767

> # Right.

OK, so what's the problem?

> # The next example is an easier equation to solve. Maple 5 (and my teen
> # age son) can find the exact solution immediately.

Well, your teenage son might take a while to find the solutions
.9286263087 and -.9286263087.

> > eqn := x^3-sin(x)=0;
> > soln := solve(eqn);

> 3
> soln := RootOf(_Z - sin(_Z), label = _L1)

I don't know why solve puts in the "label" on this one but not the
previous one. The purpose of the label option is supposed to be "to
distinguish several unspecified roots of the same equation". Does Maple
know there are several real roots in this case but not in the previous
case? Probably not.

> > allvalues(soln);

> 3
> RootOf(_Z - sin(_Z), label = _L1)

I suspect that allvalues leaves alone any labelled RootOf.

> > evalf(soln);

> 3
> RootOf(_Z - sin(_Z), label = _L1)

Without the "label= _L1", evalf would return a solution, namely 0.

> # What's with this? I guess I do not understand the label business. The
> # help page is not very helpful.

I agree.

You might find my "allsolve" procedure useful. This computes numerically
all solutions of an equation in one variable in a real interval. It is
part of my Maple Advisor Database, http://www.math.ubc.ca/~advisor. For
example:

> allsolve(eqn, x=-infinity .. infinity);

[-.9286263090, -.8056634e-11, .9286263087]


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



Previous by date: [MUG] smooth splines, Cesar Augusto De Freitas Anselmo
Next by date: [MUG] programming a table, Herg2770
Previous thread: [MUG] call for Maple applications, Jason Schattman
Next thread: [MUG] programming a table, Herg2770



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