MaplePrimes Questions

Dear Maple community, 

I'm trying to solve a complex expression by taking its first-order derivative and finding the optimal solution. As a result, I'm getting a rootOf expression, which is further not solved by using explicit or allvalues APIs provided in the maple. Can you guys help me where I'm going wrong?

I'm attaching my code file as well for
 

restart

U[d] := Zeta[n]*(2^(2/3)*(theta[n]*lambda*A*beta[n])^(2/3)/(4*beta[n])-delta[n]*`λA`+U[n]+alpha[n])+Zeta[g]*(U[g]-delta[g](1-lambda)*A+tau*A+R+(-2*A*theta[g]*(lambda-1)*beta[g])^(2/3)/(4*beta[g]))+tau*A-A

Zeta[n]*((1/4)*2^(2/3)*(theta[n]*lambda*A*beta[n])^(2/3)/beta[n]-delta[n]*`λA`+U[n]+alpha[n])+Zeta[g]*(U[g]-delta[g](1-lambda)*A+tau*A+R+(1/4)*(-2*A*theta[g]*(lambda-1)*beta[g])^(2/3)/beta[g])+tau*A-A

(1)

FOC := diff(U[d], A)

(1/6)*Zeta[n]*2^(2/3)*theta[n]*lambda/(theta[n]*lambda*A*beta[n])^(1/3)+Zeta[g]*(-delta[g](1-lambda)+tau-(1/3)*theta[g]*(lambda-1)/(-2*A*theta[g]*(lambda-1)*beta[g])^(1/3))+tau-1

(2)

evala(simplify(FOC))

(1/6)*2^(2/3)*(theta[n]*lambda*A*beta[n])^(2/3)*Zeta[n]/(A*beta[n])-(1/6)*Zeta[g]*(-2^(2/3)*(-A*theta[g]*(lambda-1)*beta[g])^(2/3)+6*delta[g](1-lambda)*A*beta[g]-6*tau*A*beta[g])/(A*beta[g])+tau-1

(3)

NULL

NULL

xyz := solve(FOC = 0, A, explicit)

RootOf(-Zeta[n]*theta[n]*lambda*(-_Z*lambda*beta[g]*theta[g]+_Z*beta[g]*theta[g])^(1/3)+3*delta[g](1-lambda)*(theta[n]*lambda*_Z*beta[n])^(1/3)*2^(1/3)*(-_Z*lambda*beta[g]*theta[g]+_Z*beta[g]*theta[g])^(1/3)*Zeta[g]-3*(theta[n]*lambda*_Z*beta[n])^(1/3)*2^(1/3)*(-_Z*lambda*beta[g]*theta[g]+_Z*beta[g]*theta[g])^(1/3)*tau*Zeta[g]+(theta[n]*lambda*_Z*beta[n])^(1/3)*lambda*Zeta[g]*theta[g]-3*tau*(theta[n]*lambda*_Z*beta[n])^(1/3)*2^(1/3)*(-_Z*lambda*beta[g]*theta[g]+_Z*beta[g]*theta[g])^(1/3)-(theta[n]*lambda*_Z*beta[n])^(1/3)*Zeta[g]*theta[g]+3*(theta[n]*lambda*_Z*beta[n])^(1/3)*2^(1/3)*(-_Z*lambda*beta[g]*theta[g]+_Z*beta[g]*theta[g])^(1/3))

(4)

allvalues(xyz)

