MaplePrimes Questions

I need 4400 N of friction and not 2200N, so in wich direction operate it?Whit 2200N i I have mauch oscillation.fall_elevator_on_spring.msimfall_elevator_on_spring.msimthanks

Hi professors,

Please can someone help me 
i want code of  function in maple to calculate values  of B(t), 

i have this matlab code

randn('state',100)          
T = 1; N = 5; dt = T/N;

dW = sqrt(dt)*randn(1,N);   
W = cumsum(dW)

but does not calculate B(0.25) and B(0.5)

Thanks,

I want to generate several graphs  at the same time that can be dynamically adjusted.I tried to write the following code. But it seemed to keep overwriting the previous drawing of graphs in the list g. I only got the last graph K6.

with(GraphTheory):
g:=[seq(CompleteGraph(i),i=2..6)]:
DrawGraph~(g, layout = interactive, layoutoptions = [neutral_color = "pink", initial = spring])

I don't know how to generate  some graphs with dynamically modified layouts at once

Maple uses \begin{array}...\end{array} for the latex of a Matrix, which is all good. But for an empty matrix, it does not generate the column specification c or and so the latex when compiled gives an error. Here is an example

W:=Matrix([[]]);
latex(W)

#which gives

\left[\begin{array}{}
{}
\end{array}\right]

Compare to 

W:=Matrix([[1]]);
latex(W)

#gives

\left[\begin{array}{c}
1 
\end{array}\right]

Because the c is missing in the first example, this generates an error

\documentclass[12pt]{book}
\usepackage{amsmath}

\begin{document}   
\[
\left[\begin{array}{}
{}
\end{array}\right]
\]

\end{document}
>lualatex foo.tex
This is LuaHBTeX, Version 1.13.2 (TeX Live 2021)
 restricted system commands enabled.
(./foo.tex
LaTeX2e <2021-11-15>
 L3 programming layer <2021-11-12>
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/book.cls
Document Class: book 2021/10/04 v1.4n Standard LaTeX document class
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/bk12.clo))
(/usr/local/texlive/2021/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2021/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2021/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-luatex.def)
(./foo.aux) (/usr/local/texlive/2021/texmf-dist/tex/latex/base/ts1cmr.fd)
! Missing # inserted in alignment preamble.
<to be read again>
\cr
l.6 \left[\begin{array}{}

?

Adding the `c` fixes the Latex.

This came up with my code generated an empty  matrix from some computation.

May be this could be corrected for future version of Maple?

Thank you.

Maple 2021.2 on windows 10.  

Dear all

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

Integral.mw

thank you for your help

Hi

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

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

ex.mw

Best

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.

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

`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.`

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
 

extended

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)

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)

latex(r)

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

interface(typesetting=extended);

standard

latex(r)

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

 

Download march_8_2021_latex.mw

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

 

 

restart;

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

[A[1]]

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

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

Using assertlevel, now unable to catch exception

 

restart;

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

3

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

[A[1]]

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

Error, (in unknown) assertion failed

" I am here"

Not Using assertlevel now can catch exception

 

restart;

interface(warnlevel=4);

3

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

[A[1]]

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

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

" I am here"

 

Download march_8_2021_solve.mw

 

Update Sept 7,2022

FYI, here is another internal exception generated by solve which shows only when kernelopts('assertlevel'=2): is set, and which can not be trapped using try/catch. May be this could be fixed in future version of Maple. 

Worksheet attached.


 

interface(version);

`Standard Worksheet Interface, Maple 2022.1, Windows 10, May 26 2022 Build ID 1619613`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1314 and is the same as the version installed in this computer, created 2022, September 2, 15:54 hours Pacific Time.`

restart;

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

3

eq:=1 = -X*(-(Y^2*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)+2*exp(X*Y)*y0*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*Y+exp(X*Y)*y0^2*exp(X*y0)*exp(x0*Y)*exp(x0*y0))/(exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*X+exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*x0+2*Y+2*y0)+(exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*Y+exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*y0+1)/(exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*X+exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*x0+2*Y+2*y0)^2*(Y*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*X+exp(X*Y)*y0*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*X+exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)+Y*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*x0+exp(X*Y)*y0*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*x0))/Y/(-(Y*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*X+exp(X*Y)*y0*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*X+exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)+Y*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*x0+exp(X*Y)*y0*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*x0)/(exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*X+exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*x0+2*Y+2*y0)+(exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*Y+exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*y0+1)/(exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*X+exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)*x0+2*Y+2*y0)^2*(X^2*exp(X*Y)*exp(X*y0)*exp(x0*Y)*exp(x0*y0)+2*exp(X*Y)*exp(X*y0)*x0*exp(x0*Y)*exp(x0*y0)*X+exp(X*Y)*exp(X*y0)*x0^2*exp(x0*Y)*exp(x0*y0)+2)):


try
     sol:=solve(identity(eq,X),[x0, y0]);
catch:
     print("exception");
end try;

Error, (in unknown) assertion failed

 


 

Download solve_exception.mw

 

 

 

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

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

First 330 331 332 333 334 335 336 Last Page 332 of 2426