Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

The following problem is old and quite challenging. I found it in a publication from 1959. I have the source and my own solution. I was able to solve it quite laboriously a few years ago using MC14 – but not recently with Maple. Therefore, I'm interested in instructive Maple solutions, just as previous puzzle solutions here have helped me further in using this software. I thank you for that.

A wolf observes a goat. It is grazing in a meadow, tied to a rope. Naturally, he wants to catch the goat and considers whether his starting position is favorable. He estimates that he and the goat will be moving at the same speed at the beginning of the hunt and throughout the pursuit, and that the goat will constantly hold the rope taut to maintain its distance for escape reasons. Now, as he approaches the goat at a constant top speed, the same speed as the goat is fleeing in a circular arc, he asks himself: Where do I need to start from to guarantee success? Are there starting positions that rule out a successful hunt? What happens if I manage to sneak into the grazed area first?

i did for two of them base on the information but one of them is not make my odetest to be zero? where is problem

test.mw

I have already plotted the Nusselt number as a line graph. Now, I would like to plot it as a bar graph instead of line graphs. Specifically, I want to create grouped bar charts that combine several parameters (such as Gr, Rb, N[t], N[r], M, Sc) in a single figure. Each group should correspond to one parameter, with bars representing distinct values (e.g., 0.1, 0.4, 0.6, 0.8). For reference, I have attached a sample figure from another work. Could anyone please help in this regard?

Group_bar_graphs_help.mw

In the plane, the concentric circles k1 and k2 are given with center M. Circle k1 is the unit circle (radius = 1), and k2 has twice the area of ​​k1. From the outside, five congruent circles k3 are placed tangent to k1, each with a radius r yet to be calculated. Prove that the circles k3 can be arranged such that any two adjacent circles k3 and k2 can have a common intersection point, and these intersection points form the vertices of a regular pentagon. The radius r is to be calculated exactly (no approximation) as a term.

Suppose I have a metric g, and I want to perform a conformal transformation g = exp(2Phi(X))*g, is there a straightforward way to do this for curvature quantitieies (Christoffel, Ricci Scalar etc)? I was able to do it rather easily for the Christoffel symbols, as seen below, but it required me making a substitution for each index pair. While this isn't horrible, it would be nice if there was a way to do it without this procedure.

** Edited to make it Phi(X) 

restart;

with(Physics):CompactDisplay(Phi(X)):

Phi(X)*`will now be displayed as`*Phi

(1)

Setup(metric=arbitrary):

_______________________________________________________

 

`Systems of spacetime coordinates are:`*{X = (x1, x2, x3, x4)}

 

`Default differentiation variables for d_, D_ and dAlembertian are:`*{X = (x1, x2, x3, x4)}

 

`The arbitrary metric in coordinates `*[x1, x2, x3, x4]

 

`Signature: `(`- - - +`)

 

_______________________________________________________

 

Physics:-g_[mu, nu] = Matrix(%id = 36893488152300428092)

(2)

Christoffel[~alpha,beta,nu,definition]

Physics:-Christoffel[`~alpha`, beta, nu] = (1/2)*Physics:-g_[`~alpha`, `~mu`]*(Physics:-d_[nu](Physics:-g_[mu, beta], [X])+Physics:-d_[beta](Physics:-g_[mu, nu], [X])-Physics:-d_[mu](Physics:-g_[beta, nu], [X]))

(3)

Simplify(eval((3),[g_[mu,beta]=exp(2*Phi(X))*g_[mu,beta],g_[mu,nu]=exp(2*Phi(X))*g_[mu,nu],g_[beta,nu]=exp(2*Phi(X))*g_[beta,nu]]))

Physics:-Christoffel[`~alpha`, beta, nu] = exp(2*Phi(X))*(Physics:-d_[nu](Phi(X), [X])*Physics:-g_[beta, `~alpha`]+Physics:-d_[beta](Phi(X), [X])*Physics:-g_[nu, `~alpha`]-Physics:-d_[`~alpha`](Phi(X), [X])*Physics:-g_[beta, nu]+Physics:-Christoffel[`~alpha`, beta, nu])

(4)

expand((4))

Physics:-Christoffel[`~alpha`, beta, nu] = (exp(Phi(X)))^2*Physics:-d_[nu](Phi(X), [X])*Physics:-g_[beta, `~alpha`]+(exp(Phi(X)))^2*Physics:-d_[beta](Phi(X), [X])*Physics:-g_[nu, `~alpha`]-(exp(Phi(X)))^2*Physics:-d_[`~alpha`](Phi(X), [X])*Physics:-g_[beta, nu]+(exp(Phi(X)))^2*Physics:-Christoffel[`~alpha`, beta, nu]