RootOf(-Zeta[n]*theta[n]*lambda*(-_Z*lambda*beta[g]*theta[g]+_Z*beta[g]*theta[g])^(1/3)+3*delta[g](1-lambda)*(theta[n]*lambda*_Z*beta[n])^(1/3)*2^(1/3)*(-_Z*lambda*beta[g]*theta[g]+_Z*beta[g]*theta[g])^(1/3)*Zeta[g]-3*(theta[n]*lambda*_Z*beta[n])^(1/3)*2^(1/3)*(-_Z*lambda*beta[g]*theta[g]+_Z*beta[g]*theta[g])^(1/3)*tau*Zeta[g]+(theta[n]*lambda*_Z*beta[n])^(1/3)*lambda*Zeta[g]*theta[g]-3*tau*(theta[n]*lambda*_Z*beta[n])^(1/3)*2^(1/3)*(-_Z*lambda*beta[g]*theta[g]+_Z*beta[g]*theta[g])^(1/3)-(theta[n]*lambda*_Z*beta[n])^(1/3)*Zeta[g]*theta[g]+3*(theta[n]*lambda*_Z*beta[n])^(1/3)*2^(1/3)*(-_Z*lambda*beta[g]*theta[g]+_Z*beta[g]*theta[g])^(1/3))

(5)

NULL

Download RootOf_Maple2.mw

reference. 

I am not able to even trap this Maple exception.

Any suggestions what to do? It is not a problem if it can't solve it, but I need to at least be able to  trap the exception in order to go to the next one, else the whole program now stops when it hits this.

I used try..catch but this exception just ignores this and escapes to top level. This is not the first time I've seen Maple exception escape the try/catch. I do not understand why some do that and some not. I

Is this another bug?

interface(version);

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

restart;

eq:=1 = -X*(-1/4*(-40*(X + x0)^(5/3) - 20/3*(X + x0)^(2/3)*Y - 20/3*(X + x0)^(2/3)*y0 - 32*A*(X + x0)^(1/3))/((X + x0)^(5/3)*(Y + y0)) + 5/12*(-15*(X + x0)^(8/3) - 4*(X + x0)^(5/3)*Y - 4*(X + x0)^(5/3)*y0 - 24*A*(X + x0)^(4/3) + 12*A^2)/((X + x0)^(8/3)*(Y + y0)))/(Y*(1/(Y + y0) + 1/4*(-15*(X + x0)^(8/3) - 4*(X + x0)^(5/3)*Y - 4*(X + x0)^(5/3)*y0 - 24*A*(X + x0)^(4/3) + 12*A^2)/((X + x0)^(5/3)*(Y + y0)^2)));

1 = -X*(-(1/4)*(-40*(X+x0)^(5/3)-(20/3)*(X+x0)^(2/3)*Y-(20/3)*(X+x0)^(2/3)*y0-32*A*(X+x0)^(1/3))/((X+x0)^(5/3)*(Y+y0))+(5/12)*(-15*(X+x0)^(8/3)-4*(X+x0)^(5/3)*Y-4*(X+x0)^(5/3)*y0-24*A*(X+x0)^(4/3)+12*A^2)/((X+x0)^(8/3)*(Y+y0)))/(Y*(1/(Y+y0)+(1/4)*(-15*(X+x0)^(8/3)-4*(X+x0)^(5/3)*Y-4*(X+x0)^(5/3)*y0-24*A*(X+x0)^(4/3)+12*A^2)/((X+x0)^(5/3)*(Y+y0)^2)))

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

Error, (in anonymous procedure called from type/realcons) too many levels of recursion

 

Download how_to_trap.mw

Hi, I'm working on some chemistry and i'd like for the unit to me mol/l not mol/m^3. How do i fix this? I googled it and it seems like the unit is the universal standard for concentration but i wasn't taught this in school as we were told to use mol/l. 

I've tried googling and following the guides on the site but i honestly cant figure out what im doing wrong.

Picture for reference 

Hello,

I don't understand. With 2 degrees of liberty and a factor of 5% (1-95%), the table Khi-2 indicates 5,99.

It is impossible for me to obtain this value with Mapple. 2 following tests :

Y := ChiSquareRandomVariable(2);
                            Y := _R0

PDF(Y, 0.05);
CDF(Y, 0.05);
                          0.4876549560

                       0.0246900878919645

PDF(Y, 0.95);
CDF(Y, 0.95);
                          0.3109425282

                       0.378114901350325

The same problème with the instruction RandomVariable(ChiSquare(v)).

Thank you to help me.

Kinds regards

The netlist in the attached Maple file will not solve. 
It will solve if I remove

