nm

7930 Reputation

19 Badges

11 years, 69 days

MaplePrimes Activity


These are replies submitted by nm

@acer 

You didn't write up front that you wanted the names of submodules of such stored modules in the archive

I actually did say that,. I said I wanted same list showed by LibraryTools:-Browse("..../my_file.mla") and that includes all modules (at any level). Top and sub modules.

I wrote

"I can see all the modules using the command LibraryTools:-Browse("..../my_file.mla") then clicking EDIT then VIEW option at top right corner.  Member type is automatically set to MODULE in the lower left corner. So I can see the names of all the modules. And using the slider, I can scrol down. I see 73 modules listed."

I'll just do it manually for now. No problem. I will use LibraryTools:-Browse and copy the list of all the modules to a file and go from there. The list shown by LibraryTools:-Browse  also includes fully qualified modules name, as in A:-B and A:-C and not just B and C as generated by the command exports(A) so it works better for me.

I thought there was a way to obtain same exact output shown by LibraryTools:-Browse but in code.

@acer 

If all what is needed was to do 

currentdir("C:/tmp/"):
libname := "C:/tmp/my_library.mla",libname;
exports(A);

Then what is the other code you showed for? In the above one has to put the name of the top level module A to get all modules it exports.

But using the L method, it still does not work for me. It works for Physica library and for Maple own libraries, but not for my mla as I showed.

L := "C:/tmp/my_library.mla";
L := "my_library.mla";
L := "my_library";
L := my_library;
L := my_library.mla;

None of these work when using the rest of the code

select(type,
  map(proc(m) try nprintf("%s",m[1][1..-3]);
              catch: end try; end proc,
      LibraryTools:-ShowContents(L)), `module`);

My question is: What should my L then be??

It works on Maple own libraries

L := "C:\\Program Files\\Maple 2022\\lib";

select(type,
  map(proc(m) try nprintf("%s",m[1][1..-3]);
              catch: end try; end proc,
      LibraryTools:-ShowContents(L)), `module`);

Again, what should the L be for my own .mla??

@acer 

Did you actually try it your self or is it something you think should work?

If you did actually try, it would be easier to show the exact commands you typed instead of having one guess.

I can't make it work. Just to be clear, I wanted to get a list of all modules in .mla even if submodules. Not just the top level one. The same exact thing that LibraryTools:-Browse("..../my_file.mla")  shows as mentioned in my question.

I attach my_library.mla which have one module A and inside A there are 2 submodules B,C.

I also attach the worksheet showing my attempts. I am using 2022 now since more stable.

I also attach the A.mpl.

If you can make it work, could you please show the exact commands to use with this attached example instead of generic description? 

Explicit is always better than implicit.

interface(version);

`Standard Worksheet Interface, Maple 2022.2, Windows 10, October 23 2022 Build ID 1657361`

restart;

currentdir("C:/tmp/"):

print("current directory is ",currentdir());

interface(warnlevel=4);
kernelopts('assertlevel'=2):    

my_libname:="my_library.mla";

FileTools:-Remove(cat(currentdir(),"/",my_libname));
LibraryTools:-Create(cat(currentdir(),"/",my_libname));

read cat(currentdir(),"/A.mpl"):
LibraryTools:-Save('A',my_libname);

"current directory is ", "C:\tmp"

3

"my_library.mla"

currentdir("C:/tmp/"):
L := "my_library.mla";

select(type,
  map(proc(m) try nprintf("%s",m[1][1..-3]);
              catch: end try; end proc,
      LibraryTools:-ShowContents(L)), `module`);

"my_library.mla"

[A]

currentdir("C:/tmp/"):
L := "my_library";

select(type,
  map(proc(m) try nprintf("%s",m[1][1..-3]);
              catch: end try; end proc,
      LibraryTools:-ShowContents(L)), `module`);

"my_library"

Error, (in march) there is no existing archive in "my_library"

restart;

currentdir("C:/tmp/"):
libname := "C:/tmp/my_library.mla",libname;

