MaplePrimes Questions

Hello. Let's say I have a list of many items. Well, let's list A:=[1,1.732,1.23,4.42,9,6.45,3.45,8.428,9.1,12]. How to get three numbers from it randomly?

In answers given in 

In https://www.mapleprimes.com/questions/227546-How-To-Make-Odetest-Verify-Dsolve

It shows that odetest() did not verify a solution to ODE becuase solution was using hypergeom special functions. If the solution to the ODE was in integral form, then odetest() will verify it OK.

But what to do if the solution I want to verify is already in hypergoem? If I try odetest() it will fail to verify now. Then I can try to convert the solution to integral form and try again.

But when  using convert(sol,Int) followed by odetest() it did not work.

The solutions I try to verify are hand solutions or book solutions, and not coming from dsolve. 

But some of them are the same solution that comes from dsolve() when not using the useInt option. 

Also, I am doing this all inside a Maple program. It is not an interactive process. So I can't do plots and look at them to decide on anything. So verification must all be implemented in code.

The question is: Why did convert(hand_solution,Int) not give the same result as dsolve(ode,useInt)? Is there another way around this? (May be I am asking for too much in this one based on answers in the above link, So that is OK if not possible. But I really like the solution given when using "useInt" option. Much more clear than otherwise).
 

restart;

ode := diff(y(x), x)*(x^3 + 1)^(2/3) + (1 + y(x)^3)^(2/3) = 0;
sol_int:=dsolve(ode,useInt);
odetest(sol_int,ode); #OK now, since solution in integral form

(diff(y(x), x))*(x^3+1)^(2/3)+(1+y(x)^3)^(2/3) = 0

Int(1/(x^3+1)^(2/3), x)+Intat(1/(_a^3+1)^(2/3), _a = y(x))+_C1 = 0

0

hand_solution:= x*hypergeom([1/3, 2/3], [4/3], -x^3) + y(x)*hypergeom([1/3, 2/3], [4/3], -y(x)^3) + _C1 = 0;
convert(hand_solution,Int); #Why this did not give same result as ABOVE?

x*hypergeom([1/3, 2/3], [4/3], -x^3)+y(x)*hypergeom([1/3, 2/3], [4/3], -y(x)^3)+_C1 = 0

(2/9)*x*Pi*3^(1/2)*(Int(1/(_t1^(1/3)*(1-_t1)^(1/3)*(x^3*_t1+1)^(1/3)), _t1 = 0 .. 1))/GAMMA(2/3)^3+(2/9)*y(x)*Pi*3^(1/2)*(Int(1/(_t1^(1/3)*(1-_t1)^(1/3)*(y(x)^3*_t1+1)^(1/3)), _t1 = 0 .. 1))/GAMMA(2/3)^3+_C1 = 0

odetest(%,ode); #does not give zero

-y(x)^3*(1+y(x)^3)^(2/3)*(Int(_t1^(2/3)/((1-_t1)^(1/3)*(y(x)^3*_t1+1)^(4/3)), _t1 = 0 .. 1))+(x^3+1)^(2/3)*(Int(_t1^(2/3)/((1-_t1)^(1/3)*(x^3*_t1+1)^(4/3)), _t1 = 0 .. 1))*x^3-(x^3+1)^(2/3)*(Int(1/(_t1^(1/3)*(1-_t1)^(1/3)*(x^3*_t1+1)^(1/3)), _t1 = 0 .. 1))+(1+y(x)^3)^(2/3)*(Int(1/(_t1^(1/3)*(1-_t1)^(1/3)*(y(x)^3*_t1+1)^(1/3)), _t1 = 0 .. 1))

 

 

Maple 2019.1

Download 072619_2.mw

 

 

 

It seems that the answer to my question is deleted!!!

So, I again repeat it.

How I can calculate this integral?

I want to calculate integral with the constants Aj]j=1,2.

The Amount of these constants  unknown this stage.

Thanks

INTEGRAL

integral.mw

I am trying to evaluate any which way the integral:

int(exp(-(sqrt(4*x^2+4*y^2+4*z^2)^3)), z = -sqrt(4-x^2-y^2).. sqrt(4-x^2-y^2),y=-sqrt(4-x^2)..sqrt(4-x^2),x=-2..2);

