MaplePrimes Questions

Dear all

I have a continuous piecewise function, but I can't evaluate its integral

thank you for your help


Say I have 3 players on 2 teams. The teams play each other and there are 9 single [[A[s], B[s]], [A[s], B[m]], [A[s], B[w]], [A[m], B[s]], [A[m], B[m]], [A[m], B[w]], [A[w], B[s]], [A[w], B[m]], [A[w], B[w]]]matchups.

A, B, C & X, Y, Z. are the players. A and X are the strongest players, C and Z are the weakest.

Here's one: [[A,X],[B,Y],[C,Z],[A,Y],[B,Z],[C,X],[A,Z],[B,X],[C,Y]]

So i'm looking for some code to display all such permutations.

Carl came up with some code a while back which 'kind of' does it

P:= [A,B]:  S:= [s,m,w]:
[seq(rtable((1..nops(S)) $ nops(P), ()-> index~(P, S[[args]]), order= C_order))];
[[A[s], B[s]], [A[s], B[m]], [A[s], B[w]], [A[m], B[s]], [A[m], B[m]], [A[m], B[w]], [A[w], B[s]], [A[w], B[m]], [A[w], B[w]]]

This is perhaps a stupid question, when I use the ScientificConstant package and call a constant e.g. R this works smoothly. But when I assign the value to a variable to use it in a calculation Maple complains about the units. However, if I assign the constant manually (without using GetConstant) Maple has no issues in solving. Is there a trick to use such a constant in a calculation? I have attached a worksheet to illustrate my question better. Thank you in advance for helping me

Hi guys,

I've got problem with integrating terms consisting complex values, I would like to use principle value (1/x+ie = P(1/x) -i pi \delta(x)) to make integration process easier but dont know how to do it with maple . without using that maple gives very long answer.

Thanks for your help


Hello Maple gurus!

I have two questions related to working with operands:

Question 1

I often find myself in a situation where I have a non-trivial expression for instance containing double integrals with complex exponentials, and want to perform some operation on a heavily nested operand like the exponent to a specific exponential inside the double integral. Usually what I do is use a list argument with the op() or subsop() to operate on the nested operator by finding specific operand numbers.

However, the problem with this is that I am hard-coding the operand number(s) for the operator, and this expression can be located in the middle of a large worksheet. If something above these op() or subop() calls changes and the changes trickle down, the operands might change number and the commands are no longer valid.

Does Maple have any commands that will let me 'find' an operand like one does in by-hand calculations? For example, there might be an exponent nested in a double integral that has 'a*b' in it. What I want is to operate on the operand containing 'a*b' rather than specifying the actual operand number. Is there anything like this?

Question 2

Somewhat related to the above, I sometimes want to do a single function on multiple operands. I tried applyop but that seems to apply a function to each operand individually. What if, for example, I want to run combine() on 2 specific operands, assuming these operands are heavily nested, to combine just those two operands.

Thank you!

Dear community,

this is a related questio to "Determine zeros, indifference curve of two levels, numerical approximation".

I am  trying to model the advantage of corporate taxation (final asset value: V_TEV) over partnership taxation (final asset value: V_P).
I would like to plot the absolute advantage of corporate taxation (VT=V_TEV-V_P) as a function of income (E) and retention period (T). Here x=E, Y=T. I alread plotted the VT. However, Id like to have the graph differently:
I would like to construct the graph in such a way that the absolute wealth advantage VT can be read from the ordinate. Can someone please help me with that?

Here are the formulars, the study is based on:

E := 'E'
h := 4                     
m := 0.035
g:= h*m            
k := 0.15
a := 0.25;
F_ANR := 4*m;
r:= 0.1;
T := 'T';
ESt := piecewise
(E < 9984, 0,
E < 14926, (1008.7*(E - 9984)/10000 + 1400)*(E - 9984)/10000,
E < 58596, (206.43*(E - 14926)/10000 + 2397)*(E - 14926)/10000 + 938.24,
E < 277826, 0.42*E - 9267.53,
0.45*E - 17602.28);