(5)
 

 

Any thoughts appreciated, thank you!

MyConformal.mw

It is possible to perform the simplest QFT calculations with second quantization, in Maple? Bosons in a box. See attached example. bosons_in_a_box.mw

Sure any general purpose programming language is capable of performing this task with enough effort. What I am interested in is if the physics tools has a standard way of dealing with these calculations. The general impedement when attempting the calculation is that integrations are perfomed by replacements with delta functions or kronecker delta functions, and its not clear how to force the Maple Physics package to recognize this or if that's possible. Part of the problem is that integrations in maple are defined in one dimension at a time where as in QFT the integration element is almost always atleast three dimensional, d^3x or dxdydzy, the later of which can get extremely cumbersome with even a small number of fields under consideration. I don't find much of what I am refering to mentioned in the help pages and I doubt these types of QFT calculations are possible to perform in Maple without addressing these issues.

bosons_in_a_box.mw

Hello everyone!
I have had an issue for the past weeks, where it seems like Maple has a problem identifying the correct units and also sometimes having an issue with defining a variable.

In the picture below you can see I have defined rho, m and tried to Solve V. I get m^3, which is fine but I cannot change the unit in the right bar (see picture).

I even tried to just take square root of my V to see if I could then change units. It seems like it thinks I'm playing with weight.
I even had 2 teachers trying to help me find a solution, without luck.

I have tried executing the whole document and also only bits of the document without luck.

Does anyone know this problem and has a solution?

Thanks in advance! 

- Jacob

Hi 
How can I plot f3=0 for different values of Tch and qc?

1.mw

For the derivation of the results that I need for my research, I use advanced calculus, special functions etc.

Consider a derivation of the form LHS = RHS1 = ... RHSn.

Suppose that I have a LaTeX file describing this derivation, with fine details of the derivation in notes written using pencil on paper. 

To check this derivation for errors, such as a wrong sign, I could retype LHS and RHSn into Maple and check for equality using symbolic algebra.

To provide a more detailed check of this derivation, I could type LHS, RHS1, ..., RHSn into Maple and check the sequence equalities LHS = RHS1, ..., RHS(n-1) = RHSn using symbolic algebra.

However, this is a laborious and, itself, an error-prone process.

Is there some way of submitting my LaTeX file (or its compiled version) and/or an image of my handwritten notes for checking by Maple, line-by-line, using symbolic algebra?

It's disappointing that after all these years, Maple still hasn't implemented a real sinc() function, in which an expression with a trig expression(s) can be entered as an argument, with a return value that is expressed as a sinc() function(s), not a return of sin() functions, which is what I get when I try to define my own sinc() function. I find that the Sinc function in the DynamicSystems package to not be very useful for general Maple calculations.

The following code converts an expression containing a trig function to a sinc-function expression. How can this code (or some other code) be implemented in Maple by defining a real sinc function that accepts an expression in its argument and returns an evaluated sinc function, not a return value that has sin functions?

eval(expr, {sin = (x -> x*sinc(x)), 
              cos = (x -> (x+Pi/2)*sinc(x+Pi/2)),
              tan = (x -> x*sinc(x)/(x+Pi/2)/sinc(x+Pi/2))});

Attribute: This code was originally posted by Robert Israel

Thanks for any assistance.

i don't  know  why my graph make a problem and what is issue i did plot  but this time make issue for me which i don't know where is problem there is anyone which can help and even modified the plot?

explore-chaotic.mw

i try to use explor option but is not work like i want and i try to use other way but they so classical i want to ask there is any other way for do plotting of this kind of function?
in second part even plot not working?

 

Bgraph1.mw

These are current collections of Maple bugs before I lose track of them. I put them all in one post. Hopefully these can be fixed in Maple 2025.2. For each problem, I post separate worksheet, so there are few worksheets here.

This is all on Linux using 2025.1 and latest SupportTools and latest Physics.

1. Random crashes. This one is very strange. The crash happens randomly. You might need to try few times to see it or close the worksheet and reopen it.
 

restart;

Example . RANDOM CRASHES

 

restart;

sol:=y(t) = (-25*sin(t+arctan(sin(4)*cos(4)/(sin(4)^2-1)))^2+25)^(1/2);
ode:=diff(y(t),t) = (25-y(t)^2)^(1/2);
IC:=y(4)=-5;
odetest(sol,[ode,IC],y(t)) assuming t>1;

