Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hi,

I am trying to compute the following integral:

int(a*b*c/sqrt((x-a)^2 + (y-b)^2 + (z-c)^2), [a=-1..1, b=-1..1, c=-1..1])

where x, y, z are Real parameters.

The integral looks so simple but Maple can't compute it as is.

Thanks

Hi

I would like to solve the integrodifferential equation and then look to the  stability of the origin.

Is it  stable, uniformly stable, asymptotically stable and uniformly asumptotically stable.

Please see the following code.

Code.mw

Thanks

 

 

We have just released updates to Maple and MapleSim, which provide corrections and improvements to product functionality.

As usual, the Maple update is available through Tools>Check for Updates in Maple, and is also available from our website on the Maple 2018.2.1 download page, where you can also find more details.

For MapleSim users, use Help>Check for Updates or visit the MapleSim 2018.2.1 download page.

I have to use the Chinese Remainder Theorem but once I have found m^e I cant seem to figure out a way that works to get just the message without the exponent. I assumed that the exponent is 3 since the message was encrypted 3 different times. How can I do this with Maple?

CRA_project.mw

Hi all. how can i detect and remove the lists with same members? for example in the code below, i want to remove duplicate of the lists with the same members, for example [1,1,5],[1,5,1],[5,1,1]. i want just one of these sets to remain and the others to be removed. it doesn't matter which. i want just one set with members 1,5,1 which their summation is 7. and the same thing for other lists. thanks in advance.
 

restart:with(combinat):with(Iterator):

MM:=composition(7, 3)

{[1, 1, 5], [1, 2, 4], [1, 3, 3], [1, 4, 2], [1, 5, 1], [2, 1, 4], [2, 2, 3], [2, 3, 2], [2, 4, 1], [3, 1, 3], [3, 2, 2], [3, 3, 1], [4, 1, 2], [4, 2, 1], [5, 1, 1]}

(1)

 


 

Download code.mw

I know this is a trivial worksheet (in document mode) but why does the second subs fail? Thanks  Gravity.mw
 

``

Justification for using mg as the force exerted by mass m in gravity field g

Using Newton's Law of Gravity, find ``

work := `assuming`([int(G*M*m/r^2, r = R .. R+h)], [0 < R, 0 < h])

G*M*m*h/(R*(R+h))

(1)

``

R is >> h, so let R + h = R

work := subs(R+h = R, work)

G*M*m*h/R^2

(2)

``

G, M and R are all constants, so let GM/R² = g

work := subs(G*M/R^2 = g, work)

G*M*m*h/R^2

(3)

``

``


 

Download Gravity.mw

 

I am having problems when trying to sue de colorscheme opiton. I always get an error message. The example below is from the Maple homepage:

plot3d(sin(x)*cos(y), x = 0 .. 4*Pi, y = 0 .. 4*Pi, view = [default, default, -3 .. 3], colorscheme = ["xgradient", ["Green", "Purple", "Blue"]]);
Error, (in plot3d) unexpected option: colorscheme = ["xgradient", ["Green", "Purple", "Blue"]]


Any hint?

Hi I'm done this and I really have no Idea what's wrong with maple :

 

I have no idea how to solve the equation ...
Thanks in advance !

Hello, i am trying to solve the PDE

 (E*I) d4/dx4 [w(x,t)] + (rho*A) d2/dt[w(x,t)]=0

where w(x,t) = W(x) * cos (ω *t)

W(x) is the amplitude of the beam, the PDE is solved for W(x) by seperation of variables.

my first question is how to simplify the equations by replacing the e^ terms with alpha as done in the lecture, so that things look cleaner. And the next question is how do i proceed to input the Boundary conditions to solve the problem? I have looked in quite a lot of places but there is no example of a second or third order boundary condition(if that makes sense)

 beam_vibration_displacement.mwMech_vibrations.pdf

Hi,

I would like to ask you a question on the following program. Where does the error come from?

Thank you for your help in advance.

 

som:=0:

for b1 from 10 to 20 by 1 do
for b2 from 1 to 10 by 0.1 do
for alpha from 0.5 to 0.9 by 0.1 do
for beta from 0.1 to 0.4 by 0.1 do
for c from 1 to 1 by 1 do
for f from 1 to 10 by 1 do
for g from 8 to 470 by 1 do
for lambdai from 0.2 to 0.2 by 0.1 do
for lambdaj from 0.2 to 0.2 by 0.1 do
for gammai from 0.4 to 0.4 by 0.1 do
for gammaj from 0.4 to 0.4 by 0.1 do

aiSQ:=(alpha*b1)/(alpha*b2+beta*b2+c);
ajSQ:=(beta*b1)/(alpha*b2+beta*b2+c);
UiSQ:=(1/2)*alpha*b1^2*(alpha^2*b2+2*alpha*beta*b2+c*alpha+beta^2*b2+2*beta*c)/(alpha*b2+beta*b2+c)^2;
UjSQ:=(1/2)*beta*b1^2*(alpha^2*b2+2*alpha*beta*b2+2*c*alpha+beta^2*b2+beta*c)/(alpha*b2+beta*b2+c)^2;
USQ:=(1/2)*b1^2*(alpha+beta)*(alpha*b2+beta*b2+2*c)/(alpha*b2+beta*b2+c)^2;

ai:=(c*b1*alpha+c*p*f+p*f*beta*b2-alpha*b2*p*f)/(c*(alpha*b2+beta*b2+c));
aj:=(-p*f*beta*b2+alpha*b2*p*f+c*beta*b1+c*p*f)/(c*(alpha*b2+beta*b2+c));
aineg:=(-p*f*lambdai*b2*beta+c*b1-c*b1*lambdai+b2*p*f*lambdaj+b2*alpha*p*f*lambdaj-p*f*lambdai*b2+c*b1*alpha-c*p*f*lambdai)/(c*(b2*alpha-b2*lambdai+b2*beta-b2*lambdaj+c+2*b2));
ajneg:=-(b2*alpha*p*f*lambdaj-p*f*lambdai*b2-p*f*lambdai*b2*beta+b2*p*f*lambdaj+c*p*f*lambdaj-c*b1-c*beta*b1+c*lambdaj*b1)/(c*(b2*alpha-b2*lambdai+b2*beta-b2*lambdaj+c+2*b2));
ui:=alpha*(b1*(aineg+ajneg)-(b2/2)*(aineg+ajneg)^2)-(c/2)*aineg^2-p*f*(aineg-ai);
uj:=beta*(b1*(aineg+ajneg)-(b2/2)*(aineg+ajneg)^2)-(c/2)*ajneg^2-p*f*(ajneg-aj);
u:=(b1*(aineg+ajneg)-(b2/2)*(aineg+ajneg)^2)+p*f*(aineg-ai)+p*f*(ajneg-aj);
eqti:=gammai*(u-tj-USQ)-((1-gammai)/(1-lambdai))*(ui-UiSQ);
eqtj:=gammaj*(u-ti-USQ)-((1-gammaj)/(1-lambdaj))*(uj-UjSQ);
solt:=solve({eqti, eqtj}, {ti, tj});
ti:=subs(solt,ti);
tj:=subs(solt,tj);
dai:=diff(ai,p);
daj:=diff(aj,p);
daineg:=diff(aineg,p);
dajneg:=diff(ajneg,p);
dti:=diff(ti,p);
dtj:=diff(tj,p);
eqp:=(b1-b2*(ai+aj))*(dai+daj)-dti-dtj+f*(aineg-ai)+p*f(daineg-dai)+f*(ajneg-aj)+p*f(dajneg-daj)-g*p=0;
p:=solve(eqp,p);

