Maple 2021 Questions and Posts

These are Posts and Questions associated with the product, Maple 2021

how to write the code for integration of the orthogonal cosine function with nu=mu or with nu<>mu

restart;

 

phi:= (mu,Q2)->sqrt(2/l)*sin(mu*Pi*(Q2+l/2)/l);    # E:=mu->(Pi*mu/sqrt(2)/l)^2, mu=1,2...

proc (mu, Q2) options operator, arrow; sqrt(2/l)*sin(mu*Pi*(Q2+(1/2)*l)/l) end proc

(1)

fh1:=simplify((-1/2/m2*Int(diff(phi(mu,Q2),Q2)*diff(phi(nu,Q2),Q2),Q2=-l/2..l/2)))

-mu*Pi^2*nu*(Int(cos((1/2)*mu*Pi*(2*Q2+l)/l)*cos((1/2)*nu*Pi*(2*Q2+l)/l), Q2 = -(1/2)*l .. (1/2)*l))/(l^3*m2)

(2)

convert(fh1,int) assuming(mu,integer,nu,integer);

0

(3)

fh1_subs := simplify(subs(nu = mu, fh1));

-mu^2*Pi^2*(Int(cos((1/2)*mu*Pi*(2*Q2+l)/l)^2, Q2 = -(1/2)*l .. (1/2)*l))/(l^3*m2)

(4)

convert(fh1_substituted,int)assuming (mu,integer,nu,integer);

-(1/2)*mu^2*Pi^2/(l^2*m2)

(5)

 

Download test1.mw

Hi all,

I would like to use the command ConvertIn() from the Galois Field package to convert polynomials to field elements.

This is what I've done:

G:=GF(2,4)
                        G := &Fopf;[16]

b:=G:-random()
                          b := T mod 2

s:=G:-ConvertIn(T)
Error, (in ConvertIn) only integer polynomials in T can be converted

Why is this error showing up?? My argument of the command ConvertIn IS an integer polynomial in T.

How can I avoid this error?

Thanks for your help!

BR David

restart;  
with(geometry):  
with(plots):  
_EnvHorizontalName = 'x':  _EnvVerticalName = 'y':
point(A, -1, 9):                                                                                                       
point(B, -5, 0):
point(C, 6, 0):
triangle(ABC,[A,B,C]):
midpoint(M1,A,C): midpoint(M2,B,C):midpoint(M3,A,B):
rotation(J, C, Pi/2, 'counterclockwise', M1):triangle(AJC,[A,J,C]):
rotation(Ii, C, Pi/2, 'counterclockwise', M2):triangle(BIC,[B,Ii,C]):
rotation(K, A, Pi/2, 'counterclockwise', M3):triangle(AKB,[A,K,B]):
midpoint(O1,K,J): coordinates(O1):
midpoint(O2,A,Ii): coordinates(O2):  
poly:=[coordinates(A),coordinates(J),coordinates(Ii),coordinates(K)]:   

display(draw([A(color = black, symbol = solidcircle, symbolsize = 12), 
B(color = black, symbol = solidcircle, symbolsize = 12), 
C(color = black, symbol = solidcircle, symbolsize = 12), 
J(color = black, symbol = solidcircle, symbolsize = 12), 
polygonplot(poly,color = "DarkGreen", transparency = 0.5),
ABC(color = red ),
BIC(color = green),
AKB(color = grey),
AJC(color =blue)]),
textplot([[coordinates(A)[], "A"],[coordinates(J)[], "J"],[coordinates(Ii)[], "I"],   
[coordinates(B)[], "B"], [coordinates(K)[], "K"], 
[coordinates(C)[], "C"]], 
align = [above, right]),  axes = none);
Error, (in geometry:-draw) the option must be of type equation or name. I don't see how to correct this error/
 

I have some large systems of linear equations.  The solutions are probability generating functions.  I can get solutions in a few minutes for systems of up to n= 200 eqns or so, but Maple just cycles indefinitely if I try to solve much larger systems.  I really only need to perform Gaussian Elimination, as I only need to solve for one of the n solutions.  The matrices are sparse, there are only 3 non-zero entries per row.  I tried to get help from the manuals but I get the impression that sparse solutions are only available for numeric computations.   Doesn't Maple allow for sparse symbolic solutions?  If so, how to do it?