y(t) = (-25*sin(t+arctan(sin(4)*cos(4)/(sin(4)^2-1)))^2+25)^(1/2)

diff(y(t), t) = (25-y(t)^2)^(1/2)

y(4) = -5

[(5/2)*2^(1/2)*(-(1-sin(2*t)*sin(8)-cos(2*t)*cos(8))^(1/2)*(1+sin(2*t)*sin(8)+cos(2*t)*cos(8))^(1/2)-sin(2*t)*cos(8)+sin(8)*cos(2*t))/(1+sin(2*t)*sin(8)+cos(2*t)*cos(8))^(1/2), -10]

restart;

sol:=y(t) = (-25*sin(t+arctan(sin(4)*cos(4)/(sin(4)^2-1)))^2+25)^(1/2);
ode:=diff(y(t),t) = (25-y(t)^2)^(1/2);
IC:=y(4)=-5;
odetest(sol,[ode,IC],y(t)) assuming t>1;

y(t) = (-25*sin(t+arctan(sin(4)*cos(4)/(sin(4)^2-1)))^2+25)^(1/2)

diff(y(t), t) = (25-y(t)^2)^(1/2)

y(4) = -5

Error, (in anonymous procedure called from cos) too many levels of recursion

restart;

sol:=y(t) = (-25*sin(t+arctan(sin(4)*cos(4)/(sin(4)^2-1)))^2+25)^(1/2);
ode:=diff(y(t),t) = (25-y(t)^2)^(1/2);
IC:=y(4)=-5;
odetest(sol,[ode,IC]) assuming t>1;

y(t) = (-25*sin(t+arctan(sin(4)*cos(4)/(sin(4)^2-1)))^2+25)^(1/2)

diff(y(t), t) = (25-y(t)^2)^(1/2)

y(4) = -5

[-(5/2)*2^(1/2)*((1-sin(2*t)*sin(8)-cos(2*t)*cos(8))^(1/2)*(1+sin(2*t)*sin(8)+cos(2*t)*cos(8))^(1/2)-sin(8)*cos(2*t)+sin(2*t)*cos(8))/(1+sin(2*t)*sin(8)+cos(2*t)*cos(8))^(1/2), -10]

restart;

sol:=y(t) = (-25*sin(t+arctan(sin(4)*cos(4)/(sin(4)^2-1)))^2+25)^(1/2);
ode:=diff(y(t),t) = (25-y(t)^2)^(1/2);
IC:=y(4)=-5;
odetest(sol,[ode,IC]) assuming t>1;

y(t) = (-25*sin(t+arctan(sin(4)*cos(4)/(sin(4)^2-1)))^2+25)^(1/2)

diff(y(t), t) = (25-y(t)^2)^(1/2)

y(4) = -5

[-(5/2)*2^(1/2)*((1-sin(2*t)*sin(8)-cos(2*t)*cos(8))^(1/2)*(1+sin(2*t)*sin(8)+cos(2*t)*cos(8))^(1/2)-sin(8)*cos(2*t)+sin(2*t)*cos(8))/(1+sin(2*t)*sin(8)+cos(2*t)*cos(8))^(1/2), -10]

restart;

sol:=y(t) = (-25*sin(t+arctan(sin(4)*cos(4)/(sin(4)^2-1)))^2+25)^(1/2);
ode:=diff(y(t),t) = (25-y(t)^2)^(1/2);
IC:=y(4)=-5;
odetest(sol,[ode,IC]) assuming t>1;

y(t) = (-25*sin(t+arctan(sin(4)*cos(4)/(sin(4)^2-1)))^2+25)^(1/2)

diff(y(t), t) = (25-y(t)^2)^(1/2)

y(4) = -5

Error, (in signum) too many levels of recursion

restart;

sol:=y(t) = (-25*sin(t+arctan(sin(4)*cos(4)/(sin(4)^2-1)))^2+25)^(1/2);
ode:=diff(y(t),t) = (25-y(t)^2)^(1/2);
IC:=y(4)=-5;
odetest(sol,[ode,IC],y(t)) assuming t>1;

y(t) = (-25*sin(t+arctan(sin(4)*cos(4)/(sin(4)^2-1)))^2+25)^(1/2)

diff(y(t), t) = (25-y(t)^2)^(1/2)

y(4) = -5

Error, (in anonymous procedure called from cos) too many levels of recursion

restart