Uip:=alpha*(b1*(ai+aj)-(b2/2)*(ai+aj)^2)-(c/2)*ai^2-p*f*(aineg-ai)+(1-lambdai)*ti;
Ujp:=beta*(b1*(ai+aj)-(b2/2)*(ai+aj)^2)-(c/2)*aj^2-p*f*(ajneg-aj)+(1-lambdaj)*tj;
Up:=(b1*(ai+aj)-(b2/2)*(ai+aj)^2)+p*f*(aineg-ai)+p*f*(ajneg-aj)-((g^2)/2)*p-ti-tj;

CSQ:=b1-b2*(aiSQ+ajSQ);
Cabat:=b1-b2*(ai+aj);
Cneg:=b1-b2*(aineg+ajneg);

if (CSQ>0 and Cabat>0  and Cneg>0 and beta<alpha and p>0 and p<1)
then
print(b1,b2,alpha,beta,c,f,g,lambdai,lambdaj,`aiSQ=`,aiSQ,`ajSQ=`,ajSQ,`UiSQ=`,UiSQ,`UjSQ=`,UjSQ,`USQ=`,USQ,`ai=`,ai,`aj=`,aj,`aineg=`,aineg,`ajneg=`,ajneg,`ti=`,ti,`tj=`,tj,`p=`,p,`Uip=`,Uip,`Ujp=`,Ujp,`Up=`,Up);
som:=som+1;
fi;
od;od;od;od;od;od;od;od;od;od;od;
som;

10, 1, 0.5, 0.1, 1, 1, 8, 0.2, 0.2, aiSQ=, 3.12500000000000, ajSQ=, 

  0.625000000000000, UiSQ=, 10.3515625000000, UjSQ=, 2.85156250000000, USQ=, 

  30.4687500000000, ai=, 3.14314584993738, aj=, 0.667340316520551, aineg=, 

  4.06068541500626, ajneg=, 2.80826596834794, ti=, 19.2559726892491, tj=, 

  7.44890809994178, p=, 0.0483889331663441, Uip=, 25.8431760998162, Ujp=, 

  8.71735374786572, Up=, 2.73962847065372
Error, (in solve) a constant is invalid as a variable, 7.44890809994178, 19.2559726892491
                                      1

is possible to solve this pde via maple?

m1.mwm1.mw
 

restart

sys := [-(-r^2+1)*(diff(theta(r, z), z))+(diff(theta(r, z), r)+r*(diff(theta(r, z), r, r)))/r+diff(theta(r, z), z, z)+(diff(theta(r, z), r))*(diff(sigma(r, z), r))+(diff(sigma(r, z), z))*(diff(theta(r, z), z))+(diff(theta(r, z), r))^2+(diff(theta(r, z), z))^2 = 0, -(-r^2+1)*(diff(sigma(r, z), z))+(diff(sigma(r, z), r)+r*(diff(sigma(r, z), r, r)))/r+diff(sigma(r, z), z, z)+(diff(theta(r, z), r)+r*(diff(theta(r, z), r, r)))/r+diff(theta(r, z), z, z) = 0]; IBCs := {sigma(1, z) = 1, sigma(r, 0) = 1, theta(1, z) = 1, theta(r, 0) = 1, (D[1](sigma))(0, z) = 0, (D[1](theta))(0, z) = 0, (D[2](sigma))(r, 1) = 0, (D[2](theta))(r, 1) = 0}

[-(-r^2+1)*(diff(theta(r, z), z))+(diff(theta(r, z), r)+r*(diff(diff(theta(r, z), r), r)))/r+diff(diff(theta(r, z), z), z)+(diff(theta(r, z), r))*(diff(sigma(r, z), r))+(diff(sigma(r, z), z))*(diff(theta(r, z), z))+(diff(theta(r, z), r))^2+(diff(theta(r, z), z))^2 = 0, -(-r^2+1)*(diff(sigma(r, z), z))+(diff(sigma(r, z), r)+r*(diff(diff(sigma(r, z), r), r)))/r+diff(diff(sigma(r, z), z), z)+(diff(theta(r, z), r)+r*(diff(diff(theta(r, z), r), r)))/r+diff(diff(theta(r, z), z), z) = 0]

 