.CONS Vx=v[D]-v[S]
.VARS Vx

from the netlist.

Syrup returns a 2 element list of [eqs, vars] that can be easily solved using the solve command as shown in the attached file

ModelDebug.mw

It will be great if  DEtools:-convertAlg  which is designed to find coefficients of a linear ode, not to expand the coefficients it finds.

This caused my patterns to fail, as after putting the coefficients in a certain form, and then calling DEtools:-convertAlg later on somewhere else in the program, the patterns no longer worked due to this unexpected expansion.

It will be better if DEtools:-convertAlg returns the coefficients it find as is and not expand them. I could not find an option to use for this. Here is an example.

restart;
ode:=b*(x+x^2)*diff(y(x),x$2)+x*(2*a - 1)*diff(y(x),x)+c*y(x)=0;

After the call the coefficients become

L:=DEtools:-convertAlg(ode,y(x))

You might ask that one can easily "fix" this afterwords. Sure. I can use collect on x. But the point is that in general, it might not be clear what to collect on or what the changes that were made are.

In principle, it is better to keep the coefficients in same form as they were in the ode so that the ode do not change form.

Maple 2022.1 on windows.

For example my friend emailed me.
His email address is oneman@gmail.com, the email content is HELLO.
How does Maple print HELLO to the screen so I can see it?
Thanks for your help!

restart

eq1 := (2*(r^2+a^2*cos(theta)^2))*(M*r-(1/2)*a^2-(1/2)*r^2)*(diff(f(r, theta), r, theta))+(2*(a^2*(M-r)*cos(theta)^2-M*r^2+a^2*r))*(diff(f(r, theta), theta))

2*(r^2+a^2*cos(theta)^2)*(M*r-(1/2)*a^2-(1/2)*r^2)*(diff(diff(f(r, theta), r), theta))+2*(a^2*(M-r)*cos(theta)^2-M*r^2+a^2*r)*(diff(f(r, theta), theta))

(1)

eq2 := sin(theta)*(r^2+a^2*cos(theta)^2)*(diff(f(r, theta), theta, theta))-cos(theta)*(diff(f(r, theta), theta))*(a^2*cos(theta)^2-2*a^2-r^2)

sin(theta)*(r^2+a^2*cos(theta)^2)*(diff(diff(f(r, theta), theta), theta))-cos(theta)*(diff(f(r, theta), theta))*(a^2*cos(theta)^2-2*a^2-r^2)

(2)

eq3 := -2*(r^2+a^2*cos(theta)^2)^2*(M*r-(1/2)*a^2-(1/2)*r^2)*sin(theta)*(diff(g(r, theta), r, r))+sin(theta)*(r^2+a^2*cos(theta)^2)^2*(diff(g(r, theta), theta, theta))+(4*(-(1/4)*cos(theta)^4*a^4+a^2*r*(M-(1/2)*r)*cos(theta)^2-M*a^2*r-(1/4)*r^4))*cos(theta)*(diff(g(r, theta), theta))-2*M*sin(theta)*(diff(g(r, theta), r))*(a^2+r^2)*(cos(theta)*a-r)*(cos(theta)*a+r)

-2*(r^2+a^2*cos(theta)^2)^2*(M*r-(1/2)*a^2-(1/2)*r^2)*sin(theta)*(diff(diff(g(r, theta), r), r))+sin(theta)*(r^2+a^2*cos(theta)^2)^2*(diff(diff(g(r, theta), theta), theta))+4*(-(1/4)*cos(theta)^4*a^4+a^2*r*(M-(1/2)*r)*cos(theta)^2-M*a^2*r-(1/4)*r^4)*cos(theta)*(diff(g(r, theta), theta))-2*M*sin(theta)*(diff(g(r, theta), r))*(a^2+r^2)*(cos(theta)*a-r)*(cos(theta)*a+r)

(3)

pdsolve([eq1, eq2, eq3])

[{f(r, theta) = _F1(r)+(Int((r^2+a^2*cos(theta)^2)/((cos(theta)+1)^(1/2)*(cos(theta)-1)^(1/2)), theta))*_C1/(2*M*r-a^2-r^2)}, [diff(diff(g(r, theta), r), r) = (sin(theta)*(sin(theta)^2*a^2-a^2-r^2)^2*(diff(diff(g(r, theta), theta), theta))-4*cos(theta)*((1/4)*a^4*sin(theta)^4+(-(1/2)*a^2+r*(M-(1/2)*r))*a^2*sin(theta)^2+(1/4)*(a^2+r^2)^2)*(diff(g(r, theta), theta))+2*M*sin(theta)*(diff(g(r, theta), r))*(a^2+r^2)*(sin(theta)^2*a^2-a^2+r^2))/(sin(theta)*(sin(theta)^2*a^2-a^2-r^2)^2*(2*M*r-a^2-r^2))]]

(4)

``

Download pde1.mw

 

restart

A := Omega; assume(Omega > 0); B = Omega

B = Omega

(1)

``

Download assumetest.mw

``

In a physics problem, I came across the following triple integral:

exp := -sin(alpha)*i*r*(-sin(alpha)*cos(phi)*cos(theta)+sin(theta)*cos(alpha))/(4*sqrt(-2*sin(theta)*sin(alpha)*cos(phi)*p*r-2*cos(alpha)*cos(theta)*p*r+p^2+r^2)*Pi(-2*sin(theta)*sin(alpha)*cos(phi)*p*r-2*cos(alpha)*cos(theta)*p*r+p^2+r^2)*(-2+sqrt(2))*Pi)

`assuming`([int(int(int(exp*p^2*sin(alpha), p = 0 .. 1), alpha = 0 .. (1/4)*Pi), phi = 0 .. 2*Pi)], [alpha > 0, alpha < (1/4)*Pi, r > 0, r < 1, phi > 0, phi < 2*Pi, theta > 0, theta < (1/4)*Pi])

``

I tried to perform each integration separately, but got no result. Is there any transformation or procedure, that I am not aware of, to accomplish this task?
Grateful,
Oliveira

Download Triple_integral.mw

Hello,

   A question on programming Procedures (proc).

   What is the best, or most common method, to invoke packages within proc or at the worksheet level?

   I have always been confused about Proc scope for packages.   I use Scientific Constants a lot.   It and several other "with(package)" are part my main loaded pakages right after restart command.   LinearAlgebra is another common used package.

   It has been a question for me of whether to implement a "with()" statement inside of the proc to bound the scope or ensure it is seen/available by the procedure for the available commands inside the packages.  

  All thoughts appreciated.

Thanks,
Bill

After substitution of (10) into (4), how to collect the terms of like powers of eta (i.e., eta^-3, eta^-2,eta^-1, eta^0, eta^1,eta^2 ), and equate the coefficients to
zero, get a system of algebraic equations for A[m]?

 

PA.mw 

g := proc() use a=a+b in use b= a-b in a*b end use end use end proc:

Maple shows g := proc() (a+b)*(a+b) end proc. 

My guess is (a+b)*a. What is wrong with me?

I faced a problem with the following syntax which provided me we partial circles inequality plotting, and how able to improve the syntax:
restart: with(plots):
inequal({y > -1, y >= x^2+1, (x-1)^2+(y-1)^2 <= 16}, x = -5 .. 8, y = -6 .. 6, optionsfeasible = (color = grey), optionsexcluded = (color = white));

restart: with(plots): inequal({y > -1, y >= x^2+1, (x-1)^2+(y-1)^2 <= 16}, x = -5 .. 8, y = -6 .. 6, optionsfeasible = (color = grey), optionsexcluded = (color = white));

Hello, 

How can I force Maple to perform division on a fractional polynomial?  Here's an exmaple of what Im trying to do - I want rr and nsr to be divided and simplified and return a polynomial.

I can see from this that its doing what i want for integer exponents - just not fractions!

I've tried everything I can think of... Let me know! Thanks.

First 108 109 110 111 112 113 114 Last Page 110 of 2262