Preben Alsholm

MaplePrimes Activity


These are replies submitted by Preben Alsholm

I overlooked another problem in my previous comment. The multiplication signs after sqrt should be removed. They are probably due to your pasting from 2D-input. (I never use that).

Since your system is not converted by DEtools/convertsys  you may try doing it yourself.

Something like this,

solproc:=proc(N,t,Y,YP)
YP[2]:=evalf(-(3*Y[3]*Y[2]*(-1/Y[1]^2+(1/3)*(Int(2*Y[1]^2*k^4*(Y[3]*sqrt(Y[1]^2+k^2)+1)*exp(-Y[3]*sqrt(Y[1]^2+k^2))/(Y[1]^2+k^2)^(3/2), k = 0 .. infinity))/Pi^2)/Y[3]));
YP[1]:=Y[2];
YP[3]:=evalf((1/30)*sqrt(900/Y[1]+450*Y[2]*Y[3]^2+900/Y[3]^3+60*Pi^2/Y[3]^4)*Y[3]);
end proc;

L:=dsolve(numeric,procedure=solproc,initial=Array([3,4,2]),start=1000,procvars=[phi(t),D(phi)(t),a(t)]);

#The first one mimics the initial conditions:
 

L(1000);

#The second seems to take forever (I gave up considering the time I had):
L(1001);
#But at least there is no immediate error.

See ?dsolve/numeric/IVP

Preben Alsholm

If Digits >=16 then you are asking for more digits than are supplied by using hardware floats, assuming that evalhf(Digits) evaluates to 15.

Thus your procedures using option hfloat can only benefit from that option if Digits <=15.

Incidentally, you called my attention to the existence of the option hfloat. Thank you!

Preben Alsholm

If Digits >=16 then you are asking for more digits than are supplied by using hardware floats, assuming that evalhf(Digits) evaluates to 15.

Thus your procedures using option hfloat can only benefit from that option if Digits <=15.

Incidentally, you called my attention to the existence of the option hfloat. Thank you!

Preben Alsholm

The problem seems to be default values {} or [].

Everything else I tried (  e.g. {{}},[[]], {a}, NULL, "" ) works fine.

It is not important that the type declared is 'Vector'.
The problem is exhibited in bare bones below.

restart;
DS:=proc({begynd::Vector:={}})
begynd
end proc:
################################
savelibname:="F:/DMat.mla";
savelib(DS);
restart;
libname:="F:/",libname;
DS();
eval(DS,1):
DS();
DS(begynd= <1,2,3>);
 

Preben Alsholm

Changing to .mla doesn't help.

I have just submitted a bug report.

Thank you!

Preben Alsholm

If you would like to see that the error message in fact does come up, you can get my package DMat from

http://www2.mat.dtu.dk/people/P.K.Alsholm/Noter/libDMat/

If you put the two files in a folder located at "F:/DMat/libDMat", you will see the problem after ececuting the following lines.
 

restart;
libname:="F:/DMat/libDMat",libname;
with(DMat):
K:=Matrix([[-.1,.075],[.1,-.2]]);
DSolveSys(K,variabel=x(t));
undebug(DMat:-DSolveSys);
DSolveSys(K,variabel=x(t));
 

I would be interested in knowing if you don't get the error message.

Preben Alsholm

This is how it should behave, yes.
However, it doesn't in my complicated setting.

Notice that my error message says "expects default value for keyword parameter ...".

What puzzles me in that error message is the word 'default', which doesn't appear in your error message.

After defining a matrix K, a vector b, the commands are

DSolveSys(K,b,variabel=<Q1(t),Q2(t)>);
Error, invalid input: DMat:-DSolveSys expects default value for keyword parameter begynd to be of type Vector, but received {}
undebug(DMat:-DSolveSys);
DSolveSys(K,b,variabel=<Q1(t),Q2(t)>);
 

After executing the undebug command (debug works too) the result from DSolveSys is perfect.

If I replace
begynd::Vector:={}
by
begynd::{Vector,identical({})}:={}

then there is no problem.
But why do I need to?

Why does that error message exist in Maple? There must be a reason?
I'm sorry that I cannot reproduce the error in a simple setting. 

Preben Alsholm

 

The reason I raised the question here was that 3 responses in comp.soft-sys.math.maple made me think that the problem was dependent on country specific settings. When I found out that the problem didn't exist in a Unix environment I realized that the 3 people responding might be using Unix. But you are quite right. I shall direct the question directly to Maplesoft.
First 225 226 227 228 229 Page 227 of 229