Mac Dude

1506 Reputation

17 Badges

10 years, 247 days

MaplePrimes Activity


These are answers submitted by Mac Dude

Not a solution, but when you bring the first equation into normal form you find that it is a 3rd-order polynomial in "i" divided by some simpler stuff. Trying to find the root for this numerator (the 3rd-order polynomial), my version of Maple (15) has a hard time... and by inspection it is clear that the situation wrt. "c" is no better. I have not used Maple's facility for solving such polynomials; in principle, 3rd-order polynomials do have solutions. A possible way out may be to replace all the coefficients of the powers of "i" with simple variables; solve that system & back-substitute. Do the same with "c" and see if you can get rid of the cross terms (the "i" in the solution for "c" and vice versa). BTW, there may be complex solutions.

At any rate, faced with expressions like this Maple usually needs some help and guidance, which is to say that you want to break-down the problem into manageable chunks. In doing so you will find where it has difficulties. The CAS that eliminates the need for our thinking has yet to be developed...

M.D.

PS: After nearly 10 min CPU I get this:

solve(subxpr2=0,i);
          [Length of output exceeds limit of 1000000]


where subxpr2 is the numerator of the normal form of your first equation.

Ok, this is embarrassing... I have just loaded the worksheet again to extract the essential pieces of code for posting... when I had to realize that it now works! Go figure; I already have seen that "restart;" not always sets everything back, so I now suspect that my first attempt somehow hung around & was intercepting the function calls...

A reply to pagan's comment about export and overload: What I am doing is this:

Lattice module() option package;
export `.`;
...
`.`:=proc(elements::seq(Element)) option overload:
local cumR:=LinearAlgebra:-IdentityMatrix(6),cuml:=0,element;
for element in [elements] do
  cumR:=LinearAlgebra:-Multiply(cumR,element:-R):
  cuml:=cuml+element:-l:
end do;
return Record(l=cuml,R=cumR);
end proc;
end module;

where I have omitted extraneous stuff. The "Element"-type entities are created with other assignments, they are records of the same structure as the record I am returning here (this record is also an Element). Am I doing something wrong in exporting and overloading "."??

M.D.

Statistics[NonlinearFit] should do what you want. Use its documentation; being no real Maple expert I was able to get a fit going reasonably quickly. You will need a reasonable initial guess for your free parameters else the fit will not succeed. Your two exponential functions may be somewhat degenerate which makes fits like this unstable, but that depends entirely on your specific situation, the parameters, your data set etc.

Mac Dude

I found the answer myself. It is:

if (not test) then # have to get and set currentdir
F1:=Maplets:-Display(Maplets:-Elements:-Maplet(Maplets:-Elements:-FileDialog[F1]('fileselectionmode'='directoriesonly',title = "Select Folder",approvecaption = "Select",onapprove=Maplets:-Elements:-Shutdown(['F1']))));
end if;

Where did I find it? In the "Maple Programming Guide" that I must have downloaded when I installed Maple 15. In there, the principle of referencing into modules and submodules is described. I sort-of thought I understood that, but maybe not so well. From there it was a matter of identifying all the parts and finding where exactly they were located; which is where the online help system came in handy as it told me for each procedure where it was.

Maybe this is of help to some other poor soul, flailing about just as I am.

Mac Dude

 

In my (limited) experience, it helps to add the parameters "delimited" and "delimiter=..." to the ImportMatrix call. For ImportMatrix, space and tab are NOT necessarily the same... make sure you specify the correct one. Finally, ImportMatrix chokes when it hits a non-numeric character in the input stream.

 

Mac Dude

First 18 19 20 Page 20 of 20