Does anyone know how to remove this boring notation? I would like to know why Maple does not give me "± 2x". Thanks in advance.

 

I am trying to define a Tensor expression in the physics package but it seems to be taking eons to do so, it has been running for quite some time but still no result to the point where I halt the computation. 

Does anyone have any ideas on how I could accelerate the process? 

I have attached the file I am working with. 

Define.mw

How can I solve Einstein’s equation and calculus of the value of the K constant in Einstein's equation and the value of the tensor stress energy that fits in this equation?

   

 

QTBend.docxSqBend.mw

what is the homology matrix that plates the ABCE square on the NPCM square
I think it may bi find out with the rotation angle, the vector of translation and the homothety ratio.
restart;  
with(geometry):  
with(plots):  
_EnvHorizontalName = 'x':  _EnvVerticalName = 'y':

point(A, 0, 1):
point(B, 1, 1):
point(C, 1, 0):
point(E, 0, 0):
square(Sq, [A, B, C, E]):
Phi := (1 + sqrt(5))/2:
point(N, (2 - Phi)/(Phi - 1), 1):
line(BE, [B, E]):
MakeSquare(s1, [N, C, 'diagonal']):
point(M, (3 - sqrt(5))/(2*sqrt(5) - 2), (3 - sqrt(5))/(2*sqrt(5) - 2)):
point(P, (1 + sqrt(5))/(2*sqrt(5) - 2), (3*sqrt(5) - 5)/(2*sqrt(5) - 2)):
T:=<simplify(coordinates(midpoint(O1,E,B))-coordinates(midpoint(O2,M,P)))>:
simplify(distance(O1,O2)):
line(MN,[M,N]):eq:=Equation(%,[x,y]):sol:=solve(eq,y):
Ang:=Pi/2-arctan(diff(sol,x)):
r:=simplify(distance(N,M)):
line(MP,[M,P]):eq:=Equation(%,[x,y]):subs(y=0,%):point(Q,solve(%,x),0):
line(PQ,[P,Q]):
homology(Sq1, Sq, C, Ang, 'clockwise', r):


display(draw([A(color = black, symbol = solidcircle, symbolsize = 12), 
B(color = black, symbol = solidcircle, symbolsize = 12), 
C(color = black, symbol = solidcircle, symbolsize = 12), 
E(color = black, symbol = solidcircle, symbolsize = 12), 
N(color = black, symbol = solidcircle, symbolsize = 12), 
Sq(color = red, filled = true, transparency = 0.9), 
BE(color = green), 
PQ(color = black),
 Sq1(color = black), 
s1(color = red, filled = true, transparency = 0.8)]), 
textplot([[coordinates(A)[], "A"], 
[coordinates(B)[], "B"], 
[coordinates(E)[], "E"], 
[coordinates(N)[], "N"], 
[coordinates(P)[], "P"], 
[coordinates(M)[], "M"], 
[coordinates(Q)[], "Q"], 
[coordinates(C)[], "C"]], 
align = [above, right]), view = [-0.6 .. 1.5, 0 .. 1], axes = none);
 

Hi,

I am struggling with a task of creating a 2D contourplot of temperature values showing Iso-Lines (lines of equal temperatures in steps of 100°C).

I have a set of temperature values with corresponding x and y coordinates of a cross section. The data is given as an unsorted set of X-Y-Temperature data:

[[177.80000,0.,967.3266667],[169.80000,0.,963.5900000],[100.00000,0.,188.8933333],[176.92000,17.703000,967.3266667],[174.27000,35.230000,967.3200000],[169.90000,52.407000,967.3566667],[163.84000,69.064000,967.3366667],[156.15000,85.034000,967.3100000],[146.91000,100.16000,967.3366667],[136.20000,114.29000,967.3666667],...]

I can plot the data as a 3D pointplot and assign colors based on the temperature value:

plots:-pointplot3d(<ThermRes(2 .. (), 2) | ThermRes(2 .. (), 3) | ThermRes(2 .. (), TimeCol)>, colorscheme = ["zgradient", ["blue", "green", "yellow", "orange", "red"]], style = point, symbol = solidsphere, symbolsize = 20)

For better visualization, I would like to plot this data in a 2D contourplot showing coloured Iso-lines in 100°C steps, similar to the following scheme:

I know this is not directly possible from xyz datapoints. Therefore, I was trying to create an interpolation function using the Interpolation package. I have tried to find out if it is possible to get a working interpolation function for my data, but it seems like the x and y coordinates must be always in increasing order and there has to be a z value (temperature data point) for each pair of coordinates in matrix form, is that correct? Unfortunately, as you can see above, my x-y coordinate pairs are irregular and unsorted and I do not have a temperature value for every combination of x and y coordinate values.

Is there any way how to find an interpolation function for this kind of data that would enable a contourplot? Or any other ideas how to create a coloured 2D plot from this data with a legend showing the 100°C temperature color values?

Greetings, Oliver

Could you help me how to deal with this problem?

restart;

with(plots):with(plottools):with(DETools):

 

Sys:=diff(T(R),R)=((1-1/R)*(sqrt(1-(alpha/R)^2*(1-1/R))))^(-1),diff(Phi(R),R)=(alpha/R)^2*(sqrt(1-(alpha/R)^2*(1-1/R)))^(-1);

diff(T(R), R) = 1/((1-1/R)*(1-alpha^2*(1-1/R)/R^2)^(1/2)), diff(Phi(R), R) = alpha^2/(R^2*(1-alpha^2*(1-1/R)/R^2)^(1/2))

(1)

 

inits:=[[T(0)=0.5,Phi(0)=0],[T(0)=0.5,Phi(0)=Pi/4]];

[[T(0) = .5, Phi(0) = 0], [T(0) = .5, Phi(0) = (1/4)*Pi]]

(2)

K:=dsolve([Sys,op(op(1,inits))],[Phi(R),T(R)],numeric,parameters=[alpha],output=listprocedure);

Error, (in dsolve/numeric/make_proc) ode system is singular at the initial point

 

 

Download HW6.m

Hi

I get the following error: "Error, (in dsolve) invalid input: 'PDEtols/sdsolve' expects its 1st argument, SYS, to be of type OR(set(..."

I don't know what's wrong. My equations look like a set to me.

My equations:

{0 = -F__Ay - F__By, 0 = 25*F__Oy + 25*F__Ay - 25*F__By, diff(theta__1(t), t)*t - theta__1(t) = 0, -x__1(t) + 25*cos(theta__1(t)) = 0, -y__1(t) + 25*sin(theta__1(t)) = 0, (2500*cos(theta__1(t))*diff(theta__1(t), t)*pi)/3 - 50*cos(theta__1(t))*diff(theta__2(t), t)*theta__2(t) = F__Ax + F__Ox + F__Bx, (2500*cos(theta__1(t))*diff(theta__1(t), t)*pi)/3 - 50*cos(theta__1(t))*diff(theta__2(t), t)*theta__2(t) = F__Ay + F__Oy + F__By, diff(theta__2(t), t)*t - Pi/4 - theta__2(t) = 0, x__1(t) + 25*cos(theta__1(t)) - x__2(t) - 50*cos(theta__2(t)) = 0, y__1(t) + 25*sin(theta__1(t)) - y__2(t) - 50*sin(theta__2(t)) = 0, (1250*cos(theta__1(t))*diff(theta__1(t), t)*pi)/3 = -F__Ax - F__Bx, (1250*cos(theta__1(t))*diff(theta__1(t), t)*pi)/3 = -50*F__Ay + 50*F__By}

My solve:

dsolve({eqs[1] = 0, eqs[2] = 0, eqs[3] = 0, eqs[4] = 0, eqs[5] = 0, eqs[6] = 0, eqs_Mq[1] = eqs_g[3], eqs_Mq[1] = eqs_g[6], eqs_Mq[2] = eqs_g[1], eqs_Mq[2] = eqs_g[2], eqs_Mq[3] = eqs_g[4], eqs_Mq[3] = eqs_g[5]}, numeric)

Anyone can tell me what I'm doing wrong?

clutch.mw

Could you help me to solve this problem for the parameter beta?

restart;

e1:= 0.5; e2:=0.2;theta:=5;yeq:=e2;

.5

 

.2

 

5

 

.2

(1)

f:=(theta*x-1)*(1-x)*(1+beta*x^2)-y;
g:=x/(1+beta*x^2); gs:=unapply(g,x);

(5*x-1)*(1-x)*(beta*x^2+1)-y

 

x/(beta*x^2+1)

 

proc (x) options operator, arrow; x/(beta*x^2+1) end proc

