Mac Dude

1102 Reputation

13 Badges

7 years, 87 days

MaplePrimes Activity


These are questions asked by Mac Dude

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

 

I got bit by Maple when I tried to combine a number of 2-d plots into one 3-d plot, using plottools:-transform to space the plots out in the third dimentsion. I have done such things before. This time, the first time I executed the final plot statement the GUI got clobbered and somehow also the whole worksheet (I may have saved it). Now, when I load it nothing shows up and worse, I cannot enter anything in the worksheet, it is completely screwy. I looked at the XML code in Emacs and it validates and I cannot find anything obviously wrong with it, i.e. no dangling tags or similar.

I used Maple 2017. In Maple 2015 the same worksheet overprints itself & makes a big mess on the screen. It is similarly unuseable.

Can one of the experts have a look at this? Although rare I have experienced similar issues on occasion before & would like to know how to get this into a sane state.

TIA,

Mac Dude

triangle_analysis.mw

In ScientificConstants, the density of carbon is given as 2.2 g/cm^3. That happens to be the value for graphite. Carbon comes in different states with different density, diamond being one of them, amorphous being another. Is this somewhere in ScientificConstants where just I cannot find it, or is it not there?

TIA,

M.D.

PS: I do know the values and where to find them (Particle Data Group). I'd like to use ScientificConstants so I can write a more general piece of code.

I am trying to add a specific property (radiation length) to the Elements in ScientificConstants.

To do this  I first 

ScientificConstants:-AddProperty(radiationlength); # this seems to work

I then load a table of element name - radiationLength pairs (it is really a bigger table but only these are of interest):

data:=ImportMatrix(cat(libname[1],"/RadiationLengthTable.txt"),source=delimited,\
                       datatype=anything,delimiter="\t"); # works too

(I made the file using downloaded data).

I then want to fill the radiationlength properties for all elements for which I've got the value:

for i from 1 to LinearAlgebra:-RowDimension(data) do
  elemt:=data[i,1]; # the element name as a string
  ScientificConstants:-ModifyElement(cat(elemt),radiationlength=[value=data[i,4],units=g/cm^2]);
end do;

which fails with the error

Error, (in ScientificConstants:-ModifyElement) element ``H `` is not known

H is the first element in the table of radiation lengths so it is getting the right one.

At  issue is that somehow the element name (called descriptor in the Help files) does not seem to get properly evaluated. In fact I tried various ways "by hand", none except just the unevaluated element name (i.e H,He etc. worked).

There must be a way to set these in a loop. Does someone know how?

TIA,

Mac Dude

 

 

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