sol:=y(t) = (-25*sin(t+arctan(sin(4)*cos(4)/(sin(4)^2-1)))^2+25)^(1/2);
ode:=diff(y(t),t) = (25-y(t)^2)^(1/2);
IC:=y(4)=-5;
odetest(sol,[ode,IC],y(t)) assuming t>1;

y(t) = (-25*sin(t+arctan(sin(4)*cos(4)/(sin(4)^2-1)))^2+25)^(1/2)

diff(y(t), t) = (25-y(t)^2)^(1/2)

y(4) = -5

[(5/2)*2^(1/2)*(-(1-sin(2*t)*sin(8)-cos(2*t)*cos(8))^(1/2)*(1+sin(2*t)*sin(8)+cos(2*t)*cos(8))^(1/2)+sin(8)*cos(2*t)-sin(2*t)*cos(8))/(1+sin(2*t)*sin(8)+cos(2*t)*cos(8))^(1/2), -10]

restart;

sol:=y(t) = (-25*sin(t+arctan(sin(4)*cos(4)/(sin(4)^2-1)))^2+25)^(1/2);
ode:=diff(y(t),t) = (25-y(t)^2)^(1/2);
IC:=y(4)=-5;
odetest(sol,[ode,IC],y(t)) assuming t>1;

y(t) = (-25*sin(t+arctan(sin(4)*cos(4)/(sin(4)^2-1)))^2+25)^(1/2)

diff(y(t), t) = (25-y(t)^2)^(1/2)

y(4) = -5

[-(5/2)*2^(1/2)*((1-sin(2*t)*sin(8)-cos(2*t)*cos(8))^(1/2)*(1+sin(2*t)*sin(8)+cos(2*t)*cos(8))^(1/2)+sin(2*t)*cos(8)-sin(8)*cos(2*t))/(1+sin(2*t)*sin(8)+cos(2*t)*cos(8))^(1/2), -10]

restart;

sol:=y(t) = (-25*sin(t+arctan(sin(4)*cos(4)/(sin(4)^2-1)))^2+25)^(1/2);
ode:=diff(y(t),t) = (25-y(t)^2)^(1/2);
IC:=y(4)=-5;
odetest(sol,[ode,IC]) assuming t>1;

y(t) = (-25*sin(t+arctan(sin(4)*cos(4)/(sin(4)^2-1)))^2+25)^(1/2)

diff(y(t), t) = (25-y(t)^2)^(1/2)

y(4) = -5

[-(5/2)*2^(1/2)*((1-sin(2*t)*sin(8)-cos(2*t)*cos(8))^(1/2)*(1+sin(2*t)*sin(8)+cos(2*t)*cos(8))^(1/2)+sin(2*t)*cos(8)-sin(8)*cos(2*t))/(1+sin(2*t)*sin(8)+cos(2*t)*cos(8))^(1/2), -10]

 

 

 

 

Download random_crashes_sept_8_2025.mw

 

