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
• Find out about Online Training
• Download a Brochure
• Request a Brochure
• Download a Demo
• Request a Demo
• Meet Our Team
• Read our RSS Feeds

Learn More

Maple Home
Maple 11 Professional
Maple 11 Academic
Maple 11 Student Use
Recorded Online Seminars
FREE Training Resources


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

View Maple 10 in Action
Product Comparison Chart

Latest Information

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


Service & Support

Maple 10 Training Videos
MaplePrimes, blogs, forums
Elite Maintenance Program
Application Centre
Powertools
Maple User Group (MUG)
Join the Maple User Group
(MUG)

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] plot after assume

Search email archive for  

[MUG] plot after assume
Author: Matthias Kawski    Posted: Fri, 3 May 2002 12:08:47 -0700 (

>> From: Matthias Kawski "kawski"

I believe I should know this -- but continue to repeatedly run into
problems with "assume". The following is a toy example -- in my real
work I often need to "assume" properties in order to simplify big
expressions. But after having done so, I have trouble evaluating,
integrating, plotting etc.
The particularly annoying thing is when recalculating some (but not
all prior sections) I get different results, in the toy example mi-
micked by a second copy of the statements. It seems to be that there
are more than 2 x's here -- and somehow I don't know how to access
the right x in the second slot of e.g. plot(,.,.), or int(.,.).

I am looking for some general advice how to avoid such trouble --
sometimes it is not very obvious that things are wrong the 2nd time.
The constraints are that I rarely know what assumptions I will have
to make later on -- i.e. I cannot just put all assume(...) into the
first paragraph, and I often need to go back a page or two, and re-
execute lengthy calculations (e.g. with slight changes).... apparently
this can work if I take care to not reexecute any of the assume(..);
commands [[generally, there is no need to reset all assumed x:='x';
at the beginning of the pages that I need to reexecute]]. Redoing the
entire worksheet is often completely impractical.

> restart;
> y:=x^2;
> assume(x>0);
> int(y,x);
> plot(y,x);
2
y := x

3
1/3 x~

[[ the plot is OK with x~ along first axis ]]
> y:=x^2;
> assume(x>0);
> int(y,x);
> plot(y,x);
2
y := x~

2
x~ x~
Plotting error, empty plot

Matthias
**********************************************************
Matthias Kawski http://math.asu.edu/~kawski
Dept. of Mathematics and Statistics "kawski"
Arizona State University office: (480) 965 3376
Tempe, Arizona 85287-1804 home: (480) 893 0107
**********************************************************

[MUG] Re: plot after assume
Author: Maple User Group    Posted: Fri, 10 May 2002 16:57:54 -0400

>> From: Maple User Group "maple_gr"

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

Date: Thu, 09 May 2002 17:22:56 -0500
From: "Robert J. Lopez" "r.lopez"
To: "maple-list"
Subject: plot after assume

Here is what I have found useful in my work with assumptions in Releases
prior to 7.

1) make the assumption
2) execute the required calculations; let's say that expr is the desired
result
3) remove assumptions
4) execute the following line

parse(convert(expr,string));

This is the equivalent of re-typing the expression back into Maple. This
gives you a copy of expr without assumptions and without tildes.

There may have been better ways of working with assumed variables, but I
never found them. This was the only way I could ever manage to continue
using variables with assumptions on them. Of course, in Maple 7 and
beyond, the use of assuming provides a mechanism of "local assumptions"
and the problem has virtually disappeared.

Robert

--
Robert J. Lopez
Department of Mathematics
Rose-Hulman Institute of Technology
Terre Haute, IN 47803

812 877-8396 (office)
812 877-8883 (Department fax)

"r.lopez"



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

Date: Thu, 9 May 2002 17:37:41 -0700 (PDT)
From: Robert Israel "israel"
To: "maple-list"
Subject: plot after assume

In Maple 7 and 8, the best thing to do might be to use "assuming" which
makes a temporary assumption on variables for evaluating one expression
without making permanent changes. Otherwise, you can use the rather
clumsy work-around suggested in the "Changing assumptions and names"
page in my Maple Advisor Database (http://www.math.ubc.ca/~israel/advisor):

> oldx:= x:
> assume(x > 0);
> assign(oldx,x):

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


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

Date: Thu, 09 May 2002 16:41:03 +0200
From: Preben Alsholm "ifakpa"
To: "maple-list" "kawski"
Subject: plot after assume

Each time you make an assumtion about x a new local variable x~ is
created. In your situation it therefore seems a good to make assignments
that refer to the original global x and not to the local variable created
by assume.
Consider first the following:


> restart;

> y:=x^2: #y is assigned the global x, squared.

> assume(x>0);

> y-x^2; #y evaluates to the global x (^2), which in turn evaluates to the
local x (^2)

0

> type(x,`local`);

true

> z:=x^3: #z is assigned the local x cubed.

> assume(x>0); #A new local x is created

> z-x^3; # Two different locals are involved

3 3
x~ - x~

> y-x^2; #No problem here since y first evaluates to the global x

0

> type(x,`local`);

true

> convert(z-x^3,`global`);

0

> convert('plot'(z,x=0..1),`global`): %;

While the last two lines are interesting they are probably not what you
are looking for.
So here is an idea. We start as before:
> restart;
> y:=x^2:
> assume(x>0);
>
> y-x^2;

0

> z:='x'^3: #This assigns to z the global name x cubed.

> z-x^3;

0

> assume(x>0);
>
> z-x^3;

0

> y-x^2;

0

--
Preben Alsholm
Institut for matematik (Department of Mathematics)
DTU (Technical University of Denmark)

Previous by date: [MUG] Reading the Date from a txt File, Juan Navarro
Next by date: [MUG] Re: Hopfu.mws,  Douglas B Meade
Previous thread: [MUG] declaration of procedure-type, Stefano Sofia
Next thread: [MUG] Hopfu.mws, C W



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