acer

32348 Reputation

29 Badges

19 years, 329 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@janhardo Persevering here should work. I do it this way often, and it's pretty straightforward.

@nm If you are seeking a way to get a location automatically added to `libname` (without using an initialization file) then here is how:

Place the .mla in a directory whose name can be formed as follows,

  cat(kernelopts(':-homedir'),"/maple/toolbox/foobar/lib");

The kernel should add that to libname after any restart. The GUI should also pick up that location for .hdb and .help archives, following  complete closure and relaunch of GUI.

A version specific variant is as follows, eg.

   cat(kernelopts(':-homedir'),"/maple/toolbox/2020/foobar/lib");

You can use multiple such locations, named as other than just "foobar".

This mechanism dates back to the introduction of the Global Optimization Toolbox, the first toolbox.

[edited] This mechanism works on Linux, OSX, and MS-Windows. As mentioned, there is are both version-specific and version-agnostic variants. IIRC it is also the scheme now used by the "package" management system.

note. I am camping on Lake Huron and typing this in by cellphone. Please check for typos and errors.

@nm I know nothing about what you're trying to accomplish with all this, or what your ulterior purpose might be, since you haven't stated it.

I look at kernelopts(':-mapledir') if I want to programmatically access the directory in which my Maple is installed. Similarly I use kernelopts(':-homedir') to get at the OS's notion of home directory.

@PhD_Wallyson The name params is not assigned to anything, which is the direct cause of the error (as should be understandable by reading the error message).

Is params supposed to be a sequence of equations, say denoting values for L1,L2,L3?

@eslamelidy Here is one way to construct the plots for various values of beta. You can see that your choices of beta don't seem to make much difference.

x_e_-.008_ac.mw

@eslamelidy I'll look at that. Don't repost it as a duplicate Question, please.

@vv That produces an incorrect result in Maple 2015, since IntegrationTools:-Expand pulls q altogether out of the integrals.

@tomleslie It can be recovered without reexecution. I opened the Maple 7 saved worksheet in Maple 16.02 , then saved immediately without execution. That new file opened fine in my Msple 2020.1.

ps. This is all XML format stuff; nothing to do with .mws Classic worksheet format.

Opening the garbled original in my Maple 2020.1 threw a bunch of Java errors to the console, apparently related to a glitch in the 2D plot color shader and interpretation.

@Carl Love Ok, thanks. As I'm sure you're aware, that's not the same expression with which the OP started. It doesn't seem to me to be much in the spirit or making it simpler overall, to have to backtrack further to where the original Sum expression arose.

@Carl Love I considered leaving out those more complicated alternatives involving %assuming -- I thought they were zany and fun and I didn't intend them to be short as that was beside the point. I'd reach for some simpler way long before them.

But perhaps I'm missing your point, about using %assuming infix here.

@tomleslie See here.

Those are exports of the Physics:-Library subpackage. There are a few exports of that subpackage which appear to not (yet) have their own bookmarked Section and examples (or any separate help page).

note. That cited Online Help page may be slightly out-of-date, as far as revisions for Maple 2020.1 go.

@tomleslie When you issue the command with(plots) it rebinds the names connected to _pexports (aka package exports). This collection of names may be fewer in number than the exports proper.

The exports proper can all be accessed using the long-form name, eg. plots:-display3d . But the short form can only be accessed for the names that are rebound.

Here are a few reasons why an export might be removed from the package exports.
  - It is an undocumented routine intended for direct use by another package, but deemed too esoteric to be generally useful to users.
  - It is little more than a duplicate or alternate spelling of some other package export (eg. plots:-display3d, plots:-dualaxesplot)
  - It is part of the package mechanism (eg. plots:-init, plots:-_pexports itself)
  - Some developer judged it so.

The error message you cited has a slight misnomer.
    with(plots, implicitplot, display3d):
returns the error,
    Error, (in with) package plots does not export display3d
Technically it should state that display3d is not a package export of package plots. Perhaps someone thought that kind of technically correct message would be more confusing.
 

restart;

L1:=exports(plots);
nops([%]);