2. collection of bugs from solve(identity) (another one related to solve(identity at end)

interface(version);

`Standard Worksheet Interface, Maple 2025.1, Linux, June 12 2025 Build ID 1932578`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 29 and is the same as the version installed in this computer, created June 23, 2025, 10:25 hours Eastern Time.`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1877 and is the same as the version installed in this computer, created 2025, July 11, 19:24 hours Pacific Time.`

 

Example 1

 

restart;

eq:=1/8*A^2*exp(2*theta*(B+I))+1/8*exp(2*theta*(B-I))*A^2-1/4*A^2*exp(2*B*theta)-1/4*exp(theta*(B-2*I))*A*B-1/4*exp(theta*(B+2*I))*A*B+1/2*A*B*exp(B*theta)+1/4*exp(theta*(B-2*I))*A*C+1/4*exp(theta*(B+2*I))*A*C-1/2*A*C*exp(B*theta)-1/4*I*exp(theta*(B-2*I))*A+1/4*I*exp(theta*(B+2*I))*A+1/4*C^2*cos(2*theta)-1/4*C^2-1/2*C*sin(2*theta)-1/2*cos(2*theta)-1=0:
the_vars:=[A, B, C]:
solve(identity(eq,theta),the_vars);

Error, (in gcd/doit) too many levels of recursion

 

Example 2

 

restart;

eq:=-x^(1/2)-1/2*x*A^2+A*B*sinh(B*x)-1/2*x*A^2*cosh(2*B*x)=0;
the_vars:=[A, B]:
solve(identity(eq,x),the_vars);

-x^(1/2)-(1/2)*x*A^2+A*B*sinh(B*x)-(1/2)*x*A^2*cosh(2*B*x) = 0

Error, (in gcd/doit) too many levels of recursion

 

 

Example 3

 

restart;

eq:=1 = X*(2*cos(X)*cos(x0)-X*sin(X)*cos(x0)-2*sin(X)*sin(x0)-X*cos(X)*sin(x0)-x0*sin(X)*cos(x0)-x0*cos(X)*sin(x0))*(2*Y*ln(Y+y0)+Y+2*y0*ln(Y+y0)+y0)/Y/(X*cos(X)*cos(x0)-X*sin(X)*sin(x0)+x0*cos(X)*cos(x0)-x0*sin(X)*sin(x0)+sin(X)*cos(x0)+cos(X)*sin(x0))/(2*ln(Y+y0)+2*Y/(Y+y0)+1+2*y0/(Y+y0));

1 = X*(2*cos(X)*cos(x0)-X*sin(X)*cos(x0)-2*sin(X)*sin(x0)-X*cos(X)*sin(x0)-x0*sin(X)*cos(x0)-x0*cos(X)*sin(x0))*(2*Y*ln(Y+y0)+Y+2*y0*ln(Y+y0)+y0)/(Y*(X*cos(X)*cos(x0)-X*sin(X)*sin(x0)+x0*cos(X)*cos(x0)-x0*sin(X)*sin(x0)+sin(X)*cos(x0)+cos(X)*sin(x0))*(2*ln(Y+y0)+2*Y/(Y+y0)+1+2*y0/(Y+y0)))

solve(identity(eq,X),[x0,y0]);

Error, (in signature) too many levels of recursion

solve(identity(eq,X),[x0,y0,Y]);

Error, (in signature) too many levels of recursion

 

 


 

Download collection_of_maple_internal_errors_sept_6_2025.mw

 

3. Adding Physics:-Setup(assumingusesAssume = true): make combine fail

interface(version);

`Standard Worksheet Interface, Maple 2025.1, Linux, June 12 2025 Build ID 1932578`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 29 and is the same as the version installed in this computer, created June 23, 2025, 10:25 hours Eastern Time.`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1877 and is the same as the version installed in this computer, created 2025, July 11, 19:24 hours Pacific Time.`

restart

Physics:-Setup(assumingusesAssume = true):

A:=1/6*ln(u^2+1)+1/3*arctan(u)+1/6*ln(u^2-3^(1/2)*u+1)-1/3*arctan(2*u-3^(1/2))+1/6*ln(u^2+3^(1/2)*u+1)-1/3*arctan(2*u+3^(1/2));
combine(A,ln) assuming real;

(1/6)*ln(u^2+1)+(1/3)*arctan(u)+(1/6)*ln(u^2-3^(1/2)*u+1)-(1/3)*arctan(2*u-3^(1/2))+(1/6)*ln(u^2+3^(1/2)*u+1)-(1/3)*arctan(2*u+3^(1/2))

Error, (in assuming) when calling 'is'. Received: 'invalid input: (u^2+1)^(1/6)*(u^2-3^(1/2)*u+1)^(1/6) <> 0'

Physics:-Setup(assumingusesAssume = false):

combine(A,ln) assuming real;

ln((u^2+1)^(1/6)*(u^2-3^(1/2)*u+1)^(1/6))+ln((u^2+3^(1/2)*u+1)^(1/6))+(1/3)*arctan(u)-(1/3)*arctan(2*u-3^(1/2))-(1/3)*arctan(2*u+3^(1/2))

 


 

Download adding_Phsyics_makes_combine_fail_sept_6_2025.mw

 

4. odetest internal error when adding assuming

interface(version);

`Standard Worksheet Interface, Maple 2025.1, Linux, June 12 2025 Build ID 1932578`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 29 and is the same as the version installed in this computer, created June 23, 2025, 10:25 hours Eastern Time.`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1877 and is the same as the version installed in this computer, created 2025, July 11, 19:24 hours Pacific Time.`

restart;

sol:=y(x) = 6*x/(3*x-2*LambertW(-3/2*exp(5/2*x+5/6*_C2)))+1/2*x+1/3;
ode:=x-2*y(x)-1+(3*x-6*y(x)+2)*diff(y(x),x) = 0;
odetest(sol,ode,y(x)) assuming positive;

y(x) = 6*x/(3*x-2*LambertW(-(3/2)*exp((5/2)*x+(5/6)*_C2)))+(1/2)*x+1/3

x-2*y(x)-1+(3*x-6*y(x)+2)*(diff(y(x), x)) = 0

Error, (in depends) too many levels of recursion

odetest(sol,ode,y(x)); #removing positive it now works

-(40/3)*LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2))^4/((-3*x+2*LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2)))^3*(1+LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2))))+180*LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2))^3*x/((-3*x+2*LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2)))^3*(1+LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2))))-450*LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2))^2*x^2/((-3*x+2*LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2)))^3*(1+LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2))))+315*LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2))*x^3/((-3*x+2*LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2)))^3*(1+LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2))))-(40/3)*LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2))^3/((-3*x+2*LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2)))^3*(1+LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2))))-252*LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2))^2*x/((-3*x+2*LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2)))^3*(1+LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2))))+630*LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2))*x^2/((-3*x+2*LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2)))^3*(1+LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2))))+315*x^3/((-3*x+2*LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2)))^3*(1+LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2))))-432*x*LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2))/((-3*x+2*LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2)))^3*(1+LambertW(-(3/2)*exp((5/2)*x+(5/6)*c__2))))

 


 

