Mac Dude

1137 Reputation

16 Badges

7 years, 299 days

MaplePrimes Activity


These are questions asked by Mac Dude

Does Maple allow importing HDF5 data files? I checked the docs & cannot find any hint that it does. But before I launch an SCR I thought I'd ask here.

TIA,

M.D.

I am getting my feet wet with Maple's system calls, like ssystem. I am considering to use Maple to run something like a Python script for certain numeric calculations, based on Maple-generated results. I am using Mac OS X (macOS for newer versions).

Maple's Help gives the basics and that works. For the specific Python example; I can run a simple script by using

ssystem("python -c A=2;print(A)"); # \n instead of ; works also.

Presumably I can do this with longer scrpts as well.

However, it appears that, when creating the process, Maple does not setup the environment the user (me) gets through initialization files like .profile, .cshrc or the like. As a result even a simple "python -c import sys" fails; presumably because the environment where Python looks for the module isn't setup. I tried

ssystem("source .cshrc");

but that fails as well. Trying to be clever and invoking a login shell (ssystem("tcsh -lc <command>");) also leads nowhere.

The Help page does say that ssystem() does not give access to all shell commands; is there somewhere documentation that says what works and what is not supported?

I am aware that Maple2018 and newer have more support in form of the Python package, but right now I need my code to be backward compatible to Maple2015 so this new package does not solve my issue for the older installation I am also using. Also, Python is not necessarily the only language I want to use.

Any suggestions would be welcome.

Mac Dude

 

This may be a stupid question, but I am having elementary trouble with pdsolve.

I have the following pde system:

PDE:=[diff(f(x,xp),x)=-(1/2)*(L*xp+2*x)*kl,diff(f(x,xp),xp)=-(1/4)*kl*L*(L*xp+2*x)];

Trying to solve it:

pdsolve(PDE)                                                          

I get this error message:

Error, (in pdsolve/sys) too many arguments; some or all of the following are wrong: [{f(x, xp)}, handlenonrationalfunctionsofdependentvariables = false]


I don't understand any of this; can someone enlighten me?

TIA

M.D.

pde.mw

 

I have a package that uses fsolve, a Maple function known (to me) to often fail when UseHardwareFloats is set to true. Since I set UseHardwareFloats:=true in my .mapleinit (for I want hardware performance when using floats) I set UseHardwareFloats:=deduced; in the ModuleLoad routine of this package. ModuleLoad executes as evidenced by a print statement in the routine that does in fact print, and within ModuleLoad, UseHardwareFloats is set to deduced. But at the worksheet level, UseHardwareFloats remains set to true.
 The only way I can set it is to set it explicitly in the sheet that calls the package. I tried various things, like putting it into the body of the module, using :-UseHardwareFloats, and so on. Nothing seems to work. While not a fatal issue it is bothersome & has had me run around with code not working several times.

Any hint would be appreciated.

Mac Dude

 

I am trying to put a number of related 2-d plots into a 3-d frame so I can see them stacked up in the third dimension (which follows a parameter) and rotate things around.

The way I once did this successfully was to create the 2-d plots and then use plottools:-transform to move the individual plots in the third dimension, like so:

plt:=plot(something);

tr:=plottools:-transform((x,y) -> [x,2,y]); # the "2" gets changed for the other plots (not shown here).

plots:-display(tr(plt));

The only effect I can get is that the GUI gets confused and I have to close and reload the sheet to get it back again. I have a (complicated) sheet where this actually works, but I am not able to make it work even in the small example I am posting below.

Any hint of where I am going off trail is appreciated. Incidentally, this problem is what led to the corrupted sheet I had maybe a week ago.

Thanks,

Mac Dude.

display3d.mw

 

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