## Problem with the use of GetConstant...

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 out.GetConstantQuestion.mw

## Integration and complex values...

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.

ex.mw

Best

## Finding operands and operating on multiple operand...

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!

## How to plot absolute advantage of option A over op...

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

## Exception from Latex may be due to typesetting...

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.

 > interface(version); Physics:-Version();

 > restart;
 > #interface(warnlevel=4); #kernelopts('assertlevel'=2): interface(typesetting=standard); #to prevent bug. see https://www.mapleprimes.com/questions/232450-Why-Maple-Writes-The-Equation-Like-This

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

 > latex(r)

Error, (in latex) unable to proceed; could you please report this problem at physics@maplesoft.com

 > interface(typesetting=extended);

 > latex(r)

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

 >

## How come maple not be able so evalb this simple fa...

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.

## exception using solve. How to catch when using ass...

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

 > restart;
 > trial_solution_constants:=[A[1]]; eq:=-A[1]-exp(x^2)*exp(-x^2) = 0; solve(identity(eq,x),trial_solution_constants)

Using assertlevel, now unable to catch exception

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

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

Not Using assertlevel now can catch exception

 > restart;
 > interface(warnlevel=4);

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

 >

## piecewise function and integral ...

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

piecewise_funciton_and_integral.mw

thanks for your remaks and help

## Simple isolate fails...

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

## How do I solve systems of second order differentia...

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.

 >
 (1)
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)

Thank you very much!

## How to solve this type of equations...

Hi

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.

https://doi.org/10.5281/zenodo.803418

Thank you.

Thank you a lot.

Why?

## Simplify with Side Relations and then eval...

I simplified a vector column using side relations. Then I wanted to evaluate using

eval( equation,  [x1=3,  x2=5......})

But side relations uses the reverse order i.e. after evaluation

[3=x1, 5=x2......]

So then the internals of the list need to be swaped tto work with eval.That is easy. I am just wondering is there a neater way to achieve this?

 (1)

 (2)

 (3)

 (4)

 (5)

 (6)

 (7)