GewSt := piecewise(E < 24500, 0, (E - 24500)*g)

stev := EStk/K

K := 0.6*E*(1 - k - g)*(1 + r*(1 - k - g))^T

EStk := piecewise(K < 9984, 0,
K < 14926, (1008.7*(K - 9984)/10000 + 1400)*(K - 9984)/10000,
K < 58596, (206.43*(K - 14926)/10000 + 2397)*(K - 14926)/10000 + 938.24,
K < 277826, 0.42*K - 9267.53,
0.45*K - 17602.28)

V_TEV := E*(1 + (-k - g))*(1 + r*(1 - k - g))^T*(1 - 0.6*stev)

Er := E + (E - ESt)*r

EStr := piecewise(Er < 9984, 0,
Er < 14926, (1008.7*(Er - 9984)/10000 + 1400)*(Er - 9984)/10000,
Er < 58596, (206.43*(Er - 14926)/10000 + 2397)*(Er - 14926)/10000 + 938.24,
Er < 277826, 0.42*Er - 9267.53,
0.45*Er - 17602.28);

srp := EStr/E

r_p := r*(1 - srp)

V_P := (E - ESt + GewSt - min(ESt, GewSt, E*F_ANR))*(1 + r_p)^T

VT := V_TEV - V_P

plot3d(VT, E = 0 .. 500000, T = 1 .. 15, axes = boxed)

Thank you so much in advance!! Rebekka

When I convert Maple expression to Latex, before calling Latex, I replace some math names by strings in order to keep them as is in the generated Latex instead of using Maple own shortened name when conversion to latex().

Later on, in the Latex file, I add \DeclareMathOperator on each long name. This way the long math names remain and it is more clear.

This has been working well for years. Same code. No problems. All my Latex was generated this way.

Except just now, I hit a case where Maple's latex() gives an error when the math has WeierstrassP in it. latex() generates exception. 

I will email this also to Maplesoft. But thought to also post it here in case someone can see what the problem is.


`Standard Worksheet Interface, Maple 2021.2, Windows 10, November 23 2021 Build ID 1576349`

`The "Physics Updates" version in the MapleCloud is 1165 and is the same as the version installed in this computer, created 2022, March 7, 23:42 hours Pacific Time.`


interface(typesetting=standard); #to prevent bug. see



11*("\WeierstrassP")(x, a, b)*("\WeierstrassPPrime")(x, a, b)/(("\WeierstrassPPrime")(x, a, b)+("\WeierstrassP")(x, a, b)^2)-6*("\WeierstrassP")(x, a, b)^2/(("\WeierstrassPPrime")(x, a, b)+("\WeierstrassP")(x, a, b)^2)+(1/2)*a/(("\WeierstrassPPrime")(x, a, b)+("\WeierstrassP")(x, a, b)^2)


Error, (in latex) unable to proceed; could you please report this problem at




Error, (in TypeTools/nc_var_local) invalid input: member received MathematicalFunctionsNames, which is not valid for its 2nd argument, s



Hi, this is a small problem in af greater one for me. I'm trying to test to bigger equations if they are the same, which i suspect, the thing is, that maple wont evalb it. When i try with this simple problem, it gives me false. Can someone explaine this to me? Thank you for you help.

I am getting an exception divide by zero using solve. The problem is that when using kernelopts('assertlevel'=2):  I am no longer able to catch the exception in a catch try.

Removing kernelopts('assertlevel'=2):  I can catch the exception.

But I need to use kernelopts('assertlevel'=2): in my program.   

Is there a way to keep kernelopts('assertlevel'=2): and still catch exception thrown by solve?

Is this a bug in solve? And why using kernelopts('assertlevel'=2): prevents catching the exception?

Using Maple 2021.2 on windows 10. Worksheet attached.

 exception generated




eq:=-A[1]-exp(x^2)*exp(-x^2) = 0;


-A[1]-exp(x^2)*exp(-x^2) = 0

