## how I can plot a contour like attached figure...

how I can plot phi[2] as a contour like attached figure?

tez-1.mw

 >
 >
 >
 (1)
 >
 >
 >
 (2)
 >
 (3)
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >

 >
 >
 >
 (1)
 >
 >
 >
 (2)
 >
 (3)
 >
 >
 >
 >
 >
 >
 >
 >
 >
 >

## Nested Maximization...

Hi,

I am working on an optimization problem, where i want to Maximize numerically a function (it is too complex to have a deriviatve) here a pseudo code:

Maximize(f(x,y,z), initialpoint = {x=1,y=1,z=1},iterationlimit = 9999);

Now i have a constraint on (x,y,z) where I want the maximum of another function be smaller than a threshold. Problem is, that the constraints function does not put it the corresponding x,y,z tupel and therefore the maximization regarding f does not come to a solution.

Maximize(f(x,y,z), {Maximize(g(x,y,z,f),{0<f<1})[1]<Thres},initialpoint = {x=1,y=1,z=1},iterationlimit = 9999);

Maybe you guys have an idea how to solve this.

Best

## Crank–Nicolson Finite difference scheme ...

How to get same graph from maple with finite difference method for differential equations

I m new here how to plot this i have seen related posts no where given clear idea for FDM method

plase help me to get the results Thank you

## Why does this Maple calculation with units differ ...

I am creating a Maple document mode worksheet in which I use the Units package. I was doing a calculation and I noticed a discrepancy when I repeated the calculation slightly more manually (but still expecting the same result).

Here is a link to the worksheet: Units.mw

(Unfortunately, it is hit or miss for me when I try to use the option to show the contents of the worksheet here directly)

Here is a screenshot of the issue

All I am doing in the second calculation is doing some of the unit conversions myself.

I came across this while solving a chemistry problem, and I know the answer in the book agrees with the second calculation.

So the question is why doesn't the first calculation, which uses more of Maple's library to do the calculation, agree with the second calculation?

## Wrong maple output, shows apostroph in the variabl...

Hi,

So I've just installed the 2022 version of Maple and I wanted to make a new document.

But when I'm trying to make a variable with a subscript that includes a comma, I get wrong output.

For example; I want to make the variable Ab,c as 2D input and then it shows 'Ab,c' as output.

Why are those apostrophs showing up?

Thanks for the help

## tiny axes and labels in Ventura 13.4.1?...

I’m on a Mac running Ventura 13.4.1 and Maple 2022.

My plots now have axes and labels that are tiny. It seems like that possibly happened with one of the recent OS updates
Below is a graph of
with(plots): implicitplot3d(3x+2y+4z=2);

It renders the same if I use
implicitplot3d(3x+2y+4z=2, axesfont=["TimesNewRoman", 12], labelfont = ["TimesNewRoman", 12]);

I can to change the 12 to much larger to see them. But I never used to have to do that before. Does anyone know if this is an OS issue? Is there a global setting I can change?

## about root decomposition in Lie algebras...

For the command LieAlgebras[RootSpaceDecomposition] I don't understand what the command return, I read the help and see the examples but still not understanding.

for example it returns:

RSD := RootSpaceDecomposition(CSA);

RSD := table([[-2, -1] = E31, [2, 1] = E13, [1, 2] = E23, [1, -1] = E12, [-1, 1] = E21, [-1, -2] = E32])

I don't understand what means [-2, -1] even they said that is the root but I know that a root is in h* so it must be only a number not a vector.

## Appears to be a bug rendering a graph...

This isn't particularly complicated. Varying the span generates graphs that are smooth or have an obvious bug. Not sure why.

This also happens if you vary the C_I_CentLim or the C_Inventory. I created this example so it is clearly happening.
The graph gets a sharp jag down, then returns to normal.

Something weird with density of points? I played with it for hours and can't get it to go away.
=============================================
restart;
L := 0;
C_Inventory := 1500;
C_I_CentLim := 0.001;
C_I_StartLim := C_Inventory*C_I_CentLim;
C_InV := Matrix(1000, 3);  # This is so you  can see values created only bobble slightly where the graph has a giant deviation.
iCounter := 0;
P_ScLdt := proc(t) local x, k; global L, C_Inventory, iCounter, C_InV; x := 0; k := 0.08; iCounter := iCounter + 1; L := C_Inventory*C_I_CentLim; x := 4.8 + L/(1 + exp(-k*(t - 2060))) + 0.050; C_InV[iCounter, 1] := L; C_InV[iCounter, 2] := C_Inventory; C_InV[iCounter, 3] := x; if 0 < x then C_Inventory := C_Inventory - x; return x; else return 0; end if; end proc;

# Show results 1800-2100  Problem.
pP_ScLdt := plot('P_ScLdt'(x), x = 1800 .. 2100, linestyle = dash, color = red, thickness = 3, axis = [gridlines = [colour = black, majorlines = 2]], legend = "Pg");

