## Determine zeros, indifference curve of two levels,...

Dear community,

I'm a taxation student and trying to figure out maple more or less successfully for a research project... My aim is to find the indifference curve of the two levels S_TEV and S_P. As its probably not easy to find the formula, I'd alternatively like to approach the indifference curve numerically.

These are the basis codes:

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);

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*srp

S_P := ESt*(1 + r_p)^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)

r_tev := 0.29*r

K := (0.71*E*(1 + 0.71*r)^T)*0.6

stev := EStk/K
S_TEV := E*(0.29*(1 + r_tev)^T + 0.71*(0.6*stev))

plot3d([S_TEV/E, S_P/E], E = 0 .. 500000, T = 0 .. 15, color = [white, black])

The plot shows the two levels. Id like to derive the indiffernce curve from this plot (intersection of S_TEV and S_PE).
Starting with probably Diff_S := S_TEV - S_P?

Can someone please help me with finding the right codes? I'm lost.... (eg. solve function for S-TEV-S_P=0; finding the right data frame for Diff_S:=0 or almost zero dependent on E and T, i.e. dataframe of E, T and S_TEV and S_P) so that I can plot (3D) all S_TEV = S_P depending on E, T.

Id be incredibly thankful for any help. It would literally safe my thesis!
Thank you so so much in advance!!
Rebekka

## minimizing with units...

When trying to evaluate the following line with values where units are attached Maple chrashes.

(add(eval(F, {x = XY[n, 1], y = XY[n, 2]})^2, n = 1 .. 4), location)

Problem_units.mw

What is the problem here

## IF statement with units...

Dear helpfull community. I stumbled over a problem which I cloud not sort out even after hours of trying to find the error I do.
A simple IF statement does not work when I attach a unit to a value.

tt := 80*Unit('knot');
if tt < 100*Unit('knot') then
lprint(got*it);
end if;

Surprisingly Maple can evalue the expression if a use a = instead of the <. File should be attached.

Please can anyone tell me what I did wrong.

Problem 1 ( If Statement with units)

The if statement could not evealuated with the logical operator < or > when a unit is attached to the value

But it works if the logical operator " = "

 got*it

Anyone an idea why.

## How do I draw a triangle with given measures?...

I am still new to Maple and I don't know how to exactly use it. Is it possible to draw a triangle given the length of the three sides?

If so, how do I do it?

## how to find the exact line number and module where...

I have my code in mla. Using try/catch, I am able to capture an error that happend deep in some call chain. But it is hard to know the exact location where this error happened.