"C:/tmp/my_library.mla", "C:\Users\Owner\maple\toolbox\2022\Physics Updates\lib", "C:\Program Files\Maple 2022\lib"

exports(A)

B, C

L := my_library;

select(type,
  map(proc(m) try nprintf("%s",m[1][1..-3]);
              catch: end try; end proc,
      LibraryTools:-ShowContents(L)), `module`);

my_library

Warning, grobner is deprecated. Please, use Groebner.

Warning, the GPIOTools package is only supported on the Raspberry Pi platform

[A, Algebraic, AlternatingCFSG, AndProp, AndProp, AndProp, AppellF1, AppellF2, AppellF3, AppellF4, ArithmeticCalendar, ArrayTools, ArrayTools, AudioTools, `_CGLanguageDefinition/Java`, `_CGLanguageDefinition/Swift`, `_CGLanguageDefinition/VisualBasic`, _ImportExport, `algcurves/AbelMap`, `algcurves/CurvePlot`, `algcurves/intersectcurves`, alias, alias, allvalues, asympt, BadiCalendar, BaseDataObject, BoxObject, BranchCutsTutorPlotData, bernoulli, branches, CAD, CFSG, CUDA, Cache, Calendar, ChevalleyCFSG, CivilIslamicCalendar, CodeGeneration, CodeTools, ColorTools, CommandCompletion, Companion, Compiler, ComplexBox, ComplexBox, ComputationalGeometry, ContextMenu, ContextMenu, ConvertODE, CopticCalendar, CurveFitting, CyclicCFSG, `_CGLanguageDefinition/default`, _UIUtils, Clock, codegen, combinat, `combine/binomial`, `combine/units`, `combine/units`, `convert/DGbiform`, `convert/DGform`, `convert/DGtensor`, `convert/DGvector`, `convert/base`, `convert/binary`, `convert/csccot`, `convert/hex`, `convert/hypergeom/FromStandardFunctions`, `convert/list`, `convert/sectan`, `convert/set`, `convert/system`, DEQueue, `DEtools/2F1`, `DEtools/DEplotInteractive`, `DEtools/DRNF`, `DEtools/FindODE`, `DEtools/HypergeomCases`, `DEtools/HypergeomFiveSing`, `DEtools/HypergeomFourSing`, `DEtools/IndicialFunction`, `DEtools/Order2/Same_p_curvature`, `DEtools/Order2/s_equiv`, `DEtools/SolveBessel`, `DEtools/SolveWhittaker`, `DEtools/hypergeometricsols`, `DEtools/polysols`, DataFrame, DataSeries, DataSets, Database, Date, DeepLearning, DeepLearning, Degrees, Describe, DifferentialAlgebra, DifferentialAlgebra, DifferentialGeometry, DifferentialThomas, DiracDefinite, DiracDefinite, DiracDefinite, DiscreteTransforms, DocumentTools, Domains, `_CGLanguageDefinition/CSharp`, `_CGLanguageDefinition/Fortran95`, `_CGLanguageDefinition/Julia`, `_CGLanguageDefinition/Python`, _DBM, depends, `diff/wrt$/SymbolicOrder`, `diff/wrt$/SymbolicOrder`, `diff/wrt$/SymbolicOrder`, `dismantle/module`, `dsn/Generate1DInterpolation`, `dsn/Generate2DInterpolation`, `dsolve/numeric/BasicSimpl`, `dsolve/numeric/DAE/ix1reduce`, `dsolve/numeric/FlattenPiecewise`, `dsolve/numeric/NumericalJacobian`, `dsolve/numeric/ToExternal`, `dsolve/numeric/ToExternal`, `dsolve/numeric/TrigGrob`, EgyptianCalendar, EllipticE, EllipticPi, EnglishConversions, Equate, EssayTools, EthiopianCalendar, EvalfAppell, EvalfGeneralizedPolylog, EvalfHeun, EvalfInttrans, EvalfMultiZeta, ExcelTools, Explore, Explore, ExportMatrix, ExternalCalling, _MapleNetPublish, eBookTools, eBookTools, `eval/int`, `eval/int`, `evala/Factors/efactor`, `evala/Gcd/SparseModular`, `evala/Gcd/alghelper`, `evalf/MeijerG`, `evalf/Sum`, `evalf/hypergeom`, `evalf/int/MultipleInt`, `evalf/int/NAGInt`, `expand/bigpow`, FMUTester, Factorial, FileTools, Finance, Fractals, `factor/mtshl`, fgbrs, floor, fnormal, forget, fracdiff, fsolve, GaussInt, GeneralizedPolylog, Grading, GraphTheory, GraphTheory, GregorianCalendar, GregorianIntercalatedCalendar, Grid, Groebner, GroupTheory, GroupTheory, `_CGLanguageDefinition/Fortran77`, `gcd/LinZip`, genfunc, geom3d, geometry, getassumptions, getassumptions, getassumptions, gfun, grobner, group, HelpTools, HeunB, HeunBPrime, HeunC, HeunCPrime, HeunD, HeunDPrime, HeunG, HeunGPrime, HeunT, HeunTPrime, hashmset, heap, ImageTools, ImageTools, ImportData, ImportMatrix, IncompleteBellB, InertForm, InertNames, InstallerBuilder, IntegerRelations, IntegralTransforms, IntegrationTools, InteractivePlotBuilder, Interpolation, IterativeMaps, Iterator, `_CGLanguageDefinition/Matlab`, identify, `ifactor/QuadraticSieve`, int, `int/definite/ln`, `int/definite/ratpoly`, `int/parallel`, `int/trigell_definite`, interface, intsolve, `inttrans/IntByDiff`, iperfpow, `is/duplicates`, `is/duplicates`, `is/duplicates`, `is/internal/eqns_inds`, `is/internal/eqns_inds`, `is/internal/eqns_inds`, isprime, JSON, JSON, Jacobi, JulianCalendar, `LREtools/Desingularization`, `LREtools/HypergeometricTerm`, `LREtools/RightFactors`, `LREtools/dAlembertian`, LaTeX, LargeExpressions, LibraryTools, LieCFSG, LinearAlgebra, LinearFunctionalSystems, LinearOperators, Logic, LommelFunctions, latex, latex, latex, `latex/old/_DG`, `latex/old/latex/symbol`, libmgb, `limit/hypergeom`, linalg, MPI, MTM, Magma, MapleCalculator, MapleNetWorksheet, MapleTA, Maplets, MathematicalFunctions, MathematicalFunctions, Matlab, MatrixPolynomialObjectImplementation, MmaTranslator, ModularSolver, MultiPolylog, MultiSeries, MultiSet, MultiZeta, MultivariatePowerSeries, MutableSet, _MessageCatalogue, `mod/polyc`, modpn, NInverseJacobi, NJacobi, NielsenPolylog, NormalSeries, NumberTheory, NumericTools, norm, `normal/GAMMA/global/sin_special`, numapprox, numtheory, OpenAPI, Optimization, Optimus, Ordinals, OreTools, Ore_algebra, OrthogonalSeries, `_CGLanguageDefinition/C`, `_CGLanguageDefinition/JavaScript`, `_CGLanguageDefinition/R`, _Inert, `odsolve/S-function`, PDEtools, PDEtools, PDEtools, `PDEtools/U_to_u`, `PDEtools/U_to_u`, `PDEtools/U_to_u`, `PDEtools/u_to_U`, `PDEtools/u_to_U`, `PDEtools/u_to_U`, PackageManagement, PackageTools, PackageTools, PatternMatching, Perm, PersistentTable, Physics, Physics, Physics, PiecewiseTools, Plot, Plot, PlotBuilder, PlotBuilder, PolyhedralSets, PolynomialIdeals, PolynomialTools, ProcessClock, ProcessControl, Python, padic, `pdsolve/BC`, `pdsolve/BC`, `pdsolve/numeric/elliptic`, `pdsolve/series`, `plot/filledplot/built`, plots, `plots/intersectplot`, `plots/merge_inputs`, `plots/merge_inputs`, plottools, polytools, powseries, `print/_DG`, priqueue, procbody, process, `property/Shake`, `property/Shake`, `property/Shake`, `property/min`, `property/min`, `property/min`, QDifferenceEquations, queue, RTableQueryImplementation, RandomTools, RationalNormalForms, RealBox, RealBoxPT, RealDomain, ReasonableDomain, ReasonableDomain, ReeCFSG, RegularChains, RegularChains, `RootOf/RootOf`, PlotThing, realroot, SCSCP, SMTLIB, SNAP, ScientificConstants, ScientificErrorAnalysis, Security, SeriesHeun, SignalProcessing, SignalProcessing, Slode, Sockets, SoftwareMetrics, SolveTools, SphericalY, SporadicCFSG, Spread, StandardContext, StandardContext, Statistics, SteinbergCFSG, StringTools, StringTools, Student, Student, SubgroupSeries, SubnormalSeries, SumTools, SumTools, SumTools, SuzukiCFSG, SystemUTCClock, `_CGLanguageDefinition/KernelExtensionInternalUseOnly`, `_CGLanguageDefinition/Pseudocode`, _RuntimeTools, sdmp, `simpl/eval`, `simplify/D/type`, `simplify/float`, `simplify/piecewise`, `simplify/siderels`, `simplify/siderels`, `simplify/siderels`, sqrt, stack, `subtype/typegraph`, sumtools, surd, TAIClock, Temperature, TestTools, ThermophysicalData, ThreadClock, Threads, Time, TimeSeriesAnalysis, Tolerances, Tutor, TypeTools, Typesetting, Typesetting, Typesetting, `_CGLanguageDefinition/Fortran`, _bing, MatrixPolynomialAlgebra, `tools/ComputationalGeometry`, `tools/JSON`, `tools/ParsePastBind`, `tools/ProcedureToExpression`, `tools/commonfactors`, `tools/htmlparser`, trigsubs, URL, Units, Units, VariationalCalculus, VectorCalculus, VectorSpace, VerifyTools, Worksheet, WorksheetTools, Wright, XMLTools, YAML, YAML, ZernikeR, `_CGLanguageDefinition/IC`, `_CGLanguageDefinition/Perl`, _ImportExport, abnd, BaseCalendar, Bits, binomial, `convert/horner`, `convert/system`, `DEtools/DifferentialClosure`, DocumentTools, DynamicSystems, FormalPowerSeries, GPIOTools, HTTP, Jupyter, LieAlgebrasOfVectorFields, ListTools, MathML, RepublicanCalendar, RootFinding, SubexpressionMenu, _CompilerBenchMarks, ThermophysicalData, TitsCFSG]

