Mac Dude

1122 Reputation

13 Badges

7 years, 208 days

MaplePrimes Activity


These are replies submitted by Mac Dude

@torabi Oh, so you want to do this numerically.

How do you expect to get a numeric solution when you only spec. your initial values as finite?

To have any chance you will need to put in actual values.

I tried to see if a general symbolic solution exists, and Maple returns a solution with new variables and a reduced de. Unfortuntely I don't have time to see if this can be pursued further, but the solution will be quite complicated in any case.

So, find values for your conditions & plug them in to allow for numeric solution.

M.D.

moadele_asli2_(2).mw

It sounds like you really have an initial-value problem. I would use dsolve to get the general solution first. Then you eval your u(r) and the differential expression at r=0; you may equate them to u0 and du0 or whatever you call your initial values. Presumably you have a 2nd-order system so you will have two constants which Maple will call _C1 and _C2. You can then solve these two equations for your initial conditions, which gives you the expressions for _C1 and _C2 in terms of the initial values.

To be more specific we'd have to see your DE. Mere condition that your initial values be finite may not be enough to find the particular solution. If you have a pole at r=0 you may end up with both _C1 and _C2 having to be 0 and the trivial solution.

M.D.

@Pascal4QM Thanks for the link to Joe Riel's elisp debugger. However, the thread is from 2012. I wonder whether Joe could chime in here as to whether that code is still being maintained.

Mapke's debugger is a bit rough around the edges. In most cases I avoid the debugger and just sprinkle print() statements in my code until I get it to run as intended. For large monolithic procs and loops that crap out after some number of cycles I have at times stored intermediate results in tables to be read later.

I should check out Joe's debugger. I like and use his maplev.el code editor a lot.

Thanks again,

M.D.

@Carl Love indeed.

M.D.

Because you never give it the actual d.e. ...?

M.D.


So this is Fortran, from "Numerical Recipes", a well known compendium of algorithms, and from a relatively old version ofthe book. As copied it is syntactically incorrect since the print in the book uses  typesetting to distinguish comments and also labels which are not part of the code.

Is there any reason not to use Maple's internal random generators? The RandomTools package has several to choose from; there are RandomVector and RadomMatrix in the LinearAlgebra package as well.

Reimplementing the Numerical Recipes generator in Maple is likely quite possible, but expect it to be slow. I would not do this.

M.D.

I certainly wish Maplesoft to be around for a lot longer; Maple having become a rather indispensable tool for me in my work.

But some water needs to be poured into the wine:

Maplesoft has emphasized and taken pride in its STEM-education related work for a long time. How come, then, that my Raspberry Pi has "that other System" installed rather than Maple?? Given the not so small power of the Pi 3; if I were a student nowadays I'd get a Pi 3 and that would be that. And why would I switch to Maple later? (Full disclosure: I did just that; but the initial prompt was a free [to my dept] site license and a rather inane licensing policy of "that other company", added with at the time only a small amount of work invested with the other system).

How come one of my erstwhile students was told he could not move his student license of Maple to his new computer, making him switch to "that other system" which he gets for free (from his university)? Customer and Maple user lost; probably forever. Probably not the only case.

Market forces are real, and I sometimes wonder, given Maple's relative obscurity in at least my field (physics and particle accelerators), how long it can survive unless it makes it attractive (irresistible) to keep using it.

Still, thriving for 30 years is not a small feat in these days, so my congratulations and thanks go out to the Maple team. Please stay around.

Mac Dude

 

All of your exponentials are imaginary, so they are vectors rotating in the complex plane.

I'd try plotting the absolute of the expression to see if in fact it has a 0. If you see one you may be able to home in with fsolve.

You can always throw the abs of your expression at solve, but I doubt it will succeed; and I particularly doubt the result will be meaningful.

BTW: complex 0 is 0+0*I. That is why you need the absolute value.

M.D.

You need to tell us your platform (op. system, version).

M.D.

@Preben Alsholm Thanks for checking.

I wonder whether this may be a Mac issue. I am running on OS X 10.11 El Capitan.

M.D.


You have at least one typo: b1*BeselJ should be b1*BesselJ.

M.D.

@ianmccr

By far the best reference I found is the one you use (the Programming Guide). It really has the info you need when working with Modules, procs etc., as you appear to (and I am doing extensively as well). Together with the Intro and Reference you are about as covered as you can get, IMO. I am not aware of any material besides Maplesofts that covers the programming aspect. Which actually is a shame as Maple is a very powerful programming language that does have a bit of a learning curve.

Then, as you have learned, stay away from 2-d input unless you have a project where typesetting is essential. I have written a lecture script in Maple, and that was done in 2-d for obvious reasons. But even then, I wrote those sections that posed difficulties (in Maple) in 1-d first, debugged them and then transcribed into 2-d. Time consuming, but at least it did not drive me insane.

acer has given you the underlying explanation of the behaviour you saw. This specific limit of 2-d was new to me; so I learned something here as well.

M.D.

@Janeasefor Open the worksheet with your proc. Use menuitem "File > Export > Maple input" and save the file where you can find it. Maple will add the extension .mpl and it will be a text file.

The do the read as Yeti told you to. Make sure it is looked for in the right directory (or folder). You can use

currentdir();

to see in which folder Maple will look for the file, or you give a full pathname for the file.

HTH

Mac Dude

Menu item "Format:Character..." appears to have the options for formatting. In Maple 2015, strikeout is not one of them.

M.D.

This appears to be a namespace issue. If you eval(:-Proc1)---to use the OP's example---then what is evaluated is Proc1 as defined at the interactive level, not the one defined in the module. Consequently any changes in the module do not carry into the eval.

What you want to write in the module is

export MyProc;

MyProc:=proc(arg);

...
end MyProc;

and then, at the interactive level, call (after the with(myModule);)

MyProc(number);

to execute MyProc.

unwith(MyModule);

with(MyModule);

may then work.

Alternatively you can call

MyModule:-MyProc(number);

but even then you'll need the restart to update MyModule.

But I use restart nevertheless. Too much junk is left behind that tends to confuse me & make debugging extra-difficult when I don't.

M.D.

1 2 3 4 5 6 7 Last Page 3 of 37