I use StringTools:-FormatMessage( lastexception[2..-1] inside the catch clause to print the exception. But this only prints the message. It does not tell me exactly which line/function/module this happened.

Is there a way to display these information?  Using debugger and stoperror all did not help at all. It does not stop at the line where the error happened. not sure why. I tried it many times. may be I am not using it correctly?

Is it possible to display may be the trace of the calls inside the catch of the try? To know the actual statement that generated the error? Now each time I get an exception, I have to step into the debugger line by line until  I get to the place where the error was which is time consuming. Here is a MWE

```restart;
A:=module()
local B:=module()
export foo:=proc(n)
1/n;
end proc;
end module;

export main:=proc()
try
B:-foo(0);
catch:
print("error happened", StringTools:-FormatMessage( lastexception[2..-1] ));
end try;
end proc;

end module;
```

And now

A:-main()

"error happened", "numeric exception: division by zero"

I'd like to get more information than the above as I said. Line number/proc name/module name or stacktrace showing the calls made up to where the exception started (similar to output from where command in debugger).

The above was done in worksheet. My actual code in inside .mla build from lots of .mpl files.

Maple 2021.2 on windows

## API For Trading Stocks using Maple...

Does an API involving Maple exist for trading stocks? I am interested in creating a trading bot that uses the Maple engine.

## Why GenerateMatrix could not give out the coeffici...

Why GenerateMatrix could not give out the coefficient matrix of the equations in terms of third order vector?

 >
 >
 >
 >
 >
 >
 >
 (1)
 >
 >

## indexed versus symbol...

I don't know how to fix this. What's wrong? Is there an alternative way to include underscores in a cat command?

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

## Find the equation of a plane given the distance to...

Could please help me to write codes for solving the following problem:  The plane (p) includes the line (d): (x-1)/-1=y/1=(z-3)/2, and distance from it to the point M(1,0,3) equal 3. (I solved it with Maple, but the result was "no solution". Thanks so much.

## Solution of Bessel Differential Equation...

Could you help me to get the general solution in this way?

 >
 (1)
 >
 (2)
 >
 >

Thanks

## how can child module call parent local proc, witho...

Here is short description of the problem with code MWE below.

Short version of the question

I want to change

```parent:=module()
local foo:=proc()
NULL;
end proc;

local child:=module()
export boo:=proc()
foo(); #call works as is
end proc;
end module;

end module;
```

To

```parent:=module()
local foo:=proc()
NULL;
end proc;

local child:=module()
export boo:=proc()

#now call no longer works. Maple wants foo exported
#I want to add parent:- to the call to remind me where foo((
#lives but do not want to make foo() in parent exported

parent:-foo();

end proc;
end module;
end module;
```

Longer version of the question

I have a parent module with one child local module inside it. In the child module, there is a proc which wants to call parent's local proc named foo().

As is, the child module can just call the parent's local proc foo() by typing foo() without the need to do parent:-foo() this is because child module has access to parent local proc's and maple knows which foo() by searching the scope from bottom up.

The problem comes when I added a proc also called foo() (by mistake) in the child module without noticing there is one with same name in the parent's.

Now the call foo() will end up calling the child's module foo() and not the parent's foo() becuase that is the "closest" one with this name in the scope. All of this makes sense so far.

The problem comes when the child module wants to really call the parent's foo().

One solution is to change the call to parent:-foo() to explicitly says which foo() to call.

This however now fail, since the parent foo() is local ! And Maple when it sees call to parent:-foo() it now insist it be exported proc (even though the call is being made from inside, i.e. from the child).

I do not want to make the parent's foo() exported just so the child can call it.  I want to keep parent's foo() local, as it is meant to be used only inside the parent and by its children.

You might ask, why not then change the name of the child's foo() to some other name so it does not clash with the parent's local proc name. Yes, I can do this. But for large modules in different files with many procs(), there is a always a chance  a local proc can be added by mistake with happend to be the same name as one in the parent and having to manually keep checking names does not look like the right solution.

My question is: How can a child module call parent's local proc() explicitly, but without making the parent proc exported?  Is there is different syntax to use?

Here is a MWE

```restart;
parent:=module()

export main:=proc()
child:-boo();
end proc;

local foo:=proc()
print("in parent:-foo() proc");
end proc;

local child:=module()
export boo:=proc()
print("in child:-boo() proc");
foo(); #this works. It called parent's local foo()
end proc;
end module;

end module;
```

Now doing parent:-main() works as expected. Notice parent's foo is local to parent module.

Now I changed the child module and did this

```parent:=module()

export main:=proc()
child:-boo();
end proc;

local foo:=proc()
print("in parent:-foo() proc");
end proc;

local child:=module()
local foo:=proc() #added this using same name by mistake
print("in child:-boo()");
end proc;

export boo:=proc()
print("in child:-boo() proc");
foo(); #now this calls the child's foo() ofcourse. But it was meant to call the parents's
end proc;
end module;

end module;
```

The fix is to change the call from the child to becomes    parent:-foo() but now Maple will give an error saying parent does not export foo().

Since the child have access to parent's local proc's, is there a different way to tell Maple I want to call parent's foo() and not my own foo() without making parent's foo() exported?

For example , in Python one call call parent's method expliclity using super().foo()

Maple 2021.2

## How do I import only selected columns from a csv f...

Hello community,

how can I import only selected columns from a csv file?
My current code is the following:

IK := Import("Indifferenzkurve.csv", output = datadir)

However, I'd like to only import the three columns "E","T", and "S_P and S_TEV", not column " " and "Diff".
On this basis, I'd like to plot "S_P and S_TEV":

plot3d([IK], E = 0.1 .. 1000000, T = 1 .. 45)

Rebekka

Hello,

I noted that add and 'add' can give different result, can somebody help me understand it?  Consider the code below:

>phi1 := GAMMA(-(1/2)*vst-8.333500000-(1/2)*r)*GAMMA((1/2)*vst+21/2+(1/2)*r); phi2 := GAMMA(16.66700000+r-2*vst)*GAMMA(2.166500000+vst); xi1 := -vst; xi2 := 16.66700000+r-2*vst; z := 37.52950222; K := 9.846618489*10^(-38)*33.330^(.5000000000*r+10.)

### Then I have the following sums (they were supposed to give the same results):

>f := unapply(K*add(phi1*(-1)^vst*z^(-xi1)/factorial(vst)+phi2*(-1)^vst*z^(-xi2)/(.5*factorial(vst)), vst = 0 .. 10000), r):

>g := unapply(K*'add'(phi1*(-1)^vst*z^(-xi1)/factorial(vst)+phi2*(-1)^vst*z^(-xi2)/(.5*factorial(vst)), vst = 0 .. upto), [r, upto]);

# I am interested in the following quantities:

>evalf(f(1)/f(0));

-6.265883733

>evalf(g(1,10000)/g(0,10000))

25.80438437

That seems very strange to me, why maple gives different results?

## Legend Inside Plot...

How we can locate legend inside the plot like the one in the picture

equ1 := BesselJ(sqrt(17)/2, 10*sqrt(t)*sqrt(2))/t^(1/4) + BesselY(sqrt(17)/2, 10*sqrt(t)*sqrt(2))/t^(1/4)
equ2 := BesselJ(sqrt(17)/2, 10*sqrt(t)*sqrt(2))/t^(1/4) + 5*BesselY(sqrt(17)/2, 10*sqrt(t)*sqrt(2))/t^(1/4)
equ3 := BesselJ(sqrt(17)/2, 10*sqrt(t))/t^(1/4) + 5*BesselY(sqrt(17)/2, 10*sqrt(t))/t^(1/4)
plot([equ1, equ2, equ3], t = 0 .. 30, labels = [t, T[2](t)], tickmarks = [0, 0], labelfont = [TIMES, ITALIC, 12], axes = boxed, color = ["Red", "Violet", "Blue"])
C[3] = 1, C[4] = 1, Omega^2 = 50
C[3] = 1, C[4] = 5, Omega^2 = 50
C[3] = 1, C[4] = 5, Omega^2 = 25

Thank you!

## How can i calculate avarage of n numbers?...

I want to calculate the arithmetic average of a class of 5 students for 3 different exams. I want to calculate a different average for each exam. I want to use i and j variables. exam grades will be random like 20*i. How can i do this program? Any can do this? Thank you

I try this program but i get error

total:=0;

numb:=0;

for i from 1 to 3 do

for j from 1 to 5 do

N[i,j]:=20*i;

total:=total+N[i,j];

numb:=numb+i

end do;

end do;

evalf(total/numb);

 First 78 79 80 81 82 83 84 Last Page 80 of 2173
﻿