(2)

fs:=subs(y=yeq,f);

(5*x-1)*(1-x)*(beta*x^2+1)-.2

(3)

assumptions:=x>1/theta, x<1,beta>0,beta<1,gs(x)>e1;
solve(fs=0,x,useassumptions) assuming assumptions;

1/5 < x, x < 1, 0 < beta, beta < 1, .5 < x/(beta*x^2+1)

 

Warning, solve may not respect assumed property 'real' on 'x/(beta*x^2+1)'.

 

Error, (in type/realcons) too many levels of recursion

 

gs2:=subs(beta=0.6,gs(x));

x/(.6*x^2+1)

(4)

sol:= solve(subs(beta=0.6,fs=0),x,useassumptions) assuming x>1/theta, x<1;

.2514854589, .9665623271

(5)

subs(x=sol[1],gs2);

.2422912423

(6)

 

Download Rootsfind.mw

S1 := 441;
S2 := 1109;
S3 := 511;
S4 := 900;
S5 := 2904;
S6 := 285;

S2 + S3 + S4 + S5 + S6;                             
for i to 5 do
    S*[i] + S[i + 1];
end do;
Thank you.

I am trying to create a loop in the Physics package where I am interested in looking at the components of a tensor with one index up and one down. However, when I run the loop it returns the expression with both indices down in my attempts to solve the issue.

I have been fighting with it for an hour now and cant seem to find a fix. Any help will be appreciated, I have attached the file I am working with. 

Thanks in advance. 

LoopQuestion.mw

Why did the last line is(ysol2[1]>0) give false?

Maple does not recognize the assumption?

Thanks in advance.
 

restart;

 

 

interface(showassumed=0);

0

(1)

assume(theta>1,alpha>0,sigma1>0,beta>0,sigma2>0,delta>0,x>0,y>0,z>0);

 

f:=((theta*x-1)*(1-x)-y);
g:=y/(1+beta*y^2);
h:=(alpha*x-sigma1)*(1+beta*y^2);
j:=(delta*g-sigma2);
dxdt:=x*f;
dydt:=g*(h-z);
dzdt:=z*j;

(theta*x-1)*(1-x)-y

 

y/(beta*y^2+1)

 

(alpha*x-sigma1)*(beta*y^2+1)

 

delta*y/(beta*y^2+1)-sigma2

 

x*((theta*x-1)*(1-x)-y)

 

y*((alpha*x-sigma1)*(beta*y^2+1)-z)/(beta*y^2+1)

 

z*(delta*y/(beta*y^2+1)-sigma2)

(2)

case0; x = 0, y = 0, z = 0

E0:=<0,0,0>;

Vector[column](%id = 36893490685786064044)

(3)

"case1: z=0 ,  h(x,y)=0,  f(x,y)=0 :   From y=(theta*x-1)*(1-x)=y -> 1/(theta)<x and x<1"

xsol1:=solve(h=0,x) assuming x>1/theta and x<1;
ysol1:=solve(subs(x=xsol1,f)=0,y)assuming xsol1>1/theta and xsol1<1;
E1:=<xsol1,ysol1,0>;

xsol1 := sigma1/alpha

 

ysol1 := -(-sigma1*theta+alpha)*(alpha-sigma1)/alpha^2

 

Vector[column](%id = 36893490685786055012)

(4)

case2; g(y) = 0, h(x, y) = 0

ysol:=[solve(j=0,y)];
ysol2:=simplify(subs(sigma2=delta*eta,ysol)) assuming (1-4*beta*eta^2>0 and eta>0);

Warning, solve may be ignoring assumptions on the input variables.

 

[(1/2)*(delta+(-4*beta*sigma2^2+delta^2)^(1/2))/(beta*sigma2), -(1/2)*(-delta+(-4*beta*sigma2^2+delta^2)^(1/2))/(beta*sigma2)]

 

[(1/2)*(1+(-4*beta*eta^2+1)^(1/2))/(beta*eta), (1/2)*(1-(-4*beta*eta^2+1)^(1/2))/(beta*eta)]

(5)

is(ysol2[1]>0)

false

(6)

 

(1/2)*(1+(-4*beta*eta^2+1)^(1/2))/(beta*eta)

(7)

 

 


 

Download Project_v1.mw

2 3 4 5 6 7 8 Last Page 4 of 36