{sigma(1, z) = 1, sigma(r, 0) = 1, theta(1, z) = 1, theta(r, 0) = 1, (D[1](sigma))(0, z) = 0, (D[1](theta))(0, z) = 0, (D[2](sigma))(r, 1) = 0, (D[2](theta))(r, 1) = 0}

(1)

NULL


 

Download m1.mw

 

Hello,

I have this problem with pdsolve , I need to know the value of dTf(x,y)/dy, but I knew just the value of Tf 

Pleas find attached the code


 

restart

with(plots); with(ExcelTools); with(Student[Calculus1])

restart

eq := diff(Tf(x, y), x) = diff(Tf(x, y), y, y):

Cl := {1 = Tf(0, y), (D[2](Tf))(x, 0) = 1, (D[2](Tf))(x, 1) = 1};

{1 = Tf(0, y), (D[2](Tf))(x, 0) = 1, (D[2](Tf))(x, 1) = 1}

(1)

pds := pdsolve(eq, Cl, numeric);

_m191894592

(2)

pp := pds:-value(x = 2, output = listprocedure);

[x = 2., y = proc (y) option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; evalf(y) end proc, Tf(x, y) = proc (y) local res, solnproc, outpoint, ndsol; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := trunc(evalhf(Digits)); outpoint := evalf(y); solnproc := proc (outpoint) local indepvals, depvals, vary, ndep, i; option `Copyright (c) 2001 by Waterloo Maple Inc. All rights reserved.`; table( [( "soln_procedures" ) = array( 1 .. 1, [( 1 ) = (18446744073902277486)  ] ) ] ) indepvals := Vector(21, {(1) = .0, (2) = 0.5e-1, (3) = .1, (4) = .15, (5) = .2, (6) = .25, (7) = .3, (8) = .35, (9) = .4, (10) = .45, (11) = .5, (12) = .55, (13) = .6, (14) = .65, (15) = .7, (16) = .75, (17) = .8, (18) = .85, (19) = .9, (20) = .95, (21) = 1.0}, datatype = float[8]); if outpoint = "left" then return indepvals[1] elif outpoint = "right" then return indepvals[21] elif outpoint = "start" then return HFloat(0.0) elif not type(outpoint, 'numeric') then error "non-numeric input" end if; if outpoint < indepvals[1] or indepvals[21] < outpoint then error "requested %1 value must be in the range %2..%3", y, indepvals[1], indepvals[21] end if; depvals := Matrix(21, 1, {(1, 1) = .4999930801471113, (2, 1) = .5499968318884445, (3, 1) = .6000080871124441, (4, 1) = .6499977374209617, (5, 1) = .6999980446183738, (6, 1) = .7500003281451354, (7, 1) = .8000006534468979, (8, 1) = .850000137731867, (9, 1) = .8999998355209465, (10, 1) = .9499998529282891, (11, 1) = .9999999999999913, (12, 1) = 1.0500001470716935, (13, 1) = 1.1000001644790365, (14, 1) = 1.149999862268117, (15, 1) = 1.1999993465530858, (16, 1) = 1.2499996718548485, (17, 1) = 1.3000019553816105, (18, 1) = 1.3500022625790227, (19, 1) = 1.3999919128875402, (20, 1) = 1.4500031681115404, (21, 1) = 1.500006919852874}, datatype = float[8], order = C_order); vary := Vector(2, {(1) = .0, (2) = -0.5e-1}, datatype = float[8]); ndep := 1; if vary[ndep+1]-outpoint <> 0. then `pdsolve/interp1dto0d`(21, indepvals, 1, depvals, false, outpoint, vary); vary[ndep+1] := outpoint end if; [seq(vary[i], i = 1 .. ndep)] end proc; if not type(outpoint, 'numeric') then if member(outpoint, ["start", "left", "right"]) then return solnproc(y) elif outpoint = "solnprocedure" then return eval(solnproc) elif procname <> unknown then return ('procname')(y) else ndsol := pointto(solnproc("soln_procedures")[1]); return ('ndsol')(y) end if end if; try res := solnproc(outpoint); res[1] catch: error  end try end proc]