# Re-initialize.
L := 0;
C_Inventory := 1500;
C_I_CentLim := 0.001;
C_I_StartLim := C_Inventory*C_I_CentLim;
C_InV := Matrix(1000, 3);
iCounter := 0;
# Show  that problem happens with a little shorter span
pP_ScLdt := plot('P_ScLdt'(x), x = 1850 .. 2100, linestyle = solid, color = black, thickness = 1, axis = [gridlines = [colour = black, majorlines = 2]], legend = "Pg");

# Re-initialize
L := 0;
C_Inventory := 1500;
C_I_CentLim := 0.001;
C_I_StartLim := C_Inventory*C_I_CentLim;
C_InV := Matrix(1000, 3);
iCounter := 0;
# Show problem goes away with a different interval 1900-2200
pP_ScLdt := plot('P_ScLdt'(x), x = 1900 .. 2200, linestyle = dash, color = blue, thickness = 3, axis = [gridlines = [colour = black, majorlines = 2]], legend = "Pg");

# Re-initialize
L := 0;
C_Inventory := 1500;
C_I_CentLim := 0.001;
C_I_StartLim := C_Inventory*C_I_CentLim;
C_InV := Matrix(1000, 3);
iCounter := 0;
# Enlarge the working interval of 1900-2200 to 1900-2300 and the problem returns, in a different place.
pP_ScLdt := plot('P_ScLdt'(x), x = 1900 .. 2300, linestyle = dash, color = blue, thickness = 3, axis = [gridlines = [colour = black, majorlines = 2]], legend = "Pg");

# Re-initialize
L := 0;
C_Inventory := 2000;
C_I_CentLim := 0.001;
C_I_StartLim := C_Inventory*C_I_CentLim;
C_InV := Matrix(1000, 3);
iCounter := 0;

# Enlarge the interval and it causes a larger set of jaggie deviations.
pP_ScLdt := plot('P_ScLdt'(x), x = 1800 .. 2800, linestyle = solid, color = blue, thickness = 1, axis = [gridlines = [colour = black, majorlines = 2]], legend = "Pg");

## how do I estimated parameters use curvefitting fo...

hello, mybe someone can help me to make an estimation parameter use data to diferential equation system. I had have made the maple sheet but there are some error, thank you very much. data_fitting_.mw

## How do I solve this problem ? Why the graph is not...

MAPLE.mw

 >
 > with(plots):
 > with(plottools):
 > with(DEtools):
 > N:=S(t)+C(t)+In(t);
 (1)
 > eqn1 := diff(S(t), t) = (b-mu*S(t)-beta*C(t)*S(t)+gamma*In(t)*S(t)-mu*C(t)-theta*S(t)), S(0) = ic1;
 (2)
 > eqn2:= diff(C(t),t) = rho*(beta*C(t)*S(t)+gamma*In(t)*S(t))-mu*C(t)-alpha*C(t),C(0) = ic2;
 (3)
 > eqn3 := diff(In(t), t) = (1 - rho)*(beta*C(t)*S(t) + gamma*In(t)*S(t)) - mu*In(t) - pi*In(t) + alpha*C(t), In(0) = ic3;
 (4)
 > b := 0.117852;
 (5)
 > mu := 0.035378;
 (6)
 > g := 0.11;
 (7)
 > rho := 0.05;
 (8)
 >
 > beta := 0.02;
 (9)
 > theta := 0.066;
 (10)
 > pi:=0.9;
 (11)

 > alpha:=0.5;
 (12)
 > ic1 := 2390000;
 (13)
 > ic2:=528;
 (14)
 > ic3:=753;
 (15)
 > dsol := dsolve([eqn1, eqn2, eqn3], numeric);
 (16)
 > odeplot(dsol,[[t,In(t),color=red],[t,C(t),color=yellow],[t,S(t),color=blue]],t=0..100,view=[0..0.001,0..2000000]);
 >

## How define functions with variable numbers of inpu...

Hi,

I think the title of the question speaks for itself.

But, to be more precise, here's an example with a real-valued function which, when it has two real numbers as input, gives the ratio of the first number to the second number, but if it has three real numbers as input, it returns the sum of the first number with the product of the next two numbers...

Thanks.

## Error, (in SolveTools:-Polynomial) too many levels...

I found another big problem.

In 2022, I get Error, (in SolveTools:-Polynomial) too many levels of recursion when using alias(seq(c[k] = _C||k, k = 0..10)); at the top of my code and the solution to the ode has c[2],c[3] etc.. as constants of integration.

This solution was given by Kitonum in this answer

I had this for years in the code (i.e. the alias) code.

In Maple 2022 the following gives the above exception error from odetest. I am using 2022, because in 2023 it just hangs on the same code.

