MaplePrimes Questions

Hi everyone:

I watn to create expressions like below expressions in "printf" command:

%15s

%15s%15s

%15s%15s%15s

%15s%15s%15s%15s

...........................................

Can I write these form expressions with "for' command for i=1..n or "seq" command? infact I need those in print command so that I do not type manually. 

 

i did a solution of this ODE equation but the solution of paper is different from mine also in other some equation i have same problem i can't get exactly and pretty solution

how  define a function for computing multi-variable adomian polynomial  what is wrong with this? what i did mistake

Dear all

I have a function like 

F[1] := (x, y) -> x*y/(1 + 10.35841093*(1 - x)*((-1)*0.9*x + 1)*(1 - y)*((-1)*0.9*y + 1))

This function is continuous on D = [0,1]x[0,1]. I'm interested in the (approximate) value of the double integral over D.

Unfortunately the entry

int(int(F[1](x,y),x=0..1.),y=0..1.)

produces Float(infinity). 

Thanks Nicola

Dear Maple users Help me to  get the desire graph for this codes. 

restart:
with(plots):
with(IntegrationTools):
h:=z->piecewise( z<=d+1,   1,
                 z<=d+4,   1-(delta/(2))(1 + cos(2(Pi)*(z - 1 - 1/2))),                                                           z<=d+6,   1 ):
w0:=(-c*h(z)^2/4)+(3/64)(b*c-4*a)*h(z)^4+(19/2304)*b(b-4*a)*h(z)^6:
w1:=(c/4)+(1/16)*(4*a-b*c)*h(z)^2:
w2:=(1/256)(4(b*c-4*a)-b*h(z)^2):
w3:=(1/2304)b(b-4*a):
a:=(x4*S*Gr)*sin(alpha)/(4*x1*x5):
b:=(1/Da)+(x3*M/(x1*(1+m^2))):
c:=(1/x1)*Dp:
Dp:=96*x1/((6-b*h(z)^2)h(z)^4)(F+(a*h(z)/24)-((11/6144)b(b-4*a)*h(z)^8)):
x1:=1/((1-phi1)^2.5*(1-phi2)^2.5):
x2:=(1-phi2)((1-phi1)+phi1*Rs1/Rf)+phi2(Rs2/Rf):
x3:=(shnf)/(sf):
x4:=(1-phi2)((1-phi1)+phi1(RBs1)/(RBf))+phi2*((RBs2)/(RBf)):
x5:=khnf/kf:
shnf:=sbf*((ss2+2*sbf-2*phi2*(sbf-ss2))/(ss2+2*sbf+phi2*(sbf-ss2))):
sbf:=sf*((ss1+2*sf-2*phi1*(sf-ss1))/(ss1+2*sf+phi1*(sf-ss1))):
khnf:=kbf*((ks2+2*kbf-2*phi2*(kbf-ks2))/(ks2+2*kbf+phi2*(kbf-ks2))):
kbf:=kf*((ks1+2*kf-2*phi1*(kf-ks1))/(ks1+2*kf+phi1*(kf-ks1))):
RBs1:=(8933*16.7*10^6):
RBf:=(1063*1.8*10^6):
RBs2:=6320*18*10^6:
kf:=0.492:
sbf:=6.67*10^(-1): ss2:=2.7*10^(-8):
sf:=6.67*10^(-1):ss1:=59.6*10^(6):
ks2:=76.5:kf:=0.492: ks1:=401:
phi1:=0.01: phi2:=0.02:alpha:=Pi/4:m:=0.5:Da:=0.1:Gr:=5:delta:=1:S:=0.5:  d:=1:
                                      
W1:=w0+w1*r^2+w2*r^4+w3*r^6:

by varing M =2,5,7 and r varies from 0 to 1 i want this type of graphs.  please see the sample graphs

 

I am wondering if Maple DETools package has functions or command to deal with the following problem: algebraic invariant curve. Some first order ODE preserves such type of curve as their solutions. For example, the following ODE has an algebraic curve y(x)=0 as its particular solutions:

> odetest(y(x)=0, y'(x)=y(x)^3-2*x*y(x)^2,y(x));

> 0

The ODE in general does not have algebraic solutions. The solutions are computed in terms of special functions. In some cases the algebraic curve could have multi-variate forms . I am wondering about one question: Does Maple have tools to find solutions of algebraic curve for ODE, without knowing the information of general solutions? I have already tried PDETools:-casesplit, but it seems to classify such curves to the same case to the general solution. 

I will be glad if anyone could give me some advice.

Why Maple return 0 when I try to find coefficients of different power of lambda's.coeff.mw

Hello,

I need to check if Maple can solve a specific PDE. Since I don't know much about the PDEtools package, I wonder if a user familiar with it and experienced in solving PDEs could help me.

with(PDEtools);
declare(u(x,y,z,w));
PDE1:=alpha*(y+b*(w))*diff(u(x,y,z,w),x)+(x+z-b*(w))*diff(u(x,y,z,w),y)-c*y*diff(u(x,y,z,w),z)+d*(y-x)*diff(u(x,y,z,w),w)=0;
Sol1:=pdsolve(PDE1);

Maple returns NULL as the solution. Any ideas on how to obtain a solution, if possible? In other similar PDEs, u(x,y,w,z) has a quadratic form.

Many thanks,

When you look at negative horiztonal values on a basic plot, the axis labels can be obscured by gridlines or the plot itself. I have been told many times to keep axis labels and gradation labels outside of the plotting area to avoid adding more information than is neccessary in the actual plotting area. Is there a way to move the label to the other side and rotate it by 180 degree? How do people normally deal with this issue?

See my example of how the axis labels can be obscured by gridlines.

axis_label_on_wrong_side_of_axis.mw

Hi all guys, first I would express my gratitude to @mmcdara . He helped me construct the matrix polynomial properly. Then on basis of it, I explore more but meet with issues. Notation : v1 and v2 is eigenvalues which consists of complicated expression containg component v and z, now I wanna implicitplot the region: abs(v1)<=1 & abs(v2)<=1 (satisfy at the same time). But I don't know how to command the code. So I define eq1:=( abs(v1)-1)* (abs(v2)<=1) and implicit it. (I know it is false but I just wanna try first). But I command the implicitplot code, the evaluating time is so long(25mins no end still). So I recall the smartplot, I once I have triggered this command, it seems that I put the mouse on the expression result (the end of the blue font), and implicit3d appears in the work bar on the right (of course this is in another file). In the file I uploaded, I tried this but failed. So I want to understand how to ensure that smartplot is triggered 100%? (Because I feel that smartplot runs very fast) and how to draw the desired region (abs(v1)<=1 & abs(v2)<=1)?

restart;
v=lambda*h;
z=mu*h;
k=lambda/mu;

v = lambda*h

 

z = mu*h

 

k = lambda/mu

(1)

with(LinearAlgebra):

A := Matrix([[0, 0, 0], [-(cos(alpha*v)-1)/v^2, 0, 0], [0, -(cos(beta*v)-1)/(cos(alpha*v)*v^2), 0]]);

Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (2, 1) = -(cos(alpha*v)-1)/v^2, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = -(cos(beta*v)-1)/(cos(alpha*v)*v^2), (3, 3) = 0})

(2)

C := Matrix([0, alpha, -beta])

Vector[row](3, {(1) = 0, (2) = alpha, (3) = -beta})

(3)

e := Vector(3, 1)

Vector(3, {(1) = 1, (2) = 1, (3) = 1})

(4)

E := IdentityMatrix(3)

Matrix(3, 3, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1})

(5)

G := Matrix([[0], [sin(alpha*v)/(alpha*v)], [((sin(beta*v)*cos(alpha*v)+sin(alpha*v)*cos(beta*v)-sin(alpha*v)))/(v*cos(alpha*v)*(beta))]])