Error, (in unknown) numeric exception: division by zero

Using assertlevel, now unable to catch exception





   eq:=-A[1]-exp(x^2)*exp(-x^2) = 0;
   print("error happend ",lastexception);
end try;
print(" I am here");


-A[1]-exp(x^2)*exp(-x^2) = 0

Error, (in unknown) assertion failed

" I am here"

Not Using assertlevel now can catch exception





   eq:=-A[1]-exp(x^2)*exp(-x^2) = 0;
   print("error happend ",lastexception);
end try;
print(" I am here");


-A[1]-exp(x^2)*exp(-x^2) = 0

"error happend ", unknown, "numeric exception: division by zero"

" I am here"



Dear all 
I have a function defined over the closed interval [ x[k], x[k+2] ] and zero elsewhere 
I would like to plot this sequence of function and compute an integral. 

I need your help to finish the attahced code, something is wrong. I can't  use piecewise funciton in loop and plot all functions in the same graph

thanks for your remaks and help

Hello, can someone explain why something like this fails? The help page for 'isolate' says the second argument can be 'any algebraic expression'. Thanks.

I have the following systems of ODE in hand and would like to solve them. It would be great if somebody could help me with it.

dudx := -415; dudy := 3901; dudz := -3365; dvdx := 23; dvdy := -1270; dvdz := 994; dwdx := 57; dwdy := -1665; dwdz := 1683; taup := 0.5390603100674905e-5





















u := .387; v := -.205; w := -.286; x0 := -0.979849e-2; y0 := -0.14583e-2; z0 := 0.623749e-1













a__1 := dudx/taup; a__2 := dudy/taup; a__3 := dudz/taup; a__4 := 1/taup; a__5 := u/taup; b__1 := dvdx/taup; b__2 := dvdy/taup; b__3 := dvdz/taup; b__4 := 1/taup; b__5 := v/taup; c__1 := dwdx/taup; c__2 := dwdy/taup; c__3 := dwdz/taup; c__4 := 1/taup; c__5 := w/taup































sys := diff(x(t), t, t) = a__1*x(t)+a__2*y(t)+a__3*z(t)-a__4*(diff(x(t), t))+a__5, diff(y(t), t, t) = b__1*x(t)+b__2*y(t)+b__3*z(t)-b__4*(diff(y(t), t))+b__5, diff(z(t), t, t) = c__1*x(t)+c__2*y(t)+c__3*z(t)-c__4*(diff(z(t), t))+c__5

diff(diff(x(t), t), t) = -76985820.00*x(t)+723666708.0*y(t)-624234420.0*z(t)-185508.0000*(diff(x(t), t))+71791.59600, diff(diff(y(t), t), t) = 4266684.000*x(t)-235595160.0*y(t)+184394952.0*z(t)-185508.0000*(diff(y(t), t))-38029.14000, diff(diff(z(t), t), t) = 10573956.00*x(t)-308870820.0*y(t)+312209964.0*z(t)-185508.0000*(diff(z(t), t))-53055.28800


ics := x(0) = x0, y(0) = y0, z(0) = z0, (D(x))(0) = 0, (D(y))(0) = 0, (D(z))(0) = 0

x(0) = -0.979849e-2, y(0) = -0.14583e-2, z(0) = 0.623749e-1, (D(x))(0) = 0, (D(y))(0) = 0, (D(z))(0) = 0


Thank you very much!



Warm greetings.

Is it possible to solve the numerical scheme present in the below paper.

Anita Chaturvedi, Kokila Ramesh, and Vatsala G A. (2017). “A MATHEMATICAL APPROACH TO STUDY THE EFFECT OF POLLUTANTS/TOXICANTS IN AQUATIC ENVIRONMENT.” International Journal of Research - Granthaalayah, 5(4) RAST, 33-38.

Thank you.

Could please help me solving the following problem?
Thank you a lot.

The question disappeared (I know since I answered today).


First 42 43 44 45 46 47 48 Last Page 44 of 2141