 |
|
List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] Help with dsolve (Maple 6 vs Maple 7)
| [MUG] Help with dsolve (Maple 6 vs Maple 7) |
|
Author: Jim Shoemaker
Posted: Fri, 08 Nov 2002 11:39:56 -0700
|
>> From: Jim Shoemaker "shoe"
The following code works in Maple 6 but not Maple 7:
In Maple 6.
[> restart: g:=32.2: b:=10: m:=1.4: Q:=450: Kn:=1.486: So:=0.0008:
n:=0.015:A:=y*b+y^2*m: T:=b+2*y*m:
[> P:=b+2*y*sqrt(1+m^2): Ahc:=(y^2*b/2)+(y^3/3*m):
E:=y+z+(Q/A)^2/(2*g)*(1+k): Fr:=Q/sqrt(g*A^3/T):
[> ManQ:=Kn/n*A^(5/3)/P^(2/3)*sqrt(S): Mo:=Ahc+Q^2/(g*A):
[> Sf:=solve(ManQ^2=Q^2,S): ode1:= diff(y(x),x)+(So-Sf)/(1-Fr^2):
ff:=dsolve({ode1,y(0)=6},{y(x)},type=numeric):
[> ff(3000);
[x = 3000, y(x) = 4.89395631425137710]
In Maple 7.
...
[> ff(3000);
Error, (in odeproc) unable to store
'-(.8e-3-20.63335863*(10.+3.440930106*y)^(4/3)/(10.*y+1.400000000*y^2)^(10/3))/(1.-6288.819875/(10.*y+1.4*y^2)^3*(10.+2.8*y))'
when datatype=complex
I'm stumped. I've tried with(RealDomain) with no effect. Any pointers
to a solution?
Jim Shoemaker
"shoe"
Research Engineer
Institute for Natural Systems Engineering
Utah State University
(435) 797-2697
(435) 797-8038 fax
___________________________________________________________________________
A man may be very industrious, and yet not spend his time well. There is
no more fatal blunderer than he who consumes the greater part of life
getting his living. -Henry David Thoreau
|
| [MUG] Re: Help with dsolve (Maple 6 vs Maple 7) |
|
Author: Maple User Group
Posted: Fri, 15 Nov 2002 10:49:09 -0500
|
>> From: Maple User Group "maple_gr"
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Mon, 11 Nov 2002 16:44:06 -0800 (PST)
From: Robert Israel "israel"
To: "maple-list"
Subject: Help with dsolve (Maple 6 vs Maple 7)
Your differential equation contains y as well as y(x). That's
the problem. Change every y to y(x) and it should work.
The error message in Maple 8 is only slightly less confusing:
> S:= dsolve({diff(y(x),x)=y, y(0)=1}, y(x), numeric);
S := proc(x_rkf45) ... end proc
> S(1);
Error, (in S) global 'y' must be assigned to a numeric value before
obtaining a solution
If you don't include the numeric option, the dsolve command returns
an error message which is more to the point:
> dsolve({diff(y(x),x) = y, y(0)=1}, y(x));
Error, (in ODEtools/info) y(x) and y cannot both appear in the given ODE.
I don't know why `dsolve/numeric` doesn't check for this rather
common error and return an intelligible error message.
Robert Israel "israel"
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Mon, 11 Nov 2002 19:57:10 -0800
From: Allan Wittkopf "awittkop"
Subject: Help with dsolve (Maple 6 vs Maple 7)
To: "maple-list"
Hello Jim,
In Maple 8, the reason for this appears to be made clearer by the error message.
In M8 we get:
> ff(3000);
Error, (in ff) global 'y' must be assigned to a numeric value before obtaining
a solution
so clearly y is not being recognized as the same thing as y(x), which
technically it isn't.
There was a significant overhaul of the dsolve/numeric suite from M6->M7, and
even further changes from M7->M8, and it seems in that overhaul that y and y(x)
are no longer considered synonymous.
If you try the following in Maple 7 (where all that has been done is to replace
y with y(x)), you get the expected results:
> restart:
> g:=32.2: b:=10: m:=1.4: Q:=450: Kn:=1.486: So:=0.0008: n:=0.015:
> A:=y(x)*b+y(x)^2*m: T:=b+2*y(x)*m:
> P:=b+2*y(x)*sqrt(1+m^2):
> Ahc:=(y(x)^2*b/2)+(y(x)^3/3*m):
> E:=y(x)+z+(Q/A)^2/(2*g)*(1+k):
> Fr:=Q/sqrt(g*A^3/T):
> ManQ:=Kn/n*A^(5/3)/P^(2/3)*sqrt(S):
> Mo:=Ahc+Q^2/(g*A):
> Sf:=solve(ManQ^2=Q^2,S):
> ode1:= diff(y(x),x)+(So-Sf)/(1-Fr^2):
> ff:=dsolve({ode1,y(0)=6},{y(x)},type=numeric):
bytes used=1023732, alloc=917336, time=0.06
> ff(3000);
[x = 3000., y(x) = 4.89395384081212192]
Sincerely,
Allan Wittkopf
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Tue, 12 Nov 2002 07:35:00 +0100
From: Preben Alsholm "P.K.Alsholm"
To: "maple-list"
Subject: Help with dsolve (Maple 6 vs Maple 7)
Replace y by y(x) as has always been necessary when using dsolve without
type=numeric. It was rather inconsistent that y and y(x) both could
appear when using type=numeric, but not when not.
Preben Alsholm
Department of Mathematics
Technical University of Denmark
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Tue, 12 Nov 2002 09:31:22 +0100
From: Koch-Beuttenmueller "Heike.Koch-Beuttenmueller"
To: "maple-list"
Subject: Help with dsolve (Maple 6 vs Maple 7)
If I substitute y by y(x) I get your result with Maple7 and Maple8.
ode1:= diff(y(x),x)+(So-Sf)/(1-Fr^2);
4/3
(10. + 3.440930106 y(x))
Sf := 20.63335863 ----------------------------------
2 10/3
(10. y(x) + 1.400000000 y(x) )
4/3
20.63335863 (10. + 3.440930106 y(x))
.0008 - ---------------------------------------
2 10/3
/d \ (10. y(x) + 1.400000000 y(x) )
ode1 := |-- y(x)| + -----------------------------------------------
\dx / 6288.819875 (10 + 2.8 y(x))
1 - ---------------------------
2 3
(10 y(x) + 1.4 y(x) )
> ff:=dsolve({ode1,y(0)=6},{y(x)},type=numeric);
ff := proc(rkf45_x) ... end proc
> ff(3000);
[x = 3000., y(x) = 4.89395314199846342]
Mit freundlichen Gruessen
Heike Koch-Beuttenmueller
=======================================================
Dr. Heike Koch-Beuttenmueller
Universitat Ulm
Universitatsrechenzentrum
Albert-Einstein-Allee 11
D-89081 Ulm
Germany
e-mail: "Heike.Koch-Beuttenmueller"
Telefon: 0731 5022465
=======================================================
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Tue, 12 Nov 2002 08:31:27 -0500
From: "Douglas B. Meade" "meade"
To: "maple-list" Jim Shoemaker "shoe"
Subject: Help with dsolve (Maple 6 vs Maple 7)
Jim and MUG,
The problem with your differential equation is that you use both y(x)
and y. In Maple 6 and earlier, Maple was not picky about the
inconsistent references to the unknown function. As of Maple 7, the
user must be consistent and must use the form that explicitly shows
the dependence. (There are shortcuts to this using aliases or
depends.)
In Maple 8, the error message from your original code is:
> ff:=dsolve({ode1,y(0)=6},{y(x)},type=numeric):
> ff(3000);
Error, (in ff) global 'y' must be assigned to a numeric value before
obtaining a solution
This message is almost informative enough to diagnose the problem.
When all references to y are changed to y(x), Maple 8 produces the
following response to the evaluation of the numeric solution:
> ff:=dsolve({ode1,y(0)=6},{y(x)},type=numeric):
> ff(3000);
[x = 3000., y(x) = 4.89395330563466400]
This is consistent with the solution you report for Maple 6.
I hope this explains the result you are seeing.
Doug
-----------------------------------------------------------------------
Prof. Douglas B. Meade Phone: (803) 777-6183 FAX: (803)
777-6527
Department of Mathematics URL: http://www.math.sc.edu/~meade/
USC, Columbia, SC 29208 E-mail: "mailto:meade"
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
From: "Dr Francis J. Wright" "F.J.Wright"
To: "shoe"
Subject: Help with dsolve (Maple 6 vs Maple 7)
Date: Tue, 12 Nov 2002 13:32:44 -0000
What surprises me is that it worked in Maple 6! You have mixed up y and
y(x); diff requires the dependent variable to be y(x) consistently. An easy
fix is to include a subs as follows:
ode1:= diff(y(x),x)+subs(y=y(x),(So-Sf)/(1-Fr^2)):
With that change, your code works for me and gives the same result in Maple
6, 7 and 8. The Maple 7 error message is a red herring (inappropriate and
misleading); Maple 8 gave a much more helpful error message.
Francis
|
Previous by date: [MUG] maximize, Dragomir Deltchev
Next by date: [MUG] I/O in Maple 8, Brad Weir
Previous thread: [MUG] Can Maple krack this kernel?, NS Jones, Mathematics
Next thread: [MUG] I/O in Maple 8, Brad Weir
|
|
|