Vector(3, {(1) = 0, (2) = sin(alpha*v)/(alpha*v), (3) = (sin(beta*v)*cos(alpha*v)+sin(alpha*v)*cos(beta*v)-sin(alpha*v))/(v*cos(alpha*v)*beta)})

(6)

b := Vector(3, [1/24, (-sin(beta*v)*v^3+12*cos(beta*v)*v^2+24*cos(beta*v)*cos(v)-24*sin(beta*v)*sin(v)+24*sin(beta*v)*v-24*cos(beta*v))/(24*v^3*(cos(beta*v)*sin(alpha*v)+sin(beta*v)*cos(alpha*v))), -(sin(alpha*v)*v^3+12*cos(alpha*v)*v^2+24*cos(v)*cos(alpha*v)+24*sin(v)*sin(alpha*v)-24*v*sin(alpha*v)-24*cos(alpha*v))/(24*v^3*(cos(beta*v)*sin(alpha*v)+sin(beta*v)*cos(alpha*v)))])

Vector(3, {(1) = 1/24, (2) = (1/24)*(-sin(beta*v)*v^3+12*cos(beta*v)*v^2+24*cos(beta*v)*cos(v)-24*sin(beta*v)*sin(v)+24*sin(beta*v)*v-24*cos(beta*v))/(v^3*(sin(beta*v)*cos(alpha*v)+sin(alpha*v)*cos(beta*v))), (3) = -(1/24)*(sin(alpha*v)*v^3+12*cos(alpha*v)*v^2+24*cos(v)*cos(alpha*v)+24*sin(v)*sin(alpha*v)-24*v*sin(alpha*v)-24*cos(alpha*v))/(v^3*(sin(beta*v)*cos(alpha*v)+sin(alpha*v)*cos(beta*v)))})

(7)

bp := Vector(3, [1/12, -(sin(beta*v)*v^2+12*cos(beta*v)*sin(v)-12*cos(beta*v)*v+12*cos(v)*sin(beta*v)-12*sin(beta*v))/(12*v^2*(cos(beta*v)*sin(alpha*v)+sin(beta*v)*cos(alpha*v))), -(sin(alpha*v)*v^2+12*cos(v)*sin(alpha*v)-12*cos(alpha*v)*sin(v)+12*cos(alpha*v)*v-12*sin(alpha*v))/(12*v^2*(cos(beta*v)*sin(alpha*v)+sin(beta*v)*cos(alpha*v)))])

Vector(3, {(1) = 1/12, (2) = -(1/12)*(sin(beta*v)*v^2+12*cos(beta*v)*sin(v)-12*cos(beta*v)*v+12*cos(v)*sin(beta*v)-12*sin(beta*v))/(v^2*(sin(alpha*v)*cos(beta*v)+sin(beta*v)*cos(alpha*v))), (3) = -(1/12)*(sin(alpha*v)*v^2+12*cos(v)*sin(alpha*v)-12*cos(alpha*v)*sin(v)+12*cos(alpha*v)*v-12*sin(alpha*v))/(v^2*(sin(alpha*v)*cos(beta*v)+sin(beta*v)*cos(alpha*v)))})

(8)

L0 := E + z^2 *~ A

Matrix(3, 3, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (2, 1) = -z^2*(cos(alpha*v)-1)/v^2, (2, 2) = 1, (2, 3) = 0, (3, 1) = 0, (3, 2) = -z^2*(cos(beta*v)-1)/(cos(alpha*v)*v^2), (3, 3) = 1})

(9)

L1 := simplify(L0^(-1))

Matrix(3, 3, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (2, 1) = z^2*(cos(alpha*v)-1)/v^2, (2, 2) = 1, (2, 3) = 0, (3, 1) = z^4*(cos(beta*v)-1)*(1-sec(alpha*v))/v^4, (3, 2) = z^2*(cos(beta*v)-1)*sec(alpha*v)/v^2, (3, 3) = 1})

(10)