The program just hangs, so i click on 'stop current operation'.

Then I tried:

evalf(Int(exp(-(sqrt(4*x^2+4*y^2+4*z^2)^3)), z = -sqrt(4-x^2-y^2).. sqrt(4-x^2-y^2),y=-sqrt(4-x^2)..sqrt(4-x^2),x=-2..2));

It returns the integral back unevaluated.

It's true that I could use a change of variables, changing to spherical coordinates would be best here. But I would like to know if I did set up the original Cartesian integral correctly. Is there some workaround I can apply to get a numeric answer. I am satisfied with a decimal approximation. Then I can compare to the change of variable result. An exact answer would be even better of course.

THis is another ode which I am not able to get odetest to give zero. Any one knows of a trick to verify this solution? It might be just that the solution is too complicated for odetest to verify?


 

restart;

ode:=diff(y(x),x)*(x^3+1)^(2/3)+(1+y(x)^3)^(2/3) = 0;
sol:=dsolve(ode);

(diff(y(x), x))*(x^3+1)^(2/3)+(1+y(x)^3)^(2/3) = 0

x*hypergeom([1/3, 2/3], [4/3], -x^3)+y(x)*hypergeom([1/3, 2/3], [4/3], -y(x)^3)+_C1 = 0

odetest(sol,ode);

-9*(1+y(x)^3)^(1/3)*(x^3+1)^(2/3)*hypergeom([4/3, 5/3], [7/3], -x^3)*x^3*GAMMA(2/3)*(-y(x)^3)^(1/6)/(9*hypergeom([4/3, 5/3], [7/3], -y(x)^3)*y(x)^3*(-y(x)^3)^(1/6)*(1+y(x)^3)^(1/3)*GAMMA(2/3)-4*Pi*3^(1/2)*LegendreP(-1/3, -1/3, -y(x)^3/(1+y(x)^3)+1/(1+y(x)^3)))+9*y(x)^6*hypergeom([4/3, 5/3], [7/3], -y(x)^3)*GAMMA(2/3)*(-y(x)^3)^(1/6)/(9*hypergeom([4/3, 5/3], [7/3], -y(x)^3)*y(x)^3*(-y(x)^3)^(1/6)*(1+y(x)^3)^(1/3)*GAMMA(2/3)-4*Pi*3^(1/2)*LegendreP(-1/3, -1/3, -y(x)^3/(1+y(x)^3)+1/(1+y(x)^3)))+9*y(x)^3*hypergeom([4/3, 5/3], [7/3], -y(x)^3)*GAMMA(2/3)*(-y(x)^3)^(1/6)/(9*hypergeom([4/3, 5/3], [7/3], -y(x)^3)*y(x)^3*(-y(x)^3)^(1/6)*(1+y(x)^3)^(1/3)*GAMMA(2/3)-4*Pi*3^(1/2)*LegendreP(-1/3, -1/3, -y(x)^3/(1+y(x)^3)+1/(1+y(x)^3)))-4*(1+y(x)^3)^(2/3)*Pi*3^(1/2)*LegendreP(-1/3, -1/3, -(y(x)^3-1)/(1+y(x)^3))/(9*hypergeom([4/3, 5/3], [7/3], -y(x)^3)*y(x)^3*(-y(x)^3)^(1/6)*(1+y(x)^3)^(1/3)*GAMMA(2/3)-4*Pi*3^(1/2)*LegendreP(-1/3, -1/3, -y(x)^3/(1+y(x)^3)+1/(1+y(x)^3)))+4*(1+y(x)^3)^(1/3)*(x^3+1)^(1/3)*Pi*3^(1/2)*LegendreP(-1/3, -1/3, -(x^3-1)/(x^3+1))*(-y(x)^3)^(1/6)/((-x^3)^(1/6)*(9*hypergeom([4/3, 5/3], [7/3], -y(x)^3)*y(x)^3*(-y(x)^3)^(1/6)*(1+y(x)^3)^(1/3)*GAMMA(2/3)-4*Pi*3^(1/2)*LegendreP(-1/3, -1/3, -y(x)^3/(1+y(x)^3)+1/(1+y(x)^3))))

