Hi Robert,
Defaults can change and improvements can be made. What dsolve does when floats are around is explained well in ?dsolve,details. Here are some further considerations:
> convert(0.3333333333,rational);
1/3
> convert(0.3333333333,rational,exact);
3333333333
-----------
10000000000
So: shall dsolve use convert/rational/exact? (This is the current default.) Or shall it use convert/rational? I am inclined to change the default to use convert/rational (without the keyword 'exact'). I can see two motivations for that: a float in Maple has its meaning linked to the value of Digits (that is what the interpretation used by convert to rational when not using the keyword 'exact') and the solutions returned by dsolve are basically always simpler, not just in in your example. Opinions?
The second issue is the implementation (already done in the version under development), taking advantage of the existing dsolve's option 'convert_to_exact', allowing it to assume the value 'identify', in which case `identify` is used to transform the floats into exact numbers. This has the advantage that whenever floats are used to represent exact non-rational quantities (e.g. 3.14 to represent Pi) the solution returned will match the user's intention more accurately. So we now have
> dsolve(de, convert_to_exact = identify);
y(x) = _C1*(7^(1/2)*x^2-1)^(1/2)+_C2*(7^(1/2)*x^2-1)^(1/2) *ln((7^(1/4)*x+1)/(7^(1/4)*x-1))
Someone may also suggest that this should be the default (so far I do not think so, but opinions are welcome).
Edgardo S. Cheb-Terrab
Physics, Maplesoft
Hi
The problem noticed has not one origin but two, and both are more subtle than the diff@int input presented. These problems are now fixed in all the sectors and the fix is scheduled to appear in the first Maple patch to be made available. In this moment (at the company) the output is
> diff(int((A(B(q,r))), r = lb..ub), q);
ub
/
| /d \
| D(A)(B(q, r)) |-- B(q, r)| dr
| \dq /
/
lb
> PDEtools:-dchange(r=RootOf(t2-B(q,_Z)), diff(B(q,r),q), t2=B(q,r), [t2],known=all);
D[1](B)(q, RootOf(t2 - B(q, _Z)))
Edgardo S. Cheb-Terrab
Physics, Maplesoft
Hi
The problem noticed has not one origin but two, and both are more subtle than the diff@int input presented. These problems are now fixed in all the sectors and the fix is scheduled to appear in the first Maple patch to be made available. In this moment (at the company) the output is
> diff(int((A(B(q,r))), r = lb..ub), q);
ub
/
| /d \
| D(A)(B(q, r)) |-- B(q, r)| dr
| \dq /
/
lb
> PDEtools:-dchange(r=RootOf(t2-B(q,_Z)), diff(B(q,r),q), t2=B(q,r), [t2],known=all);
D[1](B)(q, RootOf(t2 - B(q, _Z)))
Edgardo S. Cheb-Terrab
Physics, Maplesoft
Hi Britzel,
Your input integral has a wrong parenthesis but after fixing it I can reproduce the problem you mention. The Physics package is new in Maple, and not all parts of the system interact with it as expected. In this example, some internal int subroutines replace the unit vectors by some dummies and then the Physics:-Component command complains about that. That is easy to fix but then int does not know how to integrate a Physics:-Component function; that is also easy - just to say that all in all we need two fixes. These two fixes will probably be in place in the next 12.0x release of Maple. If the fix ends posted elsewhere I'll let you know as well.
And yes, you are right, generally speaking, according to the design of the Physics package, what you want to do is expected to be as easy as replacing the Sum by the Int function and correspondingly adapting discrete indices in the worked example for the inertia tensor shown in ?Physics,examples..
Regards
Edgardo S. Cheb-Terrab
Ph.D Theoretical Physics,
Research Fellow, Maplesoft
Hi Britzel,
Your input integral has a wrong parenthesis but after fixing it I can reproduce the problem you mention. The Physics package is new in Maple, and not all parts of the system interact with it as expected. In this example, some internal int subroutines replace the unit vectors by some dummies and then the Physics:-Component command complains about that. That is easy to fix but then int does not know how to integrate a Physics:-Component function; that is also easy - just to say that all in all we need two fixes. These two fixes will probably be in place in the next 12.0x release of Maple. If the fix ends posted elsewhere I'll let you know as well.
And yes, you are right, generally speaking, according to the design of the Physics package, what you want to do is expected to be as easy as replacing the Sum by the Int function and correspondingly adapting discrete indices in the worked example for the inertia tensor shown in ?Physics,examples..
Regards
Edgardo S. Cheb-Terrab
Ph.D Theoretical Physics,
Research Fellow, Maplesoft
Hi,
Incidentally this same problem got reported as a bug by people from the Technion. The bug is in the integration routine for Dirac functions. The bogus int routine got fixed for Maple 12, where the result for this ODE IVP is
> DE17:=diff(y(t),t$2)+y(t)=Dirac(t-Pi)+Dirac(t-2*Pi)+Dirac(t-3*Pi);
> Y:=dsolve({DE17,y(0)=0,D(y)(0)=0},y(t));
Y := y = -(Heaviside(t - 3 Pi) - Heaviside(t - 2 Pi) + Heaviside(t - Pi)) sin(t)
> odetest(Y, [DE17, y(0)=0, D(y)(0)=0]); # note you can test the initial conditions too
[0, 0, 0]
Regarding the bug in int, here is the input, related to this ODE IVP posted, that returns wrong in Maple 11:
> ee := cos(x)*(Dirac(x-Pi)+Dirac(x-2*Pi)+Dirac(x-3*Pi));
> int(%, x); # Maple 12 Beta output
-Heaviside(x - 3 Pi) + Heaviside(x - 2 Pi) - Heaviside(x - Pi)
> simplify(diff(%, x) - ee); # this does not return 0 in Maple 11
0
Edgardo S. Cheb-Terrab
Ph.D Theoretical Physics, Maplesoft
Hi Jacques,
I did know about trigsubs. One of the key ideas in the design of the FunctionAdvisor was to "provide centralized access to a large amout of mathematical knowledge already found (buried and spread) in the library" - another one was to make that information more complete with time. For trig functions, the main source of info used is indeed trigsubs.
Here is the relevant detail:
>print(MathematicalFunctions:-FunctionInfo["tan"]["identities"]);
proc(F)
local z;
z := op(F);
op(map(u -> if u <> F then F = u fi, trigsubs(F))), F^2 = 'sec'(z)^2 - 1
end
BTW the FunctionAdvisor was a very interesting/challenging (unfinished) project. Some detais are in the related paper presented in the Maple summer workshop of 2002 (the paper is linked at http://lie.uwaterloo.ca/publications.html).
Edgardo S. Cheb-Terrab
Ph.D Theoretical Physics,
Research Fellow, Maplesoft
Hi Jacques,
I did know about trigsubs. One of the key ideas in the design of the FunctionAdvisor was to "provide centralized access to a large amout of mathematical knowledge already found (buried and spread) in the library" - another one was to make that information more complete with time. For trig functions, the main source of info used is indeed trigsubs.
Here is the relevant detail:
>print(MathematicalFunctions:-FunctionInfo["tan"]["identities"]);
proc(F)
local z;
z := op(F);
op(map(u -> if u <> F then F = u fi, trigsubs(F))), F^2 = 'sec'(z)^2 - 1
end
BTW the FunctionAdvisor was a very interesting/challenging (unfinished) project. Some detais are in the related paper presented in the Maple summer workshop of 2002 (the paper is linked at http://lie.uwaterloo.ca/publications.html).
Edgardo S. Cheb-Terrab
Ph.D Theoretical Physics,
Research Fellow, Maplesoft
Hi John,
Please see the second paragraph of yesterday's reply, entitled "Re: the notation for tensors in Maple". Recalling, while in the current version of Physics you can only do abstract tensor algebra in flat spacetimes, that is about to change, to include tensor algebra in curved spacetimes and some of the functionality you have in packages like the old "tensor" or GR-Tensor. At that point you will not need to use two packages unless you want to do something much more specialized, for which the core DifferentialGeometry package is expected to be of help.
Regarding your comment about distinguishing between space and time, as mentioned in yesterday's email: the ability to perform abstract tensor algebra in 4D and at the same time in the 3D (space part, so splitting the 3D tensors into a time component and a 3D tensor) is expected to be in place soon.
Edgardo S. Cheb-Terrab
Ph.D Theoretical Physics,
Research Fellow, Maplesoft
Hi John,
Please see the second paragraph of yesterday's reply, entitled "Re: the notation for tensors in Maple". Recalling, while in the current version of Physics you can only do abstract tensor algebra in flat spacetimes, that is about to change, to include tensor algebra in curved spacetimes and some of the functionality you have in packages like the old "tensor" or GR-Tensor. At that point you will not need to use two packages unless you want to do something much more specialized, for which the core DifferentialGeometry package is expected to be of help.
Regarding your comment about distinguishing between space and time, as mentioned in yesterday's email: the ability to perform abstract tensor algebra in 4D and at the same time in the 3D (space part, so splitting the 3D tensors into a time component and a 3D tensor) is expected to be in place soon.
Edgardo S. Cheb-Terrab
Ph.D Theoretical Physics,
Research Fellow, Maplesoft
Hi
This thread is long - some messages got unnoticed. You are right, please see my reply yesterday, entitled "RE: Hi again, I progress only", second paragraph.
Edgardo S. Cheb-Terrab
Ph.D Theoretical Physics,
Research Fellow, Maplesoft
Hi
This thread is long - some messages got unnoticed. You are right, please see my reply yesterday, entitled "RE: Hi again, I progress only", second paragraph.
Edgardo S. Cheb-Terrab
Ph.D Theoretical Physics,
Research Fellow, Maplesoft
Hi Robert,
Indeed, this got implemented in connection with the Physics package for Maple 11, and it was possible to extend it to everything with essentially no cost. In the rush we missed documenting the feature, that I think is a great one.
Edgardo S. Cheb-Terrab
Ph.D Theoretical Physics,
Research Fellow, Maplesoft
Hi Robert,
Indeed, this got implemented in connection with the Physics package for Maple 11, and it was possible to extend it to everything with essentially no cost. In the rush we missed documenting the feature, that I think is a great one.
Edgardo S. Cheb-Terrab
Ph.D Theoretical Physics,
Research Fellow, Maplesoft
Hi,
Assuming that you use Maple 11, see ?Physics,examples, first section on Vectors and analytical geometry: there are a number of very similar worked examples that you can take as starting point to resolve the problem you posted.
Edgardo S. Cheb-Terrab
Ph.D Theoretical Physics,
Research Fellow, Maplesoft