If I remove the alias code, no error shows. (solution is wrong, but that is different story).

Also, If I remove the alias code, 2023 no long hangs!

 > restart;
 > #kernelopts('assertlevel'=2):
 > alias(seq(c[k] = _C||k, k = 0..10));

 > ode:=diff(diff(y(x),x),x)+4*diff(y(x),x)+12*y(x) = 80*sin(2*x); sol:=y(x) = -10*exp(-1/2*2^(1/2)*arctan(sin(2*2^(1/2)*x)/cos(2*2^(1/2)*x)))*(c[3]*cos(2*2^(1/2)*x)+c[2]*sin(2*2^(1/2)*x))*((-1/10*exp(4*I*2^(1/2)*x)+1/10)*c[2]-1/10*I*c[3]*exp(4*I*2^(1/2)*x)-1/10*I*c[3])/((exp(4*I*2^(1/2)*x)-1)*c[2]+I*c[3]*exp(4*I*2^(1/2)*x)+I*c[3])*c[1]-10*I*exp(-1/2*2^(1/2)*arctan(sin(2*2^(1/2)*x)/cos(2*2^(1/2)*x)))*(c[3]*cos(2*2^(1/2)*x)+c[2]*sin(2*2^(1/2)*x))*(cos(2*x)-sin(2*x))*exp(2*I*2^(1/2)*x)*exp(2*I*2^(1/2)*x)^(-1/2*I*2^(1/2))/((exp(4*I*2^(1/2)*x)-1)*c[2]+I*c[3]*exp(4*I*2^(1/2)*x)+I*c[3]); odetest(sol,ode);

Error, (in SolveTools:-Polynomial) too many levels of recursion

 >

Why using the alias line above causes this error?  If you remove the alias line, you will see it completes with no error.

But it hangs in 2023. I am no longer using 2023 but went back to 2022 due to too many hangs in 2023. I wonder now if it because of this alias line I had there all the time.  I will remove now and see if this solves some of the hangs I had in 2023.

Anyone can shed some more light on what is going on?

Windows 10.

## LibraryTools and obtaining list of all modules in ...

I can't figure how to obtain list of all modules inside my .mla file.

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.

But I want to do this in code. Not using GUI.

I tried the command

L:=LibraryTools:-ShowContents(my_file.mla):

And this gives L of lenght 15805. Looking at each entry in the above list, it shows things I do not understand and I do not want. It has names in there which I do not know where these came from.

There does not seem to be an option in LibraryTools:-ShowContents() to only return the names of the modules inside .mla. At least I can't find such option.

reference Maple help page

Any idea how to do this in code? Not using the maplet?

Maple 2022 on windows 10

ps. I know I can use the GUI and do EXTRACT to save the list to a file. But this is not good solution. I need the list of names of the modules be in a list so I can do this all in a function with no manual steps.

## command to list names of all procs in module?...

Does Maple have a command to list all names of all procs (local and exported) given a name of module?

There is a question/answer here which shows how to list all procs in module. But I only want the names.

The reason I am asking, I am trying to see if I can code

trace(moduleA:-proc1,
moduleA:-proc2,
moduleB:-proc3,....,
moduleE:-proc1000,
statements = false)

Before running my programming in order to turn tracing on. The problem is that there are 1,000's of proc's in dozens of modules so I need a way to obtain a sequence of the names all such procs automatically each time.

Once I figure how to do it for one module (say moduleA), I will apply this to the other modules I have and collect all names in one long sequence and see if this will work.

Any suggestion how to do this?  I now have all my modules inside one .mla file if it helps. They are all build ito this .mla from source tree of dozens of .mpl files.

Maple 2022 on windows 10

## option trace, how to only display ENTER and EXIT m...

When adding option trace: inside a proc, Maple display trace of all assignments. I only want to see the --> enter  and <-- exit messages,.

I can't figure how to do that. Any suggestions?

Maple 2022 on windows

 > restart;
 > A := module()  export foo:=proc(n,m,k)       option trace:    local r;    r:=n:    B:-boo(r);  end proc: end module: B := module()  export boo:=proc(n)    option trace:    local k;    k:=n;    RETURN();  end proc: end module:
 > #kernelopts(tracelineinfo=2); #printlevel := 10: kernelopts(traceincidentalassign=false): kernelopts(tracesplitmulassign=false): kernelopts(traceshowspecassign=false): kernelopts(traceincidentalassign=false): kernelopts(tracesplitmulassign=false): kernelopts(traceshowspecassign=false): kernelopts(tracelineinfo=0): A:-foo(1,2,diff(y(x),x)=sin(x))

{--> enter foo, args = 1, 2, diff(y(x), x) = sin(x)

{--> enter boo, args = 1

<-- exit boo (now in foo) = }

<-- exit foo (now at top level) = }

 >