Preben Alsholm

13471 Reputation

22 Badges

20 years, 263 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

I tried your code in my Maple 18.02.
 

restart;
Hso := Matrix(8, {(1, 4) = -x, (1, 6) = I*x, (2, 3) = x, (2, 5) = I*x, (3, 2) = x, (3, 5) = -I*z, (3, 8) = y, (4, 1) = -x, (4, 6) = I*z, (4, 7) = -y, (5, 2) = -I*x, (5, 3) = I*z, (5, 8) = -I*y, (6, 1) = -I*x, (6, 4) = -I*z, (6, 7) = -I*y, (7, 4) = -y, (7, 6) = I*y, (8, 3) = y, (8, 5) = I*y});
LinearAlgebra[Eigenvectors](Hso);

No problem. Large output.

@shesia A good book is the Programming Guide, which is available as a series of worksheets and as a pdf file.
In Maple itself you can access these worksheets by doing:
? Programming Guide

You can also download a pdf version from
http://www.maplesoft.com/documentation_center/

@shesia OK, I tried with the much larger set of data.
NOTE: Are these data really measured data? With that much accuracy! Or are they constructed by a teacher?
I revised Q slightly to make it:
(1) catch possible errors and in that case return the large list of residuals [10^6$(3*nops(T1))].
(2) print the parameter points for which Q is computed to show that something is going on.
 

Q:=proc(T1_p1, k1, keq, k4) option remember; local P1v,P2v,P2e_v,Sv,resid;
   res(parameters=[T1_p1, k1, keq, k4]);
   printf("Trying %a\n",[_passed]);
   try
     P1v:=P1fu~(T1);
     P2v:=P2fu~(T1);
     P2e_v:=P2e_fu~(T1);
     Sv:=Sfu~(T1);
     resid:=[P1v-P1d1,P2v+P2e_v-P2_P2ed1,Sv-Sd1];
     return [seq(seq(resid[i][j],i=1..3),j=1..nops(T1))]
   catch:
     return [10^6$(3*nops(T1))]
   end try
end proc: 

Then with q defined as

q:=[seq(subs(_nn=n,(proc(T1_p1, k1, keq, k4) Q(_passed)[_nn] end proc)),n=1..3*nops(T1))]: 

and the command

solLS:=Optimization:-LSSolve(q,initialpoint=[15,0.02,4,4]);

I got (after a while)

The plots don't look as good as before: That is not surprising if the data are real data (i.e. not constructed by a teacher as I remarked about above).
After all, isn't the differential equations model you have only a crude model?
A thing to keep in mind is that LSSolve doesn't necessarily find the global minimum!
For the same plot as I reported for the small data set I got:

@shesia The very simple reason is that you have 51 t-values, but only 24 values in the other lists:
nops~([T1,Sd1,P1d1,P2_P2ed1]);
                                                              [51, 24, 24, 24]

I noticed that when I copied your code s0 was set at 100000 which doesn't agree very well with the data.
I notice now that s0 is set at 10000, which is fine. I suppose you edited that in the meantime?
I shall edit my answer below to that effect.

In Maple 2016 the error message for your example (with D[1] as you have it) is more informative:

Error, (in PDEtools:-Solve) unable to handle functions of not names as in the case of the system passed, containing [_F2(-x)]

To see why there is talk about _F2(-x) try

pdsolve(PDE);
eval(%,t=0);

In Maple 12 (I don't have 13) the error message is

Error, (in pdsolve/sys) unable to handle PDE problem subject to boundary conditions {u(x, 0) = cos((1/2)*x), (D[1](u))(x, 0) = 0}

You don't need the package PDEtools, but if you do, the syntax is
with( PDEtools );

 

@Thomas Dean Yes, if D[2] is meant (i.e. the first derivative with respect to the second variable), then there is no problem:

pdsolve({PDE, u(x, 0) = cos((1/2)*x), D[2](u)(x, 0) = 0});

          

The warning just means that solve cannot find any (or all) solutions, but on the other hand cannot claim that there aren't any either.

If you want somebody to try your code, you need to upload a worksheet.

Your "code" doesn't tell us what npar, de, nde, Ctrl (and more?) are, so please upload a worksheet or, alternatively, give us the full code as text.

@Axel Vogt As for your new polynomial isn't Digits=15 way too low?
This works perfectly:
 

restart;
N:=40:
Digits:=100:
F:=expand(mul(I*x-k,k=1..N)):
f:=evalf(F):
S:=[fsolve(f,complex)];

 

The bug doesn't appear in Maple 8, but does come up in Maple 12, 15, 16, 17, 18, and 2015 besides Maple 2016.
All these (including Maple 8) use NAG hw_c02agc it appears by setting infolevel[fsolve]:=3.

@Christopher2222 I just tried right clicking on the output of

1000*evalf(Pi);

in Maple 12 and got

The use of comma is likely because my computer is speaking Danish.
I got the same using Maple 2016.
Using identify(%);  immediately after produced 1000*Pi in both versions.

@acer I think I checked all links labelled A.
Except for
http://www.mapleprimes.com/questions/201351-There-Were-Problems-During-The-Loading
which has English and what appears to me to be Chinese (in the beginning), I can confirm that the worksheets are in Danish (at least in parts).
"hj\303\246lp"  probably was "hjælp" .
"sammenh\303\246ngen"  undoubtably was "sammenhængen" .

@andreasamdisen The first worksheet shows up empty in Maple 2016 (but is not), the second has the collapsed section F1 Introduktion og føringsveje 30/1, which expands nicely to reveal subsections etc.
Maple complained about incompleteness for both worksheets though.
I have remarked on previous occasions that this unfortunate phenomenon seems to happen more often for Danes (as in this case). I have no explanation for that.

There are some people (not me) on this forum who can help you. Your worksheet may or may not be recoverable.
So upload the worksheet and hope for the best.

First 60 61 62 63 64 65 66 Last Page 62 of 225