simplify(%);

-9*((4/9)*(1+y(x)^3)^(2/3)*Pi*3^(1/2)*LegendreP(-1/3, -1/3, (-y(x)^3+1)/(1+y(x)^3))*(-x^3)^(1/6)+(-(4/9)*(1+y(x)^3)^(1/3)*(x^3+1)^(1/3)*Pi*3^(1/2)*LegendreP(-1/3, -1/3, (-x^3+1)/(x^3+1))+(-x^3)^(1/6)*((-y(x)^6-y(x)^3)*hypergeom([4/3, 5/3], [7/3], -y(x)^3)+x^3*(1+y(x)^3)^(1/3)*hypergeom([4/3, 5/3], [7/3], -x^3)*(x^3+1)^(2/3))*GAMMA(2/3))*(-y(x)^3)^(1/6))/((-x^3)^(1/6)*(9*hypergeom([4/3, 5/3], [7/3], -y(x)^3)*y(x)^3*(-y(x)^3)^(1/6)*(1+y(x)^3)^(1/3)*GAMMA(2/3)-4*Pi*3^(1/2)*LegendreP(-1/3, -1/3, (-y(x)^3+1)/(1+y(x)^3))))

 


 

Download 072619.mw

Maple 2019.1, Physics 395

Download 072619.mw

 

 

This must be a simple question. I have a simple expression:

test := -2+exp(theta)+exp(-theta)

and want to get that factored as a polynomial in the variable exp(-theta).

That is of course easy by hand, but the same problem appears frequently, as a part in further simplifications. There must be an easy way to do it, but I cannot find it. 

            


 

 

How to draw the given data?


 

 

restart

``

0, 0.

 

0.5e-1, 0.7453559923e-1

 

.10, .1054092553

 

.15, .1290994449

 

.20, .1490711985

 

.25, .1666666667

 

.30, .1825741858

 

.35, .1972026594

 

.40, .2108185107

 

.45, .2236067977

 

.50, .2357022604

 

.55, .2472066162

 

.60, .2581988897

 

.65, .2687419249

 

.70, .2788866755

 

.75, .2886751346

 

.80, .2981423970

 

.85, .3073181486

 

.90, .3162277660

 

.95, .3248931448

 

1.00, .3333333333

 

``


 

Download aaa.mw

 

 

pde := diff(u(x, t), x $ 4) = diff(u(x, t), t $ 2);

iv:= subs(L = 100, {u(0, t) = 0, u(L, t) = 0, u(x, 0) = sin(x), D[2](u)(x, 0) = 2*x, D[1, 1](u)(0, t) = 0, D[1, 1](u)(L, t) = 0});

de := pdsolve(pde, iv, numeric):

sa1 := de:-value(output = listprocedure);

sa1:=[x=proc() ... end proc,t=proc() ... end proc,u(x,t)=proc() .. end proc]

    With the above procedure it works, but in the most compact form below it does not work.

pdsolve(pde, iv, numeric,output = listprocedure):

Error, (in pdsolve/numeric/par_hyp) invalid arguments for theta scheme: [output = listprocedure]
 

I have been using simplify() in number of places, and not really expecting it will do any harm. At worst, it will have no effect, or it will change the expression to different form, but the semantics will remain the same.

Until I noticed that odetest() fail on some of my solutions because I called simplify  on the solution before.

One example why this happens, is that Maple simplifies cos(2*x)*sqrt(1/cos(2*x)^2) to csgn(1/cos(2*x)) and this makes odetest fail. Adding assuming x::real has no effect on making odetest happy.

So now I changed simplify(sol) to simplify(sol,size) and this seems so far not to have this adverse effect. 

My main reason for calling simplify  is to make the expression smaller. In Mathematica that is what I do, In Mathematica there is no "size" option to Simplify.

So now, I am very worried about calling simplify() as is.

Could some Maple experts share some of their experience on this? Should one call simplify() only when an explicit option, like size, trig, exp, etc....is also used and not call simplify as is?

restart;