AUX := simplify(L1 . G . C . e, size)

Vector(3, {(1) = 0, (2) = sin(alpha*v)*(alpha-beta)/(alpha*v), (3) = -((z^2*beta*sec(alpha*v)*(cos(beta*v)-1)*sin(alpha*v)+v^2*alpha*sin(beta*v))*cos(alpha*v)+sin(alpha*v)*alpha*v^2*(cos(beta*v)-1))*(-alpha+beta)/(v^3*alpha*cos(alpha*v)*beta)})

(11)

N1 := simplify((1 - z^2/2) + z^4 * (b^+ . AUX), size)

(1/24)*(z^4*(cos(beta*v)-1)*(v^3-24*v+24*sin(v))*(-alpha+beta)*(sec(alpha*v)*z^2*beta*cos(alpha*v)+v^2*alpha)*sin(alpha*v)^2-12*(-sec(alpha*v)*z^6*beta*(cos(beta*v)-1)*(v^2+2*cos(v)-2)*(-alpha+beta)*cos(alpha*v)+((2*z^4*(-alpha+beta)^2*cos(v)+(-alpha+beta)^2*(v^2-2)*z^4+v^4*z^2*beta*alpha-2*v^4*beta*alpha)*cos(beta*v)-(1/12)*(-alpha+beta)*z^4*((v^3-24*v+24*sin(v))*(beta+alpha)*sin(beta*v)-12*alpha*(v^2+2*cos(v)-2)))*v^2)*cos(alpha*v)*sin(alpha*v)-12*sin(beta*v)*(-2*(-alpha+beta)*z^4*cos(v)-(v^2-2)*(-alpha+beta)*z^4+v^4*z^2*beta-2*v^4*beta)*v^2*alpha*cos(alpha*v)^2)/(v^6*(sin(alpha*v)*cos(beta*v)+sin(beta*v)*cos(alpha*v))*alpha*cos(alpha*v)*beta)

(12)

N2 := simplify(1 - z^2 * (b^+ . L1 . e), size)

(1/24)*((12*z^4*(v-z)*(v+z)*(v^2+2*cos(v)-2)*(sec(alpha*v)-1)*cos(beta*v)-12*z^4*(v-z)*(v+z)*(v^2+2*cos(v)-2)*sec(alpha*v)-(-24*z^4*sin(v)+(-v^3+24*v)*z^4+v^5*z^2-24*v^5)*v^2*sin(beta*v)+12*z^2*(v-z)*(v+z)*(v^2+z^2)*(v^2+2*cos(v)-2))*cos(alpha*v)+(sin(alpha*v)*z^4*(v-z)*(v+z)*(v^3-24*v+24*sin(v))*sec(alpha*v)+(24*z^6*sin(v)+(v^3-24*v)*z^6-v^7*z^2+24*v^7)*sin(alpha*v)-12*v^2*z^2*(v-z)*(v+z)*(v^2+2*cos(v)-2))*cos(beta*v)+(v^3-24*v+24*sin(v))*(-sin(alpha*v)*z^2*sec(alpha*v)+(v^2+z^2)*sin(alpha*v)+sin(beta*v)*v^2)*z^2*(v+z)*(v-z))/(v^7*(sin(alpha*v)*cos(beta*v)+sin(beta*v)*cos(alpha*v)))

(13)

N3 := simplify(-z^2 + z^4 * (bp^+ . AUX), size)