restart;

currentdir("C:/tmp/"):
libname := "C:/tmp/my_library.mla",libname;

"C:/tmp/my_library.mla", "C:\Users\Owner\maple\toolbox\2022\Physics Updates\lib", "C:\Program Files\Maple 2022\lib"

exports(A)

B, C

L := [libname][1];

select(type,
  map(proc(m) try nprintf("%s",m[1][1..-3]);
              catch: end try; end proc,
      LibraryTools:-ShowContents(L)), `module`);

"C:/tmp/my_library.mla"

[A]

 


 

Download not_working_june_15_2023.mw

Below is the mla file

my_library.mla

And this is A.mpl file (I can''t upload mpl file so I am putting it here as plain txt

A:=module()

    export B:=module()
      export foo:=proc()
          1;
      end proc;
    end module;

    export C:=module()
      export boo:=proc()
          1;
      end proc;
    end module;
end module;

 

@acer 

I can't get this to work. 

select(type,map(proc(m) try nprintf("%s",m[1][1..-3]);
   catch: end try; end proc,
   L),`module`);

Warning, grobner is deprecated. Please, use Groebner.
Warning, the GPIOTools package is only supported on the Raspberry Pi platform
[Algebraic, AlternatingCFSG, AndProp, AndProp, AndProp, AppellF1, 

  AppellF2, AppellF3, AppellF4, ArithmeticCalendar, ArrayTools, 

  ArrayTools, AudioTools, _CGLanguageDefinition/Swift, 

  _CGLanguageDefinition/VisualBasic, 

  _CGLanguageDefinition/default, _ImportExport, 

  algcurves/AbelMap, algcurves/CurvePlot, 

  algcurves/intersectcurves, alias, alias, allvalues, asympt, 


etc....

These are Maple modules, not the ones in my own mla file. I made sure libname is correct and that plibname][1] is name of my mla.

But will keep trying to see.

@acer 

yes, with your fix it works now. Thanks.

@acer 

I tried your code on Maple 2022 and Maple 2023. It works for system level module such as LinearAlgebra. But when I pass a name of one of my modules, it throws exception

proc(m) local res, oldOM; oldOM := kernelopts(':-opaquemodules' = false); try res := select(p -> type(m[p], procedure), [m:-_pexports()[], op(3, eval(m))]); catch: print(lastexception); res := []; finally kernelopts(':-opaquemodules' = oldOM); end try; res; end proc, "module does not export `%1`", _pexports

I've added print(lastexception); in the catch clause

Does the module need to have special code added to it to make this work? My module all have standard setup

export  A := module() 
   export B:=module()

      export foo:=proc(...)
     end proc;
     ...
 
      local boo:=proc(...)
     end proc;

    etc...
  end module;

#etc.... more modules in separate .mpl files
end module;

I called your H using

          H(A:-B)

Where A is top level module and B is submodule inside A. All submodules are exported also.

So I can do A:-B:-foo(...) and it works. Where foo() is name of a proc inside module B which is inside module A.  

I can make a MWE example if needed. But all my modules are in .mla file and they are on libname path and I can call them with no problem. It is only H() does not seem to work with them for some reason.  

@sursumCorda 

I do not understand.

Could you give an example using my code I showed above? Where will this go? And how to turn it on/off from outside?

I understand better by seeing an actual example. 

If you mean to type trace(foo,statements = false) before making the call, then this does not work. It only turn on tracing for the foo() proc. Not for other proc's it calls.

I want to add tracing showing -->enter <-- exit  for every call made, but limit it to my code.

Here is what I think you meant

foo:=proc(n,m,k)   
   local r;  
   #if DO_TRACE then
   #   option trace=0:
   #fi;
   
   boo(1);
   r:=n:
   NULL;
 end proc:

boo:=proc(n)   
   local r;  
   r:=n:
   NULL;
 end proc:

# and now

trace(foo,statements = false);
foo(1,2,3)

This shows

{--> enter foo, args = 1, 2, 3
<-- exit foo (now at top level) = }

You see. It only showed trace of foo() only.  

So I think I need trace option=0 added explicility in each proc I want to trace.

It goes without saying that listing all the proc names in trace([foo,....],statements = false) is not a real solution. I also tried trace(foo,statements = false,depth=10); but that only traced the proc foo only and not all the other procs called. 

The question is, how to turn that on/off from the outside when I am done debugging.

@ecterrab 

Thanks that worked,

Would you know how to turn that on and off from outside without me having to edit the file each time and comment the line option trace=0: For example if I do this

restart;

foo:=proc(n,m,k)   
   local r;
   option trace=0:

   r:=n:
   NULL;
 end proc:

foo(1,2,3)

{--> enter foo, args = 1, 2, 3
<-- exit foo (now at top level) = }

Which is what I wanted. But I have 1000's of proc's. I wanted to add option trace=0: to each proc in each module.

But I also want to be able to turn that on and off from outside before running the program.

Using global printlevel := 10: (instead of adding explicit option trace inside the proc) does not work for me, since it turns on tracing for everything including Maple's internal system calls and it also shows tracing of all assignments. 

I want to only trace enter/exit for my own code to help see where it hangs. Not including Maple's also.

But also want to be able to turn it on/off as needed without having to edit the code.

I thought of using global flag

restart;
DO_TRACE:=true;
foo:=proc(n,m,k)   
   local r;  
   if DO_TRACE then
      option trace=0:
   fi;

   r:=n:
   NULL;
 end proc:

but this gives Error, reserved word `option` or `options` unexpected

Would you know of a system level option to do this? i.e. I want to do trace only the enter/exit trace, just for my own code, but also be able to turn that on/off without having to edit the code. It will great if there is such an way to do this.

Maple 2022

Update June 11,2023

There is really a serious bug in Maple 2023 when it comes to this leaked Z problem.

So far I have found over 2 dozen of these. These are all new in 2023 and did not show in 2022.

Here is another example using odetest but the error from Maple is similar. It complained about leaked _Z. Any thought what can cause these?

 


 

836880

restart;

836880

interface(version);

`Standard Worksheet Interface, Maple 2023.0, Windows 10, March 6 2023 Build ID 1689885`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1462 and is the same as the version installed in this computer, created 2023, June 10, 2:26 hours Pacific Time.`

kernelopts('assertlevel'=2):

sol:=ln(x)-5/2*ln(2)-ln(3)+3/2*ln((6*((x-y(x))^2*(x-3*y(x))^2/x^2/(2*x-3*y(x))^2)^(1/2)*x^2-9*((x-y(x))^2*(x-3*y(x))^2/x^2/(2*x-3*y(x))^2)^(1/2)*x*y(x)-5*x^2+12*y(x)*x-9*y(x)^2)/x/(2*x-3*y(x)))+arctanh(1/((x-y(x))^2*(x-3*y(x))^2/x^2/(2*x-3*y(x))^2)^(1/2)*(x^2-4*y(x)*x+5*y(x)^2)/(2*x-3*y(x))/x)+1/2*ln(-(x-y(x))^2/x/(2*x-3*y(x)))+ln(y(x)*(x-2*y(x))/x/(2*x-3*y(x)))+3*ln(5)-5/2*I*Pi-arctanh(4/5) = 0;
ode:=(3*y(x)*x-2*x^2)*diff(y(x),x)-2*y(x)^2+y(x)*x = 0;
odetest(sol,ode);

ln(x)-(5/2)*ln(2)-ln(3)+(3/2)*ln((6*((x-y(x))^2*(x-3*y(x))^2/(x^2*(2*x-3*y(x))^2))^(1/2)*x^2-9*((x-y(x))^2*(x-3*y(x))^2/(x^2*(2*x-3*y(x))^2))^(1/2)*x*y(x)-5*x^2+12*y(x)*x-9*y(x)^2)/(x*(2*x-3*y(x))))+arctanh((x^2-4*y(x)*x+5*y(x)^2)/(((x-y(x))^2*(x-3*y(x))^2/(x^2*(2*x-3*y(x))^2))^(1/2)*(2*x-3*y(x))*x))+(1/2)*ln(-(x-y(x))^2/(x*(2*x-3*y(x))))+ln(y(x)*(x-2*y(x))/(x*(2*x-3*y(x))))+3*ln(5)-((5/2)*I)*Pi-arctanh(4/5) = 0

(3*y(x)*x-2*x^2)*(diff(y(x), x))-2*y(x)^2+y(x)*x = 0

Error, (in SolveTools:-CancelInverses) assertion failed, simplify should not leak _Z variables out from RootOfs


 

Download more_leaked_Z_june_11_2023.mw

@sursumCorda 

Thanks,. I'll accept this workaround as answer for now. May be this will be fixed in Maple 2024.

I am getting too many bugs in Maple 2023 when trying to solve for y(x) from an equation. Changing all of the code to solve for y instead (after replacing y(x) by y in the equation) solved all these problems. 

I can post collection of such problems if needed, but for now, this workaround works for me.

@acer 

Ok, I changed my code in the function to do this now at the start 

foo:=proc(ode,x::symbol,y::symbol)

local X,XX,XXX,XXX;

#keep fingers crossed that x,y is not X or XX or XXX or XXXX

DynamicSystems:-SystemOptions('statevariable'=X):
DynamicSystems:-SystemOptions('discretefreqvar'=XX):            
DynamicSystems:-SystemOptions('outputvariable'=XXX):
DynamicSystems:-SystemOptions('continuoustimevar'=XXXX):  
....

#y,x passed in can be any symbols. I have no control over 
#what they are

DynamicSystems:-SystemOptions('continuoustimevar'=y):  
etc...
end proc;


Before doing anything later on.

This is inside a function which takes in any possible symbols to use from the caller. It is not possible to predict which letters will be used by the caller. It seems DynamicSystems then has builtin default letters out of the box for these variables.

I do not think the caller will be using X or XX or XXXX for their variables in the ode.

There should really be a better way to do this all of this. I do not think it is a good idea to have the DynamicSystems with its own letters as default like this.

But for now, this works. No more accidental clash between letters. May be in the future I will change this to initilize it with random ly generated symbols to make it more robust.

 

 

@C_R 

Thanks for the suggestion. But how will this actually work?  I assume you mean to start one kernel server for each problem in the loop. With some CPUtime limit. When that is done, start the second problem. Right? So it is like this?

for N in 1 to 100 do
     #start server.exe to process problem number N with specific cputime limit
     #need somehow to wait here until the above is completed
od;

But since I never used this, the first question is, how would I pass arguments to the new server.exe being created? I need to pass it a number and name of .mpl file to run. The number will be the argument (problem number) that proc being invoked will process.

For obtaining the result back, is not that important, as I can have proc being runwrite to file or database its result.

So the main loop just needs to manage starting/terminating each server.exe, one for each problem. 

How will the LOOP know the server has completed? Is there a way to block until it completes? As I do not want to start 20,000 server.exe's. I want to start one to process one problem with some cputime limit, wait for it, and only when it is done start the next one.

Is this what you mean? Is there an example of how to do this in Maple? If this works, I will try it for sure. But now, I have no idea if this is what you mean or not.  Is there an example of how to do all of this in Maple?

reference https://www.maplesoft.com/support/help/maple/view.aspx?path=kernelopts

 

@Carl Love 

I see. But I use it to obtain estimate of size of expression as Maple does not have a leafCount function outside of this package.

How else would one then get this functionality in Maple?  Using length() on an expression does not really do the same thing as LeafCount

This is a basic function in computer algebra (measuring the size of an expression) that a CAS system as mature as Maple should provide.   Is there an alternative in Maple that I am overlooking?

@sursumCorda 

thanks for the examples. Help should have these.

Only thing I will change is to replace 

_EnvTry := hard;

with

_EnvTry := 'hard';

in case the the name hard was assigned some global value before the call is made. 

I think Maple should use strings for such options. Much safer.   So it should be

_EnvTry := "hard";

This applies to all other Maple functions (such as plot commands and others) which uses plain names as option values as these names could easily have been assigned to some global values before using them. But this is another subject.

 

plot( [W(x), W(-1,x)], x=-1..4, view=[-1..4, -3.5..1.5], colour=[red,blue], scaling=constrained, labels=[x,W(x)] );

produced a *better* plot near the branch point.

Do you know why there is larger gap near y=-1 ? Here is the code I used for Maple 2023 on windows and the corresponding Mathematica plot for the same function. You see Maple's has larger gap. Is there a way to reduce this in Maple's version? I am not too familiar with all of Maple's plotting options. May be it needs some tweeking of options to change this?

plot( [LambertW(x), LambertW(-1,x)], x=-1..4, view=[-1..4, -3.5..1.5], colour=[red,blue], scaling=constrained, labels=[x,LambertW(x)] );

Here is the Mathematica 13.2.1 version

Plot[{LambertW[x], LambertW[-1, x]}, {x, -1, 4}, ImageSize -> 400, 
 PlotStyle -> {Red, Blue}, PlotRange -> {Automatic, {-3.5, 1.5}}, 
 AspectRatio -> Automatic]

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