ode:= diff(y(x),x) = 2+2*sec(2*x)+2*y(x)*tan(2*x);
my_sol:= y(x) = ((2*x+sin(2*x))/(cos(2*x)*sqrt(1/cos(2*x)^2))+_C1)*sqrt(1+tan(2*x)^2);
odetest(my_sol,ode);

diff(y(x), x) = 2+2*sec(2*x)+2*y(x)*tan(2*x)

y(x) = ((2*x+sin(2*x))/(cos(2*x)*(1/cos(2*x)^2)^(1/2))+_C1)*(1+tan(2*x)^2)^(1/2)

0

#now simplify the solution first
simplify(my_sol);
odetest(%,ode);

y(x) = (_C1*csgn(1/cos(2*x))+sin(2*x)+2*x)/cos(2*x)

csgn(1, 1/cos(2*x))*_C1/cos(2*x)

simplify(my_sol) assuming x::real;
odetest(%,ode);

y(x) = (_C1*signum(cos(2*x))+sin(2*x)+2*x)/cos(2*x)

signum(1, cos(2*x))*_C1/cos(2*x)

simplify(my_sol,size);
odetest(%,ode);

y(x) = ((2*x+sin(2*x))/(cos(2*x)*(1/cos(2*x)^2)^(1/2))+_C1)*(1+tan(2*x)^2)^(1/2)

0

simplify(cos(2*x)*sqrt(1/cos(2*x)^2))

csgn(1/cos(2*x))

 

 

Download 072519.mw

 

 

Hello. Let's say I have expressions of different lengths - linear combinations of some functions with some coefficients. And there is a free member. Is there a way to get out of these expressions free member? That is func(A)=78.34

Dear Users!

I have made a code using loops. But when I exceute it I go unwanted expression please see the files and try to fix it. I shall be very thankful. 

 

Help.mw

Special request to:

@acer @Kitonum @Preben Alsholm @Carl Love

My question seems simple but after using google and maple help I was still unsuccesfully in plotting a simple line with a function on the same coordinate.

 1. Let f(x) = xe^x^3 and denote by A the area bounded by f(x) = xe^x^3 , x-axis and the
line x = 1.
(a) Graph the function f over the interval [-1; 1].

 

I have no idea on how to plot  f(x) with the line x=1 on the same coordinate.

What is the solution to this error message when trying to run the Maple add-in for Excel?
"The specified module could not be found.  OpenMaple cannot find Maple engine library, maple.dll."

I am running Maple 19.1 and Excel 2016, both 32-bit, in Windows 7.  Excel appears to have successfully installed the Maple add-in.  For example, the Maple add-in icons appear on the Add-ins tab of Excel.  Excel shows the Maple add-in as active in the list of add-ins.  The location of he WMIMPLEX.xla is correct at "C:\Program Files (x86)\Maple\Excel\WMIMPLEX.xla.

Maple support tells me that Maple should add its "bin" folder to the PATH key for excel.exe in the registry key "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\excel.exe\Path".  This path information, however, is not in my computer's registry.  This missing path information might be an obvious problem.  But what is the correct registry entry so that Excel knows where to find the Maple engine library maple.dll?

I tried adding the path to maple.dll in the environmental path variables of Windows 7, but that approach did not work.  I have uninstalled, rebooted, and reinstalled Maple 2019 (32-bit) several times.  Still the same error message.

Thanks.

My name is Viorel Popescu and I am a Ph.D. candidate at University Politehnica of Bucharest, Europe. I was impressed by the article that I found on the internet about Series Solution to Differential Equation with Maple. I am trying to solve the equation g''(r)- r/R*g(r)=0 with initial condition g(2R)=0 and g'(0)=R where R>0 is a positive constant.

with(PDEtools);
pde := diff(c(x, t), x, x) - h*diff(c(x, t), x) = diff(c(x, t), t):

iv := c(0, t) = 0, c(a, t) = 0, c(x, 0) = c0:

de := pdsolve([pde, iv], c(x, t), build);

                         de := ( )

Does anyone know how to solve this PDE?
Thank you,

Oliveira

      

First 8 9 10 11 12 13 14 Last Page 10 of 1776