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] FW: polynomials to operators

Search email archive for  

[MUG] FW: polynomials to operators
Author: Richard Patterson    Posted: Mon, 17 Feb 2003 17:18:28 -0500

>> From: Richard Patterson "rpatters"

----------
From: Richard Patterson <rpatters>
Date: Mon, 17 Feb 2003 15:22:29 -0500 (EST)
To: "helmut.kahovec" "fwchapma"
"devore" "sylvester7"
Cc: "rpatters"
Subject: polynomials to operators


Dear Fred, Helmut, Chris, Francis and now Carl,
Below is what I came up with after your many helpful suggestions.
My particular application uses homogeneous polynomials, so is
easier for that reason.
I admit to having a bias toward code that I completely understand.


> restart;
> f:=(x,y)->a*x^2+b*x*y+c*y^2;

2 2
f := (x, y) -> a x + b x y + c y

> g:=(x,y)->p*x^3+q*x^2*y+r*x*y^2+s*y^3;

3 2 2 3
g := (x, y) -> p x + q x y + r x y + s y

Procedure to change the coefficients of polynomials to constant functions.


> Change:=proc(f) local C:
> for C in coeffs(f(x,y),[x,y]) do assign(C,unapply(C,f)) end do;
> end proc;

Change := proc(f)
local C;
for C in coeffs(f(x, y), [x, y]) do
assign(C, unapply(C, f))
end do
end proc

This leaves me uneasy as it affects f even though the procedure returns
nothing. However the Changed polynomials can still be multiplied,
evaluated, differentiated just like ordinary polynomials.

> Test. This is how I know Change does something to f. There is no
other reason for this evaluation.

> f(x,y)(3);

2 2
a(3) x(3) + b(3) x(3) y(3) + c(3) y(3)

> Change(f);
> f(x,y)(3);

2 2
a x(3) + b x(3) y(3) + c y(3)



> Procedure to create an operator from a homogeneous polynomial:

> Operator:=proc(f) local i,j,n,DD;
> n:=degree(f(x,y),{x,y});
> DD:=0;
> for i from 0 to n do
> DD:=DD+coeff(coeff(f(x,y),x,i),y,n-i)*D[seq(1,j=1..i),seq(2,j=1..n-i)]
> od;
> RETURN(DD);
> end;

Operator := proc(f)
local i, j, n, DD;
n := degree(f(x, y), {x, y});
DD := 0;
for i from 0 to n do DD := DD +
coeff(coeff(f(x, y), x, i), y, n - i)*
D[seq(1, j = 1 .. i), seq(2, j = 1 .. n - i)]
end do;
RETURN(DD)
end proc

> Test:
> Operator(f);

c D[2, 2] + b D[1, 2] + a D[1, 1]

> Operator(f)(f)(x,y);

2 2 2
2 c + b + 2 a

> Operator(f)(g);

c ((x, y) -> 2 r x + 6 s y) + b ((x, y) -> 2 q x + 2 r y)

+ a ((x, y) -> 6 p x + 2 q y)

> Operator(f)(g)(x,y);

c (2 r x + 6 s y) + b (2 q x + 2 r y) + a (6 p x + 2 q y)

> It is also possible to define the operator before using Change.

> Operator(g);

s D[2, 2, 2] + r D[1, 2, 2] + q D[1, 1, 2] + p D[1, 1, 1]

> Operator(g)(g)(x,y);

6 s(g)(x, y) s + 2 r(g)(x, y) r + 2 q(g)(x, y) q + 6 p(g)(x, y) p

> Change(g);
> Operator(g)(g)(x,y);

2 2 2 2
6 s + 2 r + 2 q + 6 p

> Operator(g)(f)(x,y);

0

This was expected, since degree of g is bigger than degree of f.

Previous by date: [MUG] maple printing question, Maple User Group
Next by date: [MUG] differentiation of a sum, Maple User Group
Previous thread: [MUG] scope of `setoptions' command, Erik Leunissen
Next thread: [MUG] differentiation of a sum, Maple User Group



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

What's New in Maple 11 for Professionals
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