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 Twitter Adept Scientific on LinkedIn


The Next Steps

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

Learn More

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

MapleSim
MapleNet
Maple T.A.
BlockImporter™
Maple Toolboxes

Maple Rave Reviews
Maple Study Guides
Books about Maple
System Requirements

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

MapleSim
MapleNet
Maple T.A.
BlockImporter™
Maple Toolboxes and
Connectors


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] differentiation of a sum

Search email archive for  

[MUG] differentiation of a sum
Author: Maple User Group    Posted: Mon, 17 Feb 2003 22:06:37 -0500

>> From: Maple User Group />
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Fri, 14 Feb 2003 00:21:21 +0100
From: Helmut Kahovec /> To: /> Subject: Differentiation of an arbitrary sum

Ingo Ellersdorfer wrote:

>| how can I differentiate an arbitrary sum like sum(q[i],i=1..n), with respect
>| to q[i], so that I will get "1" instead of "n"?


Well, by extending the built-in procedure diff(). First, put the
following lines into the Maple initialization file maple.ini:

olddiff:=eval(diff):
protect(olddiff);
unprotect(diff);
diff:=proc()
local e,x,d,s;
e,x:=args[1],args[2];
use DIFF=olddiff in
if type(e,specfunc(anything,{sum,Sum})) and type(x,indexed)
then
d:=DIFF(op(1,e),subsop(1=op([2,1],e),x));
if type(e,specfunc(anything,sum)) then
s:=eval(sum)
else
s:=eval(Sum)
end if;
if op([2,1],e)<>op(1,x) then
s(d,op([2,1],e)=op(1,x)..op(1,x))
else
s(
subs(op([2,1],e)=cat(`_`,op([2,1],e)),d),
cat(`_`,op([2,1],e))=op(1,x)..op(1,x)
)
end if
else
DIFF(args)
end if
end use
end proc:
protect(diff);

Then, execute the restart command:

> restart;

Now, you get in turn:

> diff(sum(q[i],i=1..n),q[i]);

1

> diff(sum(q[i]^2,i=1..n),q[i]);

2 q[i]

> diff(sum(q[i],i=1..n),q[j]);

1

> diff(sum(q[i]^2,i=1..n),q[j]);

2 q[j]

> diff(Sum(q[i],i=1..n),q[i]); value(%);

i
-----
\
) 1
/
-----
_i = i


1

> diff(Sum(q[i]^2,i=1..n),q[i]); value(%);

i
-----
\
) (2 q[_i])
/
-----
_i = i


2 q[i]

> diff(Sum(q[i],i=1..n),q[j]); value(%);

j
-----
\
) 1
/
-----
i = j


1

> diff(Sum(q[i]^2,i=1..n),q[j]); value(%);

j
-----
\
) (2 q[i])
/
-----
i = j


2 q[j]

Note, that this extension to diff() is just a start and you must take
care that such an extension does not interfere with the code of the
Maple library.


Kind regards,

Helmut


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

From: "Dan. & Linda Willard" /> To: /> Subject: Differentiation of an arbitrary sum
Date: Fri, 14 Feb 2003 14:33:39 -0500

Try: j:=<k>; #some value of k
S:=n->sum(q[i]=1..n);
X:=diff(S(n),q[j]);

----- Original Message -----
From: "Ingo Ellersdorfer" /> To: /> Sent: Wednesday, February 12, 2003 8:45 AM
Subject: [MUG] Differentiation of an arbitrary sum


>
> >> From: Ingo Ellersdorfer /> >
> Dear all,
>
> how can I differentiate an arbitrary sum like sum(q[i],i=1..n), with
respect
> to q[i], so that I will get "1" instead of "n"?
>
> Thanks for your help and best regards
> Ingo Ellersdorfer
>
>
>
>
> Ingo Ellersdorfer, Dipl.-Volkswirt
>
> University of Stuttgart, Germany
> Institute of Energy Economics and the Rational Use of Energy / Dept. ESA
>
> Hessbr|hlstr. 49a
> D-70565 Stuttgart
> Germany
>
> Phone: +49 711 780 6114
> FAX: +49 711 780 3953
> /> >


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