-(-(1/12)*z^2*(cos(beta*v)-1)*(v^2+12*cos(v)-12)*(-alpha+beta)*(sec(alpha*v)*z^2*beta*cos(alpha*v)+v^2*alpha)*sin(alpha*v)^2+(-sec(alpha*v)*z^4*beta*(cos(beta*v)-1)*(-alpha+beta)*(v-sin(v))*cos(alpha*v)+((-z^2*(-alpha+beta)^2*sin(v)+(z^2*(-alpha+beta)^2+v^2*beta*alpha)*v)*cos(beta*v)-(1/12)*(-alpha+beta)*z^2*((v^2+12*cos(v)-12)*(beta+alpha)*sin(beta*v)-12*alpha*(v-sin(v))))*v^2)*cos(alpha*v)*sin(alpha*v)+sin(beta*v)*((-alpha+beta)*z^2*sin(v)+v*((alpha-beta)*z^2+v^2*beta))*v^2*alpha*cos(alpha*v)^2)*z^2/(v^5*(sin(alpha*v)*cos(beta*v)+sin(beta*v)*cos(alpha*v))*alpha*cos(alpha*v)*beta)

(14)

NULL

N4 := simplify(1 - z^2 * (bp^+ . L1 . e), size):
alpha:= 1/2 + 1/10*sqrt(5);
beta:= -1/2 + 1/10*sqrt(5);
det := simplify(N1*N4 - N2*N3, size):
tr := simplify(N1 + N4, size):
#eq1:=algsubs(v=lambda*h,det):
#eq2:=algsubs(z=mu*h,eq1):
#eq3:=algsubs(lambda=mu*k,eq2):
#eq4:=algsubs(v=lambda*h,eq3):
#csgn(sqrt(mu^10*k^10/v^10)*h^5):=1:
#simplify(series(sqrt(eq4),h,10));
#series(simplify(algsubs(v=,simplify(series(1-sqrt(det),z,8)))),z,8);
#eq1:=(sec(sqrt(5)*z/10)*(-cos(z/2)*z + 12*sin(z/2)) - 5*z)/(24*z*k);
#simplify(eq1);

1/2+(1/10)*5^(1/2)

 

-1/2+(1/10)*5^(1/2)

(15)

lambda1 := (tr-sqrt(tr^2-4*det))*(1/2); lambda2 := (tr+sqrt(tr^2-4*det))*(1/2)

with(plots); with(plots, implicitplot)

eq11 := lambda1*lambda2-abs(lambda1)-abs(lambda2)+1 <= 0

Download 2d_implicit_plot_[v_z].mw

How to get remainder of this two polynomials?

with(Algebraic);
Remainder(a*x^3 + b*x^2 + c*x + d, 3*a*x^2 + 2*b*x + c, x);

I am trying to improve the positioning of the gammas in the diagram (at bottom) as they are too close to the points and lines. gamma1 and gamma2 have been assigned values. This best I could come up with is shown below.

restart;

with(plots):with(plottools):

with(Typesetting):

`gamma2`:=<3|5|2>

Vector[row](3, {(1) = 3, (2) = 5, (3) = 2})

(1)

Pgamma2:=[3/2,5/2]

[3/2, 5/2]

(2)

display(point(Pbeta2,symbol=solidcircle,symbolsize=14),textplot([Pgamma2[],Typeset((`gamma2` )),align={above}]))

 

 

 

Download 2024-07-10_Typeset_gamma.mw

Hello

I am trying to solve some PDEs using Maple.  In one of them, Maple returns

SolL:= HL(x, y, z) = f__1(1/2*(2*sigma*z - x^2)/sigma, rho^2 - 2*rho*z + y^2 + z^2)

How to retrieve only the arguments of f__1?  

Many thanks

I think the question speaks for itself. I tried the search engine and he bring me one link on that subject. But when I click on it, he sent me inside many answers on everyting but that. Not even the right month. So that is why I am asking here again. Of course, I would like to keep the thickmarks and the labels on both axes. Thank you in advance for your help.

The change from _C1 to c__1 is causing me so many problems as I still do not fully understand it.

I have nothing in my Maple ini file. 

I was solving from a solution to an ode for the constant of integration, which I know is c__1 inside a proc.

But this was failing to solve for it. When I copy same code to global (worksheet), it works. So it is clearly issue of name space related to c__1 vs. _C1. 

So even though the solution now has the subscripted version and not the traditional one (since that is the default now), it does not solve for it when inside a proc.