animate, animatecurve, animate3d, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, densityplot, display, dualaxisplot, fieldplot, fieldplot3d, gradplot, gradplot3d, implicitplot, implicitplot3d, inequal, interactive, interactiveparams, intersectplot, listcontplot, listcontplot3d, listdensityplot, listplot, listplot3d, loglogplot, logplot, matrixplot, multiple, odeplot, pareto, plotcompare, pointplot, pointplot3d, polarplot, polygonplot, polygonplot3d, polyhedraplot, polyhedra_supported, rootlocus, semilogplot, setcolors, setoptions, setoptions3d, shadebetween, spacecurve, sparsematrixplot, surfdata, textplot, textplot3d, tubeplot, cylinderplot, graphplot3d, replot, sphereplot, Interactive, display3d, setcolours, dualaxesplot, init, _pexports

67

L2:=plots:-_pexports();
nops(%);

[animate, arrow, display, inequal, logplot, odeplot, pareto, animate3d, animatecurve, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, densityplot, dualaxisplot, fieldplot, fieldplot3d, gradplot, gradplot3d, implicitplot, implicitplot3d, interactive, intersectplot, listcontplot, listcontplot3d, listdensityplot, listplot, listplot3d, loglogplot, matrixplot, multiple, plotcompare, pointplot, pointplot3d, polarplot, polygonplot, polygonplot3d, polyhedraplot, rootlocus, semilogplot, setcolors, setoptions, setoptions3d, shadebetween, spacecurve, surfdata, textplot, textplot3d, tubeplot, interactiveparams, polyhedra_supported, sparsematrixplot]

57

{L2[]} minus {L1[]};

{}

{L1[]} minus {L2[]};

{init, replot, Interactive, _pexports, cylinderplot, display3d, dualaxesplot, graphplot3d, setcolours, sphereplot}

with(plots);nops(%);

[animate, animate3d, animatecurve, arrow, changecoords, complexplot, complexplot3d, conformal, conformal3d, contourplot, contourplot3d, coordplot, coordplot3d, densityplot, display, dualaxisplot, fieldplot, fieldplot3d, gradplot, gradplot3d, implicitplot, implicitplot3d, inequal, interactive, interactiveparams, intersectplot, listcontplot, listcontplot3d, listdensityplot, listplot, listplot3d, loglogplot, logplot, matrixplot, multiple, odeplot, pareto, plotcompare, pointplot, pointplot3d, polarplot, polygonplot, polygonplot3d, polyhedra_supported, polyhedraplot, rootlocus, semilogplot, setcolors, setoptions, setoptions3d, shadebetween, spacecurve, sparsematrixplot, surfdata, textplot, textplot3d, tubeplot]

57

 

Download plots_exports.mw

@perr7 The problem is because you added the scaling=constrained option which was also (incidentally) present in Kitonum's code.

Add the style=line option, but omit the scaling=constrained option.

@Carl Love I was also trying to convey that using binomial is a decent choice even when constructing a simple procedure that would accept numeric j as argument.

For example, calling MySum(6) with your procedure calls combinat:-numbcomb six times, which each dispatch to combinat:-binomial which is binomial itself. So why not have the procedure call binomial directly and save some function calls. (Of course there is no measurable savings, for neither j nor the number of calls being very large.)

note: I did not pay attention to combining powers or measuring efficiency concerns. I still don't know what numeric values will be utilized.

@Anthrazit I have previously used a State component (hidden DataTable) where its rtable (Matrix) gets used to store other things such as a record or table.

Would it suffice for you to reference to a table that is stored in, say, the [1,1] entry of the Matrix associated with a DataTable (hidden, or not)?

That way you don't have to issue any special commands to Store/Save it to a workbook or other location prior to quitting. You just run your program that updates the table entries, and when you Close the worksheet the DataTable's Matrix is saved automagically.

The alternative, to store it manually as part of a workbook, is the kind of this that I've seen in your earlier work. (There, you programmaticallu read code from the workbook in the Start Region. You could also manually issue a command prior to closing (or press a custom Button) that saved some data to the workbook, and add additional code in the Startup to read it upon restart/re-opening. 

First 163 164 165 166 167 168 169 Last Page 165 of 592