Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Integrating a positive definite function (normal distribution) and a >= 0 function (Heaviside) should not return a negative value.

 

 

with(Statistics);
X := RandomVariable(Normal(1, sqrt(2.25)));
int(PDF(X, x)*Heaviside(x^7-5*x^4-3*x+1), x = -infinity .. infinity);
                         -0.08507120131

 

 

Bug.mw

I'm doing some work with undirected and directed graphs, and I'm needing to find examples of longest paths and longest cycles.  How may this be done in Maple?

Hello,

I am trying to solve a set of coupled ODEs in the following code (ODE_Prob.mw). But I am getting an error.

Please, what does this error mean and what is the solution.

Thanks in advance. 
 

restart; PDEtools[declare](f(eta), prime = eta, theta(eta), prime = eta); Digits := 16; inf := 9

f(eta)*`will now be displayed as`*f

 

`derivatives with respect to`*eta*`of functions of one variable will now be displayed with '`

 

theta(eta)*`will now be displayed as`*theta

(1)

equ1 := (2*n+1)*f(eta)*(diff(theta(eta), eta))/(2*(n+1)) = (diff(theta(eta), eta, eta))/Pr^(2/(n+1))

(2*n+1)*f(eta)*(diff(theta(eta), eta))/(2*n+2) = (diff(diff(theta(eta), eta), eta))/Pr^(2/(n+1))

(2)

equ2 := (1/2)*(diff(f(eta), eta))^2-(2*n+1)*f(eta)*(diff(f(eta), eta, eta))/(2*n+2) = -n*(diff(f(eta), eta, eta))^(n-1)*(diff(f(eta), eta, eta, eta))+theta(eta)

(1/2)*(diff(f(eta), eta))^2-(2*n+1)*f(eta)*(diff(diff(f(eta), eta), eta))/(2*n+2) = -n*(diff(diff(f(eta), eta), eta))^(n-1)*(diff(diff(diff(f(eta), eta), eta), eta))+theta(eta)

(3)

indets(equ1);

{Pr, eta, n, Pr^(2/(n+1)), diff(diff(theta(eta), eta), eta), diff(theta(eta), eta), f(eta), theta(eta)}

 

{eta, n, (diff(diff(f(eta), eta), eta))^(n-1), diff(diff(diff(f(eta), eta), eta), eta), diff(diff(f(eta), eta), eta), diff(f(eta), eta), f(eta), theta(eta)}

(4)

Bcs := f(0) = 0, (D(f))(0) = 0, (D(f))(inf) = 1, theta(0) = 1, theta(inf) = 0;

f(0) = 0, (D(f))(0) = 0, (D(f))(9) = 1, theta(0) = 1, theta(9) = 0

 

1.301763965

 

1.4

(5)

equ1;

.7916666666666667*f(eta)*(diff(theta(eta), eta)) = .8027059130737796*(diff(diff(theta(eta), eta), eta))

 

(1/2)*(diff(f(eta), eta))^2-.7916666666666667*f(eta)*(diff(diff(f(eta), eta), eta)) = -1.4*(diff(diff(f(eta), eta), eta))^.4*(diff(diff(diff(f(eta), eta), eta), eta))+theta(eta)

(6)

SolP1 := dsolve({Bcs, equ1, equ2}, numeric); SolP1(0); SolP1(inf)

Error, (in dsolve/numeric/BVPSolve) unable to store '-.4744942626692375+1.460343180701223*I' when datatype=sfloat

 

SolP1(0)

 

SolP1(9)

(7)

p1 := plots:-odeplot(SolP1, [eta, f(eta)], 0 .. inf); p2 := plots:-odeplot(SolP1, [eta, theta(eta)], 0 .. inf); p3 := plots:-odeplot(SolP1, [eta, diff(f(eta), eta)], 0 .. inf); plots:-display(Array([p1, p2, p3]))

Error, (in plots/odeplot) input is not a valid dsolve/numeric solution

 

Error, (in plots/odeplot) input is not a valid dsolve/numeric solution

 

Error, (in plots/odeplot) input is not a valid dsolve/numeric solution

 

Error, (in plots:-display) element 1 of the rtable is not a valid plot structure

 

``


 

Download ODE_Prob.mw

 

Is this documented somewhere?  Why Maple do not return 0 from odetest after expanding the solution?

update: added additional tries to simplify it to zero as suggested but they do not give zero.

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

2*x^(1/2)*(diff(y(x), x)) = (1-y(x)^2)^(1/2)

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

odetest(sol,ode);

0

res:=odetest(expand(sol),ode);

cos(x^(1/2)+(1/2)*_C1)-(1/2)*(2*cos(2*x^(1/2)+_C1)+2)^(1/2)

simplify(res)

cos(x^(1/2)+(1/2)*_C1)-(1/2)*(2*cos(2*x^(1/2)+_C1)+2)^(1/2)

simplify(res,symbolic)

cos(x^(1/2)+(1/2)*_C1)-(1/2)*(2*cos(2*x^(1/2)+_C1)+2)^(1/2)

simplify(res,trig)

cos(x^(1/2)+(1/2)*_C1)-(1/2)*(2*cos(2*x^(1/2)+_C1)+2)^(1/2)

combine(res)

cos(x^(1/2)+(1/2)*_C1)-(1/2)*(2*cos(2*x^(1/2)+_C1)+2)^(1/2)

combine(res,trig)

cos(x^(1/2)+(1/2)*_C1)-(1/2)*(2*cos(2*x^(1/2)+_C1)+2)^(1/2)

expand(res)

cos(x^(1/2))*cos((1/2)*_C1)-sin(x^(1/2))*sin((1/2)*_C1)-(1/2)*(4*cos(_C1)*cos(x^(1/2))^2-2*cos(_C1)-4*sin(_C1)*sin(x^(1/2))*cos(x^(1/2))+2)^(1/2)

simplify(expand(res))

cos(x^(1/2))*cos((1/2)*_C1)-sin(x^(1/2))*sin((1/2)*_C1)-(1/2)*(4*cos(_C1)*cos(x^(1/2))^2-2*cos(_C1)-4*sin(_C1)*sin(x^(1/2))*cos(x^(1/2))+2)^(1/2)

simplify(expand(res),symbolic)

cos(x^(1/2))*cos((1/2)*_C1)-sin(x^(1/2))*sin((1/2)*_C1)-(1/2)*(4*cos(_C1)*cos(x^(1/2))^2-2*cos(_C1)-4*sin(_C1)*sin(x^(1/2))*cos(x^(1/2))+2)^(1/2)

simplify(expand(res),trig)

cos(x^(1/2))*cos((1/2)*_C1)-sin(x^(1/2))*sin((1/2)*_C1)-(1/2)*(4*cos(_C1)*cos(x^(1/2))^2-2*cos(_C1)-4*sin(_C1)*sin(x^(1/2))*cos(x^(1/2))+2)^(1/2)

simplify(expand(res),size)

cos(x^(1/2))*cos((1/2)*_C1)-sin(x^(1/2))*sin((1/2)*_C1)-(1/2)*(4*cos(_C1)*cos(x^(1/2))^2-2*cos(_C1)-4*sin(_C1)*sin(x^(1/2))*cos(x^(1/2))+2)^(1/2)

 

 

Download odetest_q.mw

I want to plot the graph of the function as seen below but I have the error. Please help me.


restart;

a := 5;
b := 2;
u := 3;
v := 4;
A := 1;
B := 2;

In := (n, delta) -> Pi*a*((delta + a)^(2 - 2*n) + (delta - a)^(2 - 2*n))/(delta*(1 - n));

Jn := (n, delta) -> 1/2*(((delta + a)^2 - b^2)^(1 - n) - ((a - delta)^2 - b^2)^(1 - n))/(a*delta);

E1 := delta -> -u*A*In(3, delta) + u*B*In(6, delta);

E2 := delta -> -8*Pi^2*a^2*b^2*u*v*A*(Jn(3, delta) + 2*b^2*Jn(4, delta)) + 8/5*Pi^2*a^2*b^2*u*v*B*(5*Jn(6, delta) + 80*b^2*Jn(7, delta) + 336*b^4*Jn(8, delta) + 512*b^6*Jn(9, delta) + 256*b^8*Jn(10, delta));

Et(delta):= delta -> E1(delta) + E2(delta);
 
plot(Et(delta), delta = 16 .. 28);
 

 

Hi, I ran the following command: 

int(x^2 * sqrt(1-x^2), x)

and I got a solution. Then I try IntTutor: 

IntTutor(x^2 * sqrt(1-x^2), x)

And a UI window popus, does nothing. When I click "All Steps" it says "Unable to solve this problem". How so, if int() just gave me an answer? Or am I using the commands wrong?

I'm trying to see the steps by step solution of the integral, so I can compare it with my attempts. Kinda like what http://integral-calculator.com/ does. Thanks in advance. 

Hi,

How to generate random prime numbers ?

For example, prime number between 3 and 30 ?

Thanks

 

Ask_maple.pdf

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/Ask_maple.mw .
 

Download Ask_maple.mw

 

I know that you can open the command prompt from within the maple interface, but how do i append instructions for it to execute a .ps1 script please thank you in advance 

F := proc(f,x)

    f(x); # invalid.

end proc;

 

f := (a,b,c)->a*b*c;

 

F(f,3);

    = 3*b*c;

 

How can I just apply 3 to one of the parameters in F without knowing how man(I really want to apply it to the first parameter but it doesn't matter all that much).

 

I really need to sorty of curry and uncurry a function. I might want to pass an function of arbitrary dimension but only apply a value to one parameter(usually the first).

 

while I could do somethign like

 

F(x->f(x,b,c))

 

this is kinda verbose and requires me to know the parameters of f at the call site, I don't think that is necessary.

Is there any way to extend maple by adding constants, functions, etc that are automatically loaded without having to add a with statement?

 

While I can use a template there are two issues, I don't really wanna see all the additions and I the template opens as the file and so the filename does not change. If one modifies the template and saves then it ruins the template. (it should open the template but not use the filename)

Anyone with the idea of seq such help please. I am tryong to collect all the series into one case but its only calling the last one.

The link is attached below. Thank you in advance

 

 seq.mw

Hello

 

As title says, when I enter equation in math mode and switch to text mode and hit "enter" to go to the next line then it gets executed, usually in former versions it didnt execute and was much faster for me to use the program this way.

How do I fix this? I don't want to use shift-F5 all the time to make the text unexecutable, I would like it to be like in the old version prior to 2019.

Now it does this which is really annoying, I dont want it to execute when changing line!

Best regards

Jonas

Hi guys

I want to solve the following differential equation but I can not. please help me in this way

diff(phi((8*R^(3/2)-W)*sqrt(2)/(24*sqrt(M))), W$2)=lambda*phi((8*R^(3/2)-W)*sqrt(2)/(24*sqrt(M)))

 

with the best regard

First 518 519 520 521 522 523 524 Last Page 520 of 2097