If instead I solve for _C1, then it works. Even though the solution has c__1. This is bizzar to me. 

I also tried adding   global c__1; inside the proc, but this did not help. (did not show this version in the worksheet).

Why is solving for c__1 fail inside a proc but works outside? Clearly the c__1 in the solution of the ode is not the same c__1 I typed in to solve for, even though on the screen they look the same. 

So c__1 is not really the same as _C1 in all aspects. Right?

Here is worksheet. Example 1 below shows how it fails inside proc

Maple 2024.1. Does this happen for others on Linux or the Mac?
 

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 10, June 25 2024 Build ID 1835466`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1767 and is the same as the version installed in this computer, created 2024, June 28, 12:19 hours Pacific Time.`

Example (1) solving for constant of integration fails inside proc but works outside

 

restart;

foo:=proc(ode::`=`)
local sol,the_constant;
   sol:=dsolve(ode);
   print("sol is ",sol);
   the_constant:=solve(sol,c__1);
   print("the constant is ",the_constant);
end proc;

proc (ode::`=`) local sol, the_constant; sol := dsolve(ode); print("sol is ", sol); the_constant := solve(sol, c__1); print("the constant is ", the_constant) end proc

#this does not work
ode:=diff(y(x),x) = 3/4*y(x)/x;
foo(ode)

diff(y(x), x) = (3/4)*y(x)/x

"sol is ", y(x) = c__1*x^(3/4)

"the constant is "

restart;

#this works
ode:=diff(y(x),x) = 3/4*y(x)/x;
sol:=dsolve(ode);
print("sol is ",sol);
the_constant:=solve(sol,c__1);

diff(y(x), x) = (3/4)*y(x)/x

y(x) = c__1*x^(3/4)

"sol is ", y(x) = c__1*x^(3/4)

y(x)/x^(3/4)

 

Example (2). Solving for _C1 works, even though the ode has c__1  , why??

 

restart;

foo:=proc(ode::`=`)
local sol,the_constant;
   sol:=dsolve(ode);
   print("sol is ",sol);
   the_constant:=solve(sol,_C1);  #notice solving for _C1 now
   print("the constant is ",the_constant);
end proc;

proc (ode::`=`) local sol, the_constant; sol := dsolve(ode); print("sol is ", sol); the_constant := solve(sol, _C1); print("the constant is ", the_constant) end proc

ode:=diff(y(x),x) = 3/4*y(x)/x;
foo(ode)

diff(y(x), x) = (3/4)*y(x)/x

"sol is ", y(x) = c__1*x^(3/4)

"the constant is ", y(x)/x^(3/4)

restart;

ode:=diff(y(x),x) = 3/4*y(x)/x;
sol:=dsolve(ode);
print("sol is ",sol);
the_constant:=solve(sol,c__1); #these both work OK in global
the_constant:=solve(sol,_C1);  #these both work OK in global

diff(y(x), x) = (3/4)*y(x)/x

y(x) = c__1*x^(3/4)

"sol is ", y(x) = c__1*x^(3/4)

y(x)/x^(3/4)

y(x)/x^(3/4)

 

 

Example (3). Forcing arbitraryconstants = subscripted it still does not work inside proc. Why??

 

restart;

foo:=proc(ode::`=`)
local sol,the_constant;
   sol:=dsolve(ode,arbitraryconstants = subscripted);   
   print("sol is ",sol);
   the_constant:=solve(sol,c__1);
   print("the constant is ",the_constant);
end proc;

proc (ode::`=`) local sol, the_constant; sol := dsolve(ode, arbitraryconstants = subscripted); print("sol is ", sol); the_constant := solve(sol, c__1); print("the constant is ", the_constant) end proc

ode:=diff(y(x),x) = 3/4*y(x)/x;
foo(ode)

diff(y(x), x) = (3/4)*y(x)/x

"sol is ", y(x) = c__1*x^(3/4)

"the constant is "

 


 

Download constant_of_integration_solving_july_9_2024_maple_2024.mw

 

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