From: "Dr Francis J. Wright" /> To: /> Subject: Differentiation of an arbitrary sum
Date: Sun, 16 Feb 2003 17:51:07 -0000

From: "Ingo Ellersdorfer" /> To: /> Sent: Wednesday, February 12, 2003 1:45 PM
Subject: [MUG] Differentiation of an arbitrary sum


> how can I differentiate an arbitrary sum like sum(q[i],i=1..n), with
respect
> to q[i], so that I will get "1" instead of "n"?

The short answer is: you can't!

The longer answer is that I think you really want to differentiate wrt q[j]
and get 1 if 1 <= j <= n and 0 otherwise. It would require a fair amount of
work to provide a facility that would support this in a reasonably general
and useful way. This is another of those problems that falls in the gap
between the concrete and abstract ends of computer algebra and is currently
not well supported.

Francis


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

From: Ingo Ellersdorfer /> To: "Dr Francis J. Wright" /> Subject: AW: Differentiation of an arbitrary sum
Date: Mon, 17 Feb 2003 11:24:17 +0100

Dear Francis,

thank you very much for your answer. By assistance of the maple support team
it was possible to solve the problem. There exists a maple tool for
differentiating arbitrary sums, provided by Prof. Taylor (Clarkson
University, New York). You can download the "TDTools.mpl" from:

http://www.clarkson.edu/~chengweb/faculty/taylor/maple/sum/

On this web side you will also the worksheet "diffsum.mws" with instructions
for application.

Best regards
Ingo Ellersdorfer


-----Urspr|ngliche Nachricht-----
Von: Dr Francis J. Wright /> Gesendet: Sonntag, 16. Februar 2003 18:51
An: /> Cc: /> Betreff: Re: [MUG] Differentiation of an arbitrary sum


From: "Ingo Ellersdorfer" /> To: /> Sent: Wednesday, February 12, 2003 1:45 PM
Subject: [MUG] Differentiation of an arbitrary sum


> how can I differentiate an arbitrary sum like sum(q[i],i=1..n), with
respect
> to q[i], so that I will get "1" instead of "n"?

The short answer is: you can't!

The longer answer is that I think you really want to differentiate wrt q[j]
and get 1 if 1 <= j <= n and 0 otherwise. It would require a fair amount of
work to provide a facility that would support this in a reasonably general
and useful way. This is another of those problems that falls in the gap
between the concrete and abstract ends of computer algebra and is currently
not well supported.

Francis


Previous by date: [MUG] FW: polynomials to operators, Richard Patterson
Next by date: [MUG] Re: Displaying maples graphs in latex.,  Mark Fitch
Previous thread: [MUG] Problem using evalf(Int), Maple User Group
Next thread: [MUG] Displaying maples graphs in latex., Theo H S Boafo



Ready to buy?

For more pricing information:
Visit our webstore, call us on +1 800 724 8380 or email us at info@adeptscience.com

Featured Downloads

Maple 15 & MapleSim 5 Professional Brochure
Maple 15 Academic Datasheet
Maple 15 & MapleSim 5 Brochure - Academic Brochure
Maple 15 New Features data sheet
Maple 15 New Features - Flyer
Maple Whitepaper: Driving Innovation - How mathematical modeling and optimisation increase efficiency and productivity in vehicle design.
MapleSim Whitepaper: Technological Superiority in Multi-Domain Physical Modeling and Simulation

Latest Downloads

Maple Case Study: The Changing Face of Robotics
Maple Application Brief - Analyse the Path of a Liquid-Handling Robot
Maple Player for iPad - App
Maple Player for iPad - Datasheet
Case Study - Multi-Domain Modelling Critical to Unmanned Vehicle Designs

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

NASA’s Jet Propulsion Laboratory begins widespread adoption of Maplesoft technology
NASA’s Jet Propulsion Laboratory begins widespread adoption of Maplesoft technology
Latest release marks the 10th anniversary of Maple T.A.
Maple Case Study: The Changing Face of Robotics
Maple Application Brief - Analyse the Path of a Liquid-Handling Robot
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 © 2012, Adept Scientific plc.
Site designed and maintained by Lyndon Ash

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