Download internal_odetest_error_sept_6_2025.mw

 

5. solve(identity,..  gives internal error when one variable is missing

interface(version);

`Standard Worksheet Interface, Maple 2025.1, Linux, June 12 2025 Build ID 1932578`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 29 and is the same as the version installed in this computer, created June 23, 2025, 10:25 hours Eastern Time.`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1877 and is the same as the version installed in this computer, created 2025, July 11, 19:24 hours Pacific Time.`

restart;

eq:=-A^2*exp(2*B*x)+A*B*exp(B*x)-2*A*C*exp(B*x)-C^2-a*cos(b*x)^m*(A*exp(B*x)+C+1)=0;

-A^2*exp(2*B*x)+A*B*exp(B*x)-2*A*C*exp(B*x)-C^2-a*cos(b*x)^m*(A*exp(B*x)+C+1) = 0

the_vars:=[A, B, C,m]: #all variables are listed
solve(identity(eq,x),the_vars);

[[A = 0, B = B, C = -(1/2)*a-(1/2)*(a^2-4*a)^(1/2), m = 0], [A = 0, B = B, C = -(1/2)*a+(1/2)*(a^2-4*a)^(1/2), m = 0], [A = -C-(1/2)*a-(1/2)*(a^2-4*a)^(1/2), B = 0, C = C, m = 0], [A = -C-(1/2)*a+(1/2)*(a^2-4*a)^(1/2), B = 0, C = C, m = 0]]

the_vars:=[A, B, C]:   #forget to add m variable to list, now it gives internal error variables are listed
solve(identity(eq,x),the_vars);

Error, (in depends) too many levels of recursion

 


 

Download missing_variable_solve_sept_6_2025.mw

 

6. odesteps gives internal error (was question before, moved it to here, so all in one place)
 

interface(version);

`Standard Worksheet Interface, Maple 2025.1, Linux, June 12 2025 Build ID 1932578`

SupportTools:-Version();

`The Customer Support Updates version in the MapleCloud is 29 and is the same as the version installed in this computer, created June 23, 2025, 10:25 hours Eastern Time.`

restart;

ode:=x^2*diff(y(x),x$2)+(x^2-5*x)*diff(y(x),x)+(5-6*x)*y(x)=0; #22942.  

x^2*(diff(diff(y(x), x), x))+(x^2-5*x)*(diff(y(x), x))+(5-6*x)*y(x) = 0

sol:=dsolve(ode);

y(x) = c__1*x^5*(x+5)+c__2*x*(x^4*(x+5)*Ei(1, x)+(-x^4-4*x^3+3*x^2-4*x+6)*exp(-x))

Student:-ODEs:-ODESteps(ode)

Warning, cannot verify that the given particular solution, y(x) = 1+1/5*x, actually solves the corresponding homogeneous ODE, diff(diff(y(x),x),x)+1/x*(x-5)*diff(y(x),x)-(-5+6*x)/x^2*y(x) = 0

Error, (in Student:-ODEs:-ChangeVariables) the ODE, diff(diff(U(T),T),T) = 5*(T^2+6*T-5)/T^2/(5+T)*U(T)-diff(U(T),T)*(T^2+2*T-25)/T/(5+T), contains the undifferentiated dependent variable, U(T), but the transformation %3, does not

 


 

Download internal_error_ODESteps_sept_2_2025.mw

Hi everyone

I have the following list:

L:=[[F[1], F[2], F[3], F[4]], [F[1], F[2], F[3], M[1]], [F[1], F[2], F[3], M[2]], [F[1], F[2], F[3], M[3]], [F[1], F[2], F[3], M[4]], [F[1], F[2], F[4], M[1]], [F[1], F[2], F[4], M[2]], [F[1], F[2], F[4], M[3]], [F[1], F[2], F[4], M[4]], [F[1], F[2], M[1], M[2]]

How do I select only the subsets in which the four elements have different indices? For example, I don't want [F[1], F[2], F[3], M[1]] Regards,

Oliveira

I must thank @Scot Gould for having asked this question more than a year ago and thus, without meaning to, having been the driving force behind this post.

There is an enormous literature about Monte-Carlo integration (MCI for short) and you might legitimately ask "Why another one?".

A personal experience.
Maybe if I tell you about my experience you will better understand why I believe that something is missing in the traditional courses and textbooks, even the most renowned ones.

For several years, I led training seminars in statistics for engineers working in the field of numerical simulation.

At some point I always came to speak about MCI and (as anyone does today) I introduced the subject by presenting the estimation of the area of a disk by randomly picking points in its circumscribed square and assessing its area from the proportion of points it contained.



Once done I switched (still as anybody does) to the Monte-Carlo summation formula (see Wikipedia for instance).

One day an attendee asked me this question "Why do you say that this [1D] summation formula is the same thing that the [2D] counting of points in the [circle within a box] example you have just presented?"

I have to say I was surprised by this question for it seemed to me quite evident that these two ways of assessing the area were nothing but two different points of view of, roughly, the same thing.

So I gave a quick, mostly informal, explanation (that I am not proud of) and, because the clock was running, I kept teaching the class.

But this question really puzzled me and I thought for a simple but rigourous way to prove these two approaches were (were they?) equivalent, at least in some reasonable sense.

The thing is that trying to derive simple explanations based on couting is not enough, and that you have to resort to certain probabilistic arguments to get out of it. Indeed, sticking to the counting approach leads to the more reasonable position that these two approaches are not equivalent.

The end of the story is that I spent more time on these two approaches of MCI during the trainings that followed.

Saying that, yes, the summation formula seems to be the reference today, but that the old counting strategy still has some advantages and can even gives access to information that the summation formula cannot.

About this post.
This post focuses mainly on what I call the Historical viewpoint (counting points), and is aimed, in its first part, to answer the question "Is this point of view equivalent or not to the Modern (summation formula) one?" (And if it is, in what sense is it so?).

Let me illustrate this with the example @Scot Gould  presented in its question. The brown bold curve on the left figure is the graph of the function  func(x) (whose expression has no interest here) and the brown area represents the area we want to assess using MCI.

In the Historical approach I picked unifomly at random N=100 points within the gray box (of area 2.42), found 26 of them were in the brown region and said the area of this latter is 2.42 x 26/100 = 0.6292. The Modern approach consists in picking uniformly N random points in the range x= [0.8, 3],  and using the blue formula to get an estimation of this same area ((Lbox is the x-length of the gray box, here equal to 2.2).

The quesion is: Am I assessing the same thing when I apply either method? And, perhaps more importantly, do my estimators have the same properties?


And here apppears a first problem:

  • Whatever the number of times you repeat the Historical sampling method, even with different points, you will always get a number of points in the brown region between 0 and N included, meaning that if S is the area of the gray box, the estimation of the brown area is always one of these numbers {0, S/N, 2.S/N, ..., S}.
  • At the opposite repetitions of the Modern approach will lead to a continuum of values for this brown area.
  • So, saying the two approaches might be equivalent simply means that a discrete set is equivalent to a non countable one.

If we remain at the elementary counting level, Historical and Modern viewpoints then are not equivalent.

Towards a probabilistic model of the Historical Process:
This goes against everything you may have heard or read: so, are the authors of these statements all wrong?

Yes, from a strict Historical point of view, but happily not if we interpret the Historical approach in a more loose and probabilistic manner (although this still needs to be considered carefully as it is shown in the main worksheet).

This probabilistic manner relies upon a probabilistic model of the Historical process, where the event "K points out of N belong to the brown area" is to be interpreted as the realization of a very special random variable named Poisson-Binomial (do not worry if you never heard about it: a lot of statisticians did not neither).

In a few words, whereas a Binomial random variable is the sum of several independent and identically distributed Bernoulli random variables, a Poisson-Binomial random variable is the sum of several independent but not necessarily identically distributed Bernoulli random variables. Thus the Poisson-Binomial distribution generalizes the Binomial one.

Using the properties of Poisson-Binomial random variables we must prove in a rigorous way that the expectations of the area estimators for both the Historical and Modern approaches are identical.

So, given this "trick" the two methods are thus equivalent, are they not? And that settles it.

In fact, no, the matter of equivalence still remains.

When uncertainty enters the picture.
Generally one cannot satisfy ourselves with the sole estimation of the area and we would like to have information about the reliability of this estimation. For instance if I find this value is 0.6292, am I ready to bet my salary that I am right? Of course not, unless I am insane, but the things would change if I were capable of saying for instance that "I am 95% sure that the true value of the area is between 0.6 and 0.67".

For the Historical vewpoint the Poisson-Binomial model makes possible to assess an uncertainty (not the uncertainty!) of the area estimation. But things are subtle, because there are different ways to compute an uncertainty:

  • At the elementary level the height of the gray box is an essential parameter, but it does not necessarily gives a good estimation of this uncertainty (one can easily reduced this latter arbitrarily close to 0!).
  • To get reliable uncertainty estimation the call to a probability theory related to Extreme Value Theory (EVT for short) necessary (all of this is explained in the attached worksheet).


For the Modern point of view it is enough to observe that there is no concept of "box height" and that it is then impossible to assess any uncertainty. Question: "If it is so, how can (all the) MCI procedures return an uncertainty value?"
The answer is simple: they consider a virtual encapsulating box whose eight is the maximum of the 
func(xi). This trick enables providing an uncertainty, but this is a non-conservative estimation (an over-optimistic one if you prefer, in other terms an estimation we must regard very carefully).

So, at the end Historical and Modern approaches are equivalent only if we restrict to the estimation of the area, but no longer as soon as we are interested in the quality of this estimation.

What does the attached file contain?
The attached file speaks a lot to the estimation of the estimator uncertainty.
The core theory is named (Right) EndPoint Theory (I found nothing on Wikipedia nor any easy-to-read papers about this theory, so I more or less arbitrarilly decided to refer to this one). Basically it enables assessing the (usually right) end-point of a distribution known only through (right) censored data.
The simplest example is those of a New York pedestrian who looks to the taxi numbers and asks himself how to assess the highest number a taxi has. Here we know this number exists (meaning that some related distribution is bounded), but the situation can be more complex if one does not ever know if this distribution is bounded or not (in which cas one seeks for a right end-point whose probability to be overpassed is less than some small value).
A conservative, and thus reliable, uncertainty on the area estimator  can only be derived in the framework of the end-point theory.

Once the basis of this theory are understood it becomes relatively simple to enhance the Historical approach to get estimators with lessen uncertainties.
I present different ways to do this: one (even if derived otherwise) is named Importance Sampling, and the other leads in a straightforward way to algorithms which are quite close to some used in the CUBA library (partially accessible through evalf/Int).

The last important, if not fundamental, concept discussed in this article concerns the distinction between dispersion interval and confidence interval, concepts that are unfortunately not properly distinguished due to the imprecision of the English language (I apologize to native English speakers for these somewhat harsh words, but this is the reality here).

Some references are provided in attached (main) worksheet, but please, if you don't want to end up even more confused than you were before, avoid Wikipedia.

To sum up.
This note is a non-orthodox presentation of MCI centered arround the Historical viewpoint which, I am convinced of that, deserves a little more attention than the disk-in-the-square picture commonly displayed in MCI courses and textbooks.
An I am even more convinced of that then this old-fashion (antiquated?) approach is an open door to some high level probability theories such than the EndPoint and the EVT one.

Of course this post is not an advocacy agaist the Modern approach, and does not mean that you have to ignore classical texts or that the Law of Large Numbers (LLN) or the Central limit theorms are useless stuff in MCI.

Maple, but not just Maple.
A part of the attached worksheet is devoted base presents results I got with R  (a programming language for statistical computing and data visualization), simply because Maple 2015 (and it is still true for Maple 2025) did not contain the functions I needed.

For instance R implements the Cuba library in a far more complete way than Maple (I give a critical discussion about the way Maple does it), enabling for instance the change of the random seed.

Main worksheet (I apologize in advance for typos that could remain in the texts)
A_note_on_Monte-Carlo_Integration.mw

The main worksheet refers to this one
How_does_the_variance_of_f_impact_the_estimator_dispersion.mw

Extra worksheet: An introduction to Importance Sampling
Importance_Sampling.mw

1 2 3 4 5 6 7 Last Page 1 of 2220