(3)

``

rhs(op(3, pp))

proc (y) local res, solnproc, outpoint, ndsol; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; Digits := trunc(evalhf(Digits)); outpoint := evalf(y); solnproc := proc (outpoint) local indepvals, depvals, vary, ndep, i; option `Copyright (c) 2001 by Waterloo Maple Inc. All rights reserved.`; table( [( "soln_procedures" ) = array( 1 .. 1, [( 1 ) = (18446744073902277486)  ] ) ] ) indepvals := Vector(21, {(1) = .0, (2) = 0.5e-1, (3) = .1, (4) = .15, (5) = .2, (6) = .25, (7) = .3, (8) = .35, (9) = .4, (10) = .45, (11) = .5, (12) = .55, (13) = .6, (14) = .65, (15) = .7, (16) = .75, (17) = .8, (18) = .85, (19) = .9, (20) = .95, (21) = 1.0}, datatype = float[8]); if outpoint = "left" then return indepvals[1] elif outpoint = "right" then return indepvals[21] elif outpoint = "start" then return HFloat(0.0) elif not type(outpoint, 'numeric') then error "non-numeric input" end if; if outpoint < indepvals[1] or indepvals[21] < outpoint then error "requested %1 value must be in the range %2..%3", y, indepvals[1], indepvals[21] end if; depvals := Matrix(21, 1, {(1, 1) = .4999930801471113, (2, 1) = .5499968318884445, (3, 1) = .6000080871124441, (4, 1) = .6499977374209617, (5, 1) = .6999980446183738, (6, 1) = .7500003281451354, (7, 1) = .8000006534468979, (8, 1) = .850000137731867, (9, 1) = .8999998355209465, (10, 1) = .9499998529282891, (11, 1) = .9999999999999913, (12, 1) = 1.0500001470716935, (13, 1) = 1.1000001644790365, (14, 1) = 1.149999862268117, (15, 1) = 1.1999993465530858, (16, 1) = 1.2499996718548485, (17, 1) = 1.3000019553816105, (18, 1) = 1.3500022625790227, (19, 1) = 1.3999919128875402, (20, 1) = 1.4500031681115404, (21, 1) = 1.500006919852874}, datatype = float[8], order = C_order); vary := Vector(2, {(1) = .0, (2) = -0.5e-1}, datatype = float[8]); ndep := 1; if vary[ndep+1]-outpoint <> 0. then `pdsolve/interp1dto0d`(21, indepvals, 1, depvals, false, outpoint, vary); vary[ndep+1] := outpoint end if; [seq(vary[i], i = 1 .. ndep)] end proc; if not type(outpoint, 'numeric') then if member(outpoint, ["start", "left", "right"]) then return solnproc(y) elif outpoint = "solnprocedure" then return eval(solnproc) elif procname <> unknown then return ('procname')(y) else ndsol := pointto(solnproc("soln_procedures")[1]); return ('ndsol')(y) end if end if; try res := solnproc(outpoint); res[1] catch: error  end try end proc

(4)


Thank you

Download mapleprime.mw

I am trying to see if I can run a program looking at the tendency of clustering within groups - basically to see if something occurs within sequential members of a group versus not clustering within the group. I simply wanted to see the indexmax expected tendency to sequentially cluster followed by the probability of exceeding that index max. However, I keep getting the error:  "Error, cannot determine if this expression is true or false: Dmax < 0”. Is there any quick fix to this? 

 

restart;

G = unapply((x-y+1)*X/binomial(x, y)+1-(x-y+1)/binomial(x, y), x, y); PSI := G(3, 2)^10*G(4, 2)^4*G(4, 3)^2*G(5, 2)^2*G(5, 4)*G(5, 3)*G(6, 2)^4*G(7, 3)*G(8, 2)*G(9, 2)*G(9, 3)*G(9, 4)*G(10, 2)^2*G(11, 2)*G(11, 3)*G(12, 3)*G(13, 3)*G(15, 2)^2;

evalf(expand(PSI));

for i from 0 to degree(PSI) do D . i = evalf(coeff(PSI, X, i)) end do; Dmax = 0; for i from 0 to degree(PSI) do if D . i > Dmax then index = i; Dmax = D . i end if end do;

 

Error, cannot determine if this expression is true or false: Dmax < 0

 

mean := sum('i*D . i', 'i' = 1 .. degree(PSI));

indexmax := index;

Proba := sum('D . i', 'i' = 20 .. degree(PSI));

 

This is a Wave PDE inside disk. with fixed edge of disk,  and no theta dependency. initial position and velocity  given.

When using "c^2" for the  wave propagation speed, Maple only gives solution when also using assumptions to tell that c is positive.

restart; 
Physics:-Version()[2]; 
`2018, November 28, 1:35 hours, version in the MapleCloud: 224, version installed in this computer: 224`

And the PDE is 

pde := diff(u(r, t), t$2) = c^2*( diff(u(r,t), r$2)  + (1/r)* diff(u(r,t),r)  ) ; 
ic:=u(r,0)=1, eval( diff(u(r,t),t),t=0)=r/3; 
bc:=u(1,t)=0; 
sol:=pdsolve([pde, ic,bc], u(r, t)) assuming t>0;

sol:=()

Now adding assuming c>0, or "c::positive", or "c>=0", it solves it 

restart;
pde := diff(u(r, t), t$2) = c^2*( diff(u(r,t), r$2)  + (1/r)* diff(u(r,t),r)  ) ; 
ic:=u(r,0)=1, eval( diff(u(r,t),t),t=0)=r/3; 
bc:=u(1,t)=0; 
sol:=pdsolve([pde, ic,bc], u(r, t)) assuming t>0,c>=0;

Any idea why the assumption "c>0"  is needed when the speed is given as "c^2" ? I also tried assumption "c::real", but it still did not solve it.   It seems related to Maple using Laplace transform to solve it.

It seems to me the assumption c>0 should not needed here. But if it is, I'd like to learn why.

Maple 2018.2, windows 10

Update

Thanks to comment below

   " so u(r, 0)=1 (for all r), and u(1, t)=0 (for all t). So what is u(1,0)??? "

I should have added "r>0,r<1".  The reason I did not, is that I copied the code to solve this from Mathematica. In Mathematica, it did not need this assumption to solve it. It seems to depend on the method of solution used by Mathematica vs. Maple to cause this difference.

But now I see it helps to have it there. With the above assumption, now, there is no need to do any assumption on "c" at all and it gives solution. adding c>0 or t>0 or c>=0, makes no change now.

restart;
pde := diff(u(r, t), t$2) = c^2*( diff(u(r,t), r$2)  + (1/r)* diff(u(r,t),r)  ) ; 
ic:=u(r,0)=1, eval( diff(u(r,t),t),t=0)=r/3; 
bc:=u(1,t)=0; 
sol:=pdsolve([pde, ic,bc], u(r, t)) assuming t>0,r>0,r<1;

 

 

Hi

https://www.energymatters.com.au/solar-calculators/solar-battery-calculator.php?utm_source=NewsletterMailingList&utm_medium=email&utm_campaign=EM171101CN

I am trying to find how it calculates how much solar will be exported back to the grid. I thought this could only be estimated  empirically, but apparently not.

Anyway, it depends on three factors, power consumption, power installed, and average hours of sun per day, or hours per day as a function of time of year. For C=4.5kWh/day and S=5kW and H=4 sun hrs per day, means 90% will be exported back to the grid Y. So Y(C,S,H)= a closed form expression.

How to guess the fuction? I tried array interpolation for a numeric solution, but it complains: independent coordinates must be sorted in increasing order

law.mw

4 5 6 7 8 9 10 Last Page 6 of 1488