Education

Teaching and learning about math, Maple and MapleSim

I am very pleased to announce that we have released a new version of the free Maple Companion app. For those you may have missed it, the first release of this app gave you a way to take a picture of math using your phone’s camera and upload it into Maple. Instructors have told me they’ve found this very useful in their classes, as they no longer have to deal with transcription errors as students enter problems into Maple.

So that’s good. But version 2 is a lot better. The Maple Companion now solves math problems directly on your phone. It can handle problems from algebra, precalculus, calculus, linear algebra, differential equations, and more. No need to upload to Maple – students can solve the problem by hand, and then use the app to check their answer, try new operations on the same expression, and even create plots. And if they want to do even more, they can still upload the expression into Maple for more advanced operations and explorations.

There’s also a built-in math editor, so you can enter problems without the camera, too. And if you use the camera, and it misinterprets part of your expression, you can fix it using the editor instead of having to retake the picture.  Good as the math recognition is, even in the face of some pretty poor handwriting, the ability to tweak the results has proven to be extremely useful.

There’s lots more we’d like to do with the Maple Companion app over time, and we’d like hear your thoughts, as well. How else can it help students learn?  How else can it act as a complement to Maple? Let us know!

Visit Maple Companion to learn more, find links to the app stores so you can download the app, and access the feedback form. And if you already have version 1, you can get the new release simply by updating the app on your phone.

 

In order to estimate parameters of permanent magnet synchronous motor (PMSM) on-line and real-time, an adaptive on-line identification method for motor parameters is proposed. Resistance, inductance and PM flux of PMSM are achieved at the same time in the presented model. By means of Popov’s hyper-stability theory, the model of parameter identification is built in the rotor reference frame. And, PMSM d, q-axis voltage, current and their errors are used to obtain the adaptive laws of parameters. Popov’s hyper-stability theory guarantees stability of the system and convergence of the estimated parameters under certain conditions. The simulation and experimental results illustrate the validity and efficiency of the proposed method.


 

restart: with(LinearAlgebra):

# Motion equation (  Vibration of a cracked composite beam using general solution)  Edited by Adjal Yassine #

####################################################################

Motion equation of flexural  vibration in normalized form 

EI*W^(iv)-m*omega^2*W=0;

EI*W^iv-m*omega^2*W = 0

(1)

 

The general solution form of bending vibration equation

W1:=A[1]*cosh(mu*x)+A[2]*sinh(mu*x)+A[3]*cos(mu*x)+A[4]*sin(mu*x);

A[1]*cosh(mu*x)+A[2]*sinh(mu*x)+A[3]*cos(mu*x)+A[4]*sin(mu*x)

(2)

where

E:=2682e6;L:=0.18;h:=0.004;b:=0.02;rho:=2600;area=b*h;m:=rho*h*b;II:=(h*b^3)/12:

0.2682e10

 

.18

 

0.4e-2

 

0.2e-1

 

2600

 

area = 0.8e-4

 

.20800

(3)

mu:=((m*omega^2*L^4/EI)^(1/4)):

 

 Expression of cross-sectional rotation , the bending moment shear  force and torsional moment  are given as follows respectively

theta1 := (1/L)*(A[1]*mu*sinh(mu*x)+A[2]*mu*cosh(mu*x)-A[3]*mu*sin(mu*x)+A[4]*mu*cos(mu*x));

(A[1]*mu*sinh(mu*x)+A[2]*mu*cosh(mu*x)-A[3]*mu*sin(mu*x)+A[4]*mu*cos(mu*x))/L

(4)

M1:= (EI/L^2)*(A[1]*mu^2*cosh(mu*x)+A[2]*mu^2*sinh(mu*x)-A[3]*mu^2*cos(mu*x)-A[4]*mu^2*sin(mu*x));

EI*(A[1]*mu^2*cosh(mu*x)+A[2]*mu^2*sinh(mu*x)-A[3]*mu^2*cos(mu*x)-A[4]*mu^2*sin(mu*x))/L^2

(5)

S1:= (-EI/L^3)*(A[1]*mu^3*sinh(mu*x)+A[2]*mu^3*cosh(mu*x)+A[3]*mu^3*sin(mu*x)-A[4]*mu^3*cos(mu*x));

-EI*(A[1]*mu^3*sinh(mu*x)+A[2]*mu^3*cosh(mu*x)+A[3]*mu^3*sin(mu*x)-A[4]*mu^3*cos(mu*x))/L^3

(6)

 

W2:=A[5]*cosh(mu*x)+A[6]*sinh(mu*x)+A[7]*cos(mu*x)+A[8]*sin(mu*x);

A[5]*cosh(mu*x)+A[6]*sinh(mu*x)+A[7]*cos(mu*x)+A[8]*sin(mu*x)

(7)

 

theta2:= (1/L)*(A[5]*mu*sinh(mu*x)+A[6]*mu*cosh(mu*x)-A[7]*mu*sin(mu*x)+A[8]*mu*cos(mu*x));

(A[5]*mu*sinh(mu*x)+A[6]*mu*cosh(mu*x)-A[7]*mu*sin(mu*x)+A[8]*mu*cos(mu*x))/L

(8)

M2:= (EI/L^2)*(A[5]*mu^2*cosh(mu*x)+A[6]*mu^2*sinh(mu*x)-A[7]*mu^2*cos(mu*x)-A[8]*mu^2*sin(mu*x));

EI*(A[5]*mu^2*cosh(mu*x)+A[6]*mu^2*sinh(mu*x)-A[7]*mu^2*cos(mu*x)-A[8]*mu^2*sin(mu*x))/L^2

(9)

S2:= -(EI/L^3)*(A[5]*mu^3*sinh(mu*x)+A[6]*mu^3*cosh(mu*x)+A[7]*mu^3*sin(mu*x)-A[8]*mu^3*cos(mu*x));

-EI*(A[5]*mu^3*sinh(mu*x)+A[6]*mu^3*cosh(mu*x)+A[7]*mu^3*sin(mu*x)-A[8]*mu^3*cos(mu*x))/L^3

(10)

 

The boundary conditions at fixed end W1(0)=Theta(0)=0

X1:=eval(subs(x=0,W1));

A[1]+A[3]

(11)

X2:=eval(subs(x=0,theta1));

(mu*A[2]+mu*A[4])/L

(12)

X2:=collect(X2,mu)*(L/mu);

A[2]+A[4]

(13)

 

The boundary condtions at free end M2(1)=S2(1)=0

X3:=eval(subs(x=1,M2));

EI*(A[5]*mu^2*cosh(mu)+A[6]*mu^2*sinh(mu)-A[7]*mu^2*cos(mu)-A[8]*mu^2*sin(mu))/L^2

(14)

X3:=collect(X3,mu)*(L^2/mu^2/EI);

cosh(mu)*A[5]+sinh(mu)*A[6]-cos(mu)*A[7]-sin(mu)*A[8]

(15)

X4:=eval(subs(x=1,S2));

-EI*(A[5]*mu^3*sinh(mu)+A[6]*mu^3*cosh(mu)+A[7]*mu^3*sin(mu)-A[8]*mu^3*cos(mu))/L^3

(16)

X4:=collect(X4,mu);

-EI*(cosh(mu)*A[6]+sinh(mu)*A[5]-cos(mu)*A[8]+sin(mu)*A[7])*mu^3/L^3

(17)

X4:=collect(X4,EI)*(L^3/mu^3/EI);

-cosh(mu)*A[6]-sinh(mu)*A[5]+cos(mu)*A[8]-sin(mu)*A[7]

(18)

 

The additional boundary conditions at crack location

X5:=combine(M1-M2);

(EI*cosh(mu*x)*mu^2*A[1]-EI*cosh(mu*x)*mu^2*A[5]+EI*sinh(mu*x)*mu^2*A[2]-EI*sinh(mu*x)*mu^2*A[6]-EI*cos(mu*x)*mu^2*A[3]+EI*cos(mu*x)*mu^2*A[7]-EI*sin(mu*x)*mu^2*A[4]+EI*sin(mu*x)*mu^2*A[8])/L^2

(19)

X5:=collect(X5,mu);

(EI*cosh(mu*x)*A[1]-EI*cosh(mu*x)*A[5]+EI*sinh(mu*x)*A[2]-EI*sinh(mu*x)*A[6]-cos(mu*x)*EI*A[3]+A[7]*cos(mu*x)*EI-A[4]*sin(mu*x)*EI+A[8]*sin(mu*x)*EI)*mu^2/L^2

(20)

X5:=collect(X5,EI)*(L^2/mu^2/EI);

A[1]*cosh(mu*x)-A[5]*cosh(mu*x)+A[2]*sinh(mu*x)-A[6]*sinh(mu*x)-A[3]*cos(mu*x)+A[7]*cos(mu*x)-A[4]*sin(mu*x)+A[8]*sin(mu*x)

(21)

X6:=combine(S1-S2);

(-EI*cosh(mu*x)*mu^3*A[2]+EI*cosh(mu*x)*mu^3*A[6]-EI*sinh(mu*x)*mu^3*A[1]+EI*sinh(mu*x)*mu^3*A[5]+EI*cos(mu*x)*mu^3*A[4]-EI*cos(mu*x)*mu^3*A[8]-EI*sin(mu*x)*mu^3*A[3]+EI*sin(mu*x)*mu^3*A[7])/L^3

(22)

X6:=collect(X6,mu);

(-EI*cosh(mu*x)*A[2]+EI*cosh(mu*x)*A[6]-EI*sinh(mu*x)*A[1]+EI*A[5]*sinh(mu*x)+cos(mu*x)*A[4]*EI-cos(mu*x)*A[8]*EI-sin(mu*x)*EI*A[3]+sin(mu*x)*A[7]*EI)*mu^3/L^3

(23)

X6:=collect(X6,EI)*(L^3/mu^3/EI);

-cosh(mu*x)*A[2]+cosh(mu*x)*A[6]-sinh(mu*x)*A[1]+sinh(mu*x)*A[5]+cos(mu*x)*A[4]-cos(mu*x)*A[8]-sin(mu*x)*A[3]+sin(mu*x)*A[7]

(24)

 

X7:=combine(W2-(W1+c8*S1));

(EI*cosh(mu*x)*c8*mu^3*A[2]+EI*sinh(mu*x)*c8*mu^3*A[1]-EI*cos(mu*x)*c8*mu^3*A[4]+EI*sin(mu*x)*c8*mu^3*A[3]-cosh(mu*x)*A[1]*L^3+cosh(mu*x)*A[5]*L^3-sinh(mu*x)*A[2]*L^3+sinh(mu*x)*A[6]*L^3-cos(mu*x)*A[3]*L^3+cos(mu*x)*A[7]*L^3-sin(mu*x)*A[4]*L^3+sin(mu*x)*A[8]*L^3)/L^3

(25)

X8:=combine (theta2-(theta1+c44*M1));

(-EI*cosh(mu*x)*c44*mu^2*A[1]-EI*sinh(mu*x)*c44*mu^2*A[2]+EI*cos(mu*x)*c44*mu^2*A[3]+EI*sin(mu*x)*c44*mu^2*A[4]-L*cosh(mu*x)*mu*A[2]+L*cosh(mu*x)*mu*A[6]-L*sinh(mu*x)*mu*A[1]+L*sinh(mu*x)*mu*A[5]-L*cos(mu*x)*mu*A[4]+L*cos(mu*x)*mu*A[8]+L*sin(mu*x)*mu*A[3]-L*sin(mu*x)*mu*A[7])/L^2

(26)

 

The characteristic matrix function of frequency

FD8:=subs(A[1]=1,A[3]=0,X1);FD12:=subs(A[1]=0,A[3]=0,X1);FD13:=subs(A[1]=0,A[3]=1,X1);FD14:=subs(A[1]=0,A[3]=0,X1);FD15:=subs(A[1]=0,A[3]=0,X1);FD16:=subs(A[1]=0,A[3]=0,X1);FD17:=subs(A[1]=0,A[3]=0,X1);FD18:=subs(A[1]=0,A[3]=0,X1);

1

 

0

 

1

 

0

 

0

 

0

 

0

 

0

(27)

FD21:=subs(A[2]=0,A[4]=0,X2);FD22:=subs(A[2]=1,A[4]=0,X2);FD23:=subs(A[2]=0,A[4]=0,X2);FD24:=subs(A[2]=0,A[4]=1,X2);FD25:=subs(A[2]=0,A[4]=0,X2);FD26:=subs(A[2]=0,A[4]=0,X2);FD27:=subs(A[2]=0,A[4]=0,X2);FD28:=subs(A[2]=0,A[4]=0,X2);

0

 

1

 

0

 

1

 

0

 

0

 

0

 

0

(28)

 

FD31:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=0,X3);FD32:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=0,X3);FD33:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=0,X3);FD34:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=0,X3);FD35:=subs(A[5]=1,A[6]=0,A[7]=0,A[8]=0,X3);;FD36:=subs(A[5]=0,A[6]=1,A[7]=0,A[8]=0,X3);FD37:=subs(A[5]=0,A[6]=0,A[7]=1,A[8]=0,X3);FD38:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=1,X3);

0

 

0

 

0

 

0

 

cosh(mu)

 

sinh(mu)

 

-cos(mu)

 

-sin(mu)

(29)

FD41:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=0,X4);FD42:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=0,X4);FD43:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=0,X4);FD44:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=0,X4);FD45:=subs(A[5]=1,A[6]=0,A[7]=0,A[8]=0,X4);FD46:=subs(A[5]=0,A[6]=1,A[7]=0,A[8]=0,X4);FD47:=subs(A[5]=0,A[6]=0,A[7]=1,A[8]=0,X4);FD48:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=1,X4);

0

 

0

 

0

 

0

 

-sinh(mu)

 

-cosh(mu)

 

-sin(mu)

 

cos(mu)

(30)

 

FD51:=subs(A[1]=1,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X5);FD52:=subs(A[1]=0,A[2]=1,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X5);FD53:=subs(A[1]=0,A[2]=0,A[3]=1,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X5);FD54:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=1,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X5);FD55:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=0,X5);FD56:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=1,A[7]=0,A[8]=0,X5);FD57:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=1,A[8]=0,X5);FD58:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=1,X5);

cosh(mu*x)

 

sinh(mu*x)

 

-cos(mu*x)

 

-sin(mu*x)

 

-cosh(mu*x)

 

-sinh(mu*x)

 

cos(mu*x)

 

sin(mu*x)

(31)

FD61:=subs(A[1]=1,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X6);FD62:=subs(A[1]=0,A[2]=1,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X6);FD63:=subs(A[1]=0,A[2]=0,A[3]=1,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X6);FD64:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=1,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X6);FD65:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=0,X6);FD66:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=1,A[7]=0,A[8]=0,X6);FD67:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=1,A[8]=0,X6);FD68:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=1,X6);

-sinh(mu*x)

 

-cosh(mu*x)

 

-sin(mu*x)

 

cos(mu*x)

 

sinh(mu*x)

 

cosh(mu*x)

 

sin(mu*x)

 

-cos(mu*x)

(32)

 

FD71:=subs(A[1]=1,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X7);FD72:=subs(A[1]=0,A[2]=1,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X7);FD73:=subs(A[1]=0,A[2]=0,A[3]=1,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X7);FD74:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=1,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X7);FD75:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=0,X7);FD76:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=1,A[7]=0,A[8]=0,X7);FD77:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=1,A[8]=0,X7);FD78:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=1,X7);

(EI*sinh(mu*x)*c8*mu^3-cosh(mu*x)*L^3)/L^3

 

(EI*cosh(mu*x)*c8*mu^3-sinh(mu*x)*L^3)/L^3

 

(EI*sin(mu*x)*c8*mu^3-L^3*cos(mu*x))/L^3

 

(-EI*cos(mu*x)*c8*mu^3-sin(mu*x)*L^3)/L^3

 

cosh(mu*x)

 

sinh(mu*x)

 

cos(mu*x)

 

sin(mu*x)

(33)

FD81:=subs(A[1]=1,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X8);FD82:=subs(A[1]=0,A[2]=1,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X8);FD83:=subs(A[1]=0,A[2]=0,A[3]=1,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X8);FD84:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=1,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X8);FD85:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=0,X8);FD86:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=1,A[7]=0,A[8]=0,X8);FD87:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=1,A[8]=0,X8);FD88:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=1,X8);

(-EI*cosh(mu*x)*c44*mu^2-L*sinh(mu*x)*mu)/L^2

 

(-EI*sinh(mu*x)*c44*mu^2-L*cosh(mu*x)*mu)/L^2

 

(EI*cos(mu*x)*c44*mu^2+L*sin(mu*x)*mu)/L^2

 

(EI*sin(mu*x)*c44*mu^2-L*cos(mu*x)*mu)/L^2

 

sinh(mu*x)*mu/L

 

cosh(mu*x)*mu/L

 

-sin(mu*x)*mu/L

 

cos(mu*x)*mu/L

(34)

 

MM:=matrix(8,8,[[FD11,FD12,FD13,FD14,FD15,FD16,FD17,FD18],[FD21,FD22,FD23,FD24,FD25,FD26,FD27,FD28],[FD31,FD32,FD33,FD34,FD35,FD36,FD37,FD38],[FD41,FD42,FD43,FD44,FD45,FD46,FD47,FD48],[FD51,FD52,FD53,FD54,FD55,FD56,FD57,FD58],[FD61,FD62,FD63,FD64,FD65,FD66,FD67,FD68],[FD71,FD72,FD73,FD74,FD75,FD76,FD77,FD78],[FD81,FD82,FD83,FD84,FD85,FD86,FD87,FD88]]);

MM := Matrix(8, 8, {(1, 1) = FD11, (1, 2) = 0, (1, 3) = 1, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 1, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = cosh(mu), (3, 6) = sinh(mu), (3, 7) = -cos(mu), (3, 8) = -sin(mu), (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = -sinh(mu), (4, 6) = -cosh(mu), (4, 7) = -sin(mu), (4, 8) = cos(mu), (5, 1) = cosh(mu*x), (5, 2) = sinh(mu*x), (5, 3) = -cos(mu*x), (5, 4) = -sin(mu*x), (5, 5) = -cosh(mu*x), (5, 6) = -sinh(mu*x), (5, 7) = cos(mu*x), (5, 8) = sin(mu*x), (6, 1) = -sinh(mu*x), (6, 2) = -cosh(mu*x), (6, 3) = -sin(mu*x), (6, 4) = cos(mu*x), (6, 5) = sinh(mu*x), (6, 6) = cosh(mu*x), (6, 7) = sin(mu*x), (6, 8) = -cos(mu*x), (7, 1) = (EI*sinh(mu*x)*c8*mu^3-cosh(mu*x)*L^3)/L^3, (7, 2) = (EI*cosh(mu*x)*c8*mu^3-sinh(mu*x)*L^3)/L^3, (7, 3) = (EI*sin(mu*x)*c8*mu^3-L^3*cos(mu*x))/L^3, (7, 4) = (-EI*cos(mu*x)*c8*mu^3-sin(mu*x)*L^3)/L^3, (7, 5) = cosh(mu*x), (7, 6) = sinh(mu*x), (7, 7) = cos(mu*x), (7, 8) = sin(mu*x), (8, 1) = (-EI*cosh(mu*x)*c44*mu^2-L*sinh(mu*x)*mu)/L^2, (8, 2) = (-EI*sinh(mu*x)*c44*mu^2-L*cosh(mu*x)*mu)/L^2, (8, 3) = (EI*cos(mu*x)*c44*mu^2+L*sin(mu*x)*mu)/L^2, (8, 4) = (EI*sin(mu*x)*c44*mu^2-L*cos(mu*x)*mu)/L^2, (8, 5) = sinh(mu*x)*mu/L, (8, 6) = cosh(mu*x)*mu/L, (8, 7) = -sin(mu*x)*mu/L, (8, 8) = cos(mu*x)*mu/L})

(35)

Program end

 

NULL

 

``


 

Download Vibration_of_a_cracked_composite_beam.mw
 

restart: with(LinearAlgebra):

# Motion equation (  Vibration of a cracked composite beam using general solution)  Edited by Adjal Yassine #

####################################################################

Motion equation of flexural  vibration in normalized form 

EI*W^(iv)-m*omega^2*W=0;

EI*W^iv-m*omega^2*W = 0

(1)

 

The general solution form of bending vibration equation

W1:=A[1]*cosh(mu*x)+A[2]*sinh(mu*x)+A[3]*cos(mu*x)+A[4]*sin(mu*x);

A[1]*cosh(mu*x)+A[2]*sinh(mu*x)+A[3]*cos(mu*x)+A[4]*sin(mu*x)

(2)

where

E:=2682e6;L:=0.18;h:=0.004;b:=0.02;rho:=2600;area=b*h;m:=rho*h*b;II:=(h*b^3)/12:

0.2682e10

 

.18

 

0.4e-2

 

0.2e-1

 

2600

 

area = 0.8e-4

 

.20800

(3)

mu:=((m*omega^2*L^4/EI)^(1/4)):

 

 Expression of cross-sectional rotation , the bending moment shear  force and torsional moment  are given as follows respectively

theta1 := (1/L)*(A[1]*mu*sinh(mu*x)+A[2]*mu*cosh(mu*x)-A[3]*mu*sin(mu*x)+A[4]*mu*cos(mu*x));

(A[1]*mu*sinh(mu*x)+A[2]*mu*cosh(mu*x)-A[3]*mu*sin(mu*x)+A[4]*mu*cos(mu*x))/L

(4)

M1:= (EI/L^2)*(A[1]*mu^2*cosh(mu*x)+A[2]*mu^2*sinh(mu*x)-A[3]*mu^2*cos(mu*x)-A[4]*mu^2*sin(mu*x));

EI*(A[1]*mu^2*cosh(mu*x)+A[2]*mu^2*sinh(mu*x)-A[3]*mu^2*cos(mu*x)-A[4]*mu^2*sin(mu*x))/L^2

(5)

S1:= (-EI/L^3)*(A[1]*mu^3*sinh(mu*x)+A[2]*mu^3*cosh(mu*x)+A[3]*mu^3*sin(mu*x)-A[4]*mu^3*cos(mu*x));

-EI*(A[1]*mu^3*sinh(mu*x)+A[2]*mu^3*cosh(mu*x)+A[3]*mu^3*sin(mu*x)-A[4]*mu^3*cos(mu*x))/L^3

(6)

 

W2:=A[5]*cosh(mu*x)+A[6]*sinh(mu*x)+A[7]*cos(mu*x)+A[8]*sin(mu*x);

A[5]*cosh(mu*x)+A[6]*sinh(mu*x)+A[7]*cos(mu*x)+A[8]*sin(mu*x)

(7)

 

theta2:= (1/L)*(A[5]*mu*sinh(mu*x)+A[6]*mu*cosh(mu*x)-A[7]*mu*sin(mu*x)+A[8]*mu*cos(mu*x));

(A[5]*mu*sinh(mu*x)+A[6]*mu*cosh(mu*x)-A[7]*mu*sin(mu*x)+A[8]*mu*cos(mu*x))/L

(8)

M2:= (EI/L^2)*(A[5]*mu^2*cosh(mu*x)+A[6]*mu^2*sinh(mu*x)-A[7]*mu^2*cos(mu*x)-A[8]*mu^2*sin(mu*x));

EI*(A[5]*mu^2*cosh(mu*x)+A[6]*mu^2*sinh(mu*x)-A[7]*mu^2*cos(mu*x)-A[8]*mu^2*sin(mu*x))/L^2

(9)

S2:= -(EI/L^3)*(A[5]*mu^3*sinh(mu*x)+A[6]*mu^3*cosh(mu*x)+A[7]*mu^3*sin(mu*x)-A[8]*mu^3*cos(mu*x));

-EI*(A[5]*mu^3*sinh(mu*x)+A[6]*mu^3*cosh(mu*x)+A[7]*mu^3*sin(mu*x)-A[8]*mu^3*cos(mu*x))/L^3

(10)

 

The boundary conditions at fixed end W1(0)=Theta(0)=0

X1:=eval(subs(x=0,W1));

A[1]+A[3]

(11)

X2:=eval(subs(x=0,theta1));

(mu*A[2]+mu*A[4])/L

(12)

X2:=collect(X2,mu)*(L/mu);

A[2]+A[4]

(13)

 

The boundary condtions at free end M2(1)=S2(1)=0

X3:=eval(subs(x=1,M2));

EI*(A[5]*mu^2*cosh(mu)+A[6]*mu^2*sinh(mu)-A[7]*mu^2*cos(mu)-A[8]*mu^2*sin(mu))/L^2

(14)

X3:=collect(X3,mu)*(L^2/mu^2/EI);

cosh(mu)*A[5]+sinh(mu)*A[6]-cos(mu)*A[7]-sin(mu)*A[8]

(15)

X4:=eval(subs(x=1,S2));

-EI*(A[5]*mu^3*sinh(mu)+A[6]*mu^3*cosh(mu)+A[7]*mu^3*sin(mu)-A[8]*mu^3*cos(mu))/L^3

(16)

X4:=collect(X4,mu);

-EI*(cosh(mu)*A[6]+sinh(mu)*A[5]-cos(mu)*A[8]+sin(mu)*A[7])*mu^3/L^3

(17)

X4:=collect(X4,EI)*(L^3/mu^3/EI);

-cosh(mu)*A[6]-sinh(mu)*A[5]+cos(mu)*A[8]-sin(mu)*A[7]

(18)

 

The additional boundary conditions at crack location

X5:=combine(M1-M2);

(EI*cosh(mu*x)*mu^2*A[1]-EI*cosh(mu*x)*mu^2*A[5]+EI*sinh(mu*x)*mu^2*A[2]-EI*sinh(mu*x)*mu^2*A[6]-EI*cos(mu*x)*mu^2*A[3]+EI*cos(mu*x)*mu^2*A[7]-EI*sin(mu*x)*mu^2*A[4]+EI*sin(mu*x)*mu^2*A[8])/L^2

(19)

X5:=collect(X5,mu);

(EI*cosh(mu*x)*A[1]-EI*cosh(mu*x)*A[5]+EI*sinh(mu*x)*A[2]-EI*sinh(mu*x)*A[6]-cos(mu*x)*EI*A[3]+A[7]*cos(mu*x)*EI-A[4]*sin(mu*x)*EI+A[8]*sin(mu*x)*EI)*mu^2/L^2

(20)

X5:=collect(X5,EI)*(L^2/mu^2/EI);

A[1]*cosh(mu*x)-A[5]*cosh(mu*x)+A[2]*sinh(mu*x)-A[6]*sinh(mu*x)-A[3]*cos(mu*x)+A[7]*cos(mu*x)-A[4]*sin(mu*x)+A[8]*sin(mu*x)

(21)

X6:=combine(S1-S2);

(-EI*cosh(mu*x)*mu^3*A[2]+EI*cosh(mu*x)*mu^3*A[6]-EI*sinh(mu*x)*mu^3*A[1]+EI*sinh(mu*x)*mu^3*A[5]+EI*cos(mu*x)*mu^3*A[4]-EI*cos(mu*x)*mu^3*A[8]-EI*sin(mu*x)*mu^3*A[3]+EI*sin(mu*x)*mu^3*A[7])/L^3

(22)

X6:=collect(X6,mu);

(-EI*cosh(mu*x)*A[2]+EI*cosh(mu*x)*A[6]-EI*sinh(mu*x)*A[1]+EI*A[5]*sinh(mu*x)+cos(mu*x)*A[4]*EI-cos(mu*x)*A[8]*EI-sin(mu*x)*EI*A[3]+sin(mu*x)*A[7]*EI)*mu^3/L^3

(23)

X6:=collect(X6,EI)*(L^3/mu^3/EI);

-cosh(mu*x)*A[2]+cosh(mu*x)*A[6]-sinh(mu*x)*A[1]+sinh(mu*x)*A[5]+cos(mu*x)*A[4]-cos(mu*x)*A[8]-sin(mu*x)*A[3]+sin(mu*x)*A[7]

(24)

 

X7:=combine(W2-(W1+c8*S1));

(EI*cosh(mu*x)*c8*mu^3*A[2]+EI*sinh(mu*x)*c8*mu^3*A[1]-EI*cos(mu*x)*c8*mu^3*A[4]+EI*sin(mu*x)*c8*mu^3*A[3]-cosh(mu*x)*A[1]*L^3+cosh(mu*x)*A[5]*L^3-sinh(mu*x)*A[2]*L^3+sinh(mu*x)*A[6]*L^3-cos(mu*x)*A[3]*L^3+cos(mu*x)*A[7]*L^3-sin(mu*x)*A[4]*L^3+sin(mu*x)*A[8]*L^3)/L^3

(25)

X8:=combine (theta2-(theta1+c44*M1));

(-EI*cosh(mu*x)*c44*mu^2*A[1]-EI*sinh(mu*x)*c44*mu^2*A[2]+EI*cos(mu*x)*c44*mu^2*A[3]+EI*sin(mu*x)*c44*mu^2*A[4]-L*cosh(mu*x)*mu*A[2]+L*cosh(mu*x)*mu*A[6]-L*sinh(mu*x)*mu*A[1]+L*sinh(mu*x)*mu*A[5]-L*cos(mu*x)*mu*A[4]+L*cos(mu*x)*mu*A[8]+L*sin(mu*x)*mu*A[3]-L*sin(mu*x)*mu*A[7])/L^2

(26)

 

The characteristic matrix function of frequency

FD8:=subs(A[1]=1,A[3]=0,X1);FD12:=subs(A[1]=0,A[3]=0,X1);FD13:=subs(A[1]=0,A[3]=1,X1);FD14:=subs(A[1]=0,A[3]=0,X1);FD15:=subs(A[1]=0,A[3]=0,X1);FD16:=subs(A[1]=0,A[3]=0,X1);FD17:=subs(A[1]=0,A[3]=0,X1);FD18:=subs(A[1]=0,A[3]=0,X1);

1

 

0

 

1

 

0

 

0

 

0

 

0

 

0

(27)

FD21:=subs(A[2]=0,A[4]=0,X2);FD22:=subs(A[2]=1,A[4]=0,X2);FD23:=subs(A[2]=0,A[4]=0,X2);FD24:=subs(A[2]=0,A[4]=1,X2);FD25:=subs(A[2]=0,A[4]=0,X2);FD26:=subs(A[2]=0,A[4]=0,X2);FD27:=subs(A[2]=0,A[4]=0,X2);FD28:=subs(A[2]=0,A[4]=0,X2);

0

 

1

 

0

 

1

 

0

 

0

 

0

 

0

(28)

 

FD31:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=0,X3);FD32:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=0,X3);FD33:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=0,X3);FD34:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=0,X3);FD35:=subs(A[5]=1,A[6]=0,A[7]=0,A[8]=0,X3);;FD36:=subs(A[5]=0,A[6]=1,A[7]=0,A[8]=0,X3);FD37:=subs(A[5]=0,A[6]=0,A[7]=1,A[8]=0,X3);FD38:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=1,X3);

0

 

0

 

0

 

0

 

cosh(mu)

 

sinh(mu)

 

-cos(mu)

 

-sin(mu)

(29)

FD41:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=0,X4);FD42:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=0,X4);FD43:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=0,X4);FD44:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=0,X4);FD45:=subs(A[5]=1,A[6]=0,A[7]=0,A[8]=0,X4);FD46:=subs(A[5]=0,A[6]=1,A[7]=0,A[8]=0,X4);FD47:=subs(A[5]=0,A[6]=0,A[7]=1,A[8]=0,X4);FD48:=subs(A[5]=0,A[6]=0,A[7]=0,A[8]=1,X4);

0

 

0

 

0

 

0

 

-sinh(mu)

 

-cosh(mu)

 

-sin(mu)

 

cos(mu)

(30)

 

FD51:=subs(A[1]=1,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X5);FD52:=subs(A[1]=0,A[2]=1,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X5);FD53:=subs(A[1]=0,A[2]=0,A[3]=1,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X5);FD54:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=1,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X5);FD55:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=0,X5);FD56:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=1,A[7]=0,A[8]=0,X5);FD57:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=1,A[8]=0,X5);FD58:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=1,X5);

cosh(mu*x)

 

sinh(mu*x)

 

-cos(mu*x)

 

-sin(mu*x)

 

-cosh(mu*x)

 

-sinh(mu*x)

 

cos(mu*x)

 

sin(mu*x)

(31)

FD61:=subs(A[1]=1,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X6);FD62:=subs(A[1]=0,A[2]=1,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X6);FD63:=subs(A[1]=0,A[2]=0,A[3]=1,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X6);FD64:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=1,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X6);FD65:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=0,X6);FD66:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=1,A[7]=0,A[8]=0,X6);FD67:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=1,A[8]=0,X6);FD68:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=1,X6);

-sinh(mu*x)

 

-cosh(mu*x)

 

-sin(mu*x)

 

cos(mu*x)

 

sinh(mu*x)

 

cosh(mu*x)

 

sin(mu*x)

 

-cos(mu*x)

(32)

 

FD71:=subs(A[1]=1,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X7);FD72:=subs(A[1]=0,A[2]=1,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X7);FD73:=subs(A[1]=0,A[2]=0,A[3]=1,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X7);FD74:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=1,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X7);FD75:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=0,X7);FD76:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=1,A[7]=0,A[8]=0,X7);FD77:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=1,A[8]=0,X7);FD78:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=1,X7);

(EI*sinh(mu*x)*c8*mu^3-cosh(mu*x)*L^3)/L^3

 

(EI*cosh(mu*x)*c8*mu^3-sinh(mu*x)*L^3)/L^3

 

(EI*sin(mu*x)*c8*mu^3-L^3*cos(mu*x))/L^3

 

(-EI*cos(mu*x)*c8*mu^3-sin(mu*x)*L^3)/L^3

 

cosh(mu*x)

 

sinh(mu*x)

 

cos(mu*x)

 

sin(mu*x)

(33)

FD81:=subs(A[1]=1,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X8);FD82:=subs(A[1]=0,A[2]=1,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X8);FD83:=subs(A[1]=0,A[2]=0,A[3]=1,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X8);FD84:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=1,A[5]=0,A[6]=0,A[7]=0,A[8]=0,X8);FD85:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=1,A[6]=0,A[7]=0,A[8]=0,X8);FD86:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=1,A[7]=0,A[8]=0,X8);FD87:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=1,A[8]=0,X8);FD88:=subs(A[1]=0,A[2]=0,A[3]=0,A[4]=0,A[5]=0,A[6]=0,A[7]=0,A[8]=1,X8);

(-EI*cosh(mu*x)*c44*mu^2-L*sinh(mu*x)*mu)/L^2

 

(-EI*sinh(mu*x)*c44*mu^2-L*cosh(mu*x)*mu)/L^2

 

(EI*cos(mu*x)*c44*mu^2+L*sin(mu*x)*mu)/L^2

 

(EI*sin(mu*x)*c44*mu^2-L*cos(mu*x)*mu)/L^2

 

sinh(mu*x)*mu/L

 

cosh(mu*x)*mu/L

 

-sin(mu*x)*mu/L

 

cos(mu*x)*mu/L

(34)

 

MM:=matrix(8,8,[[FD11,FD12,FD13,FD14,FD15,FD16,FD17,FD18],[FD21,FD22,FD23,FD24,FD25,FD26,FD27,FD28],[FD31,FD32,FD33,FD34,FD35,FD36,FD37,FD38],[FD41,FD42,FD43,FD44,FD45,FD46,FD47,FD48],[FD51,FD52,FD53,FD54,FD55,FD56,FD57,FD58],[FD61,FD62,FD63,FD64,FD65,FD66,FD67,FD68],[FD71,FD72,FD73,FD74,FD75,FD76,FD77,FD78],[FD81,FD82,FD83,FD84,FD85,FD86,FD87,FD88]]);

MM := Matrix(8, 8, {(1, 1) = FD11, (1, 2) = 0, (1, 3) = 1, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 1, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = cosh(mu), (3, 6) = sinh(mu), (3, 7) = -cos(mu), (3, 8) = -sin(mu), (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = -sinh(mu), (4, 6) = -cosh(mu), (4, 7) = -sin(mu), (4, 8) = cos(mu), (5, 1) = cosh(mu*x), (5, 2) = sinh(mu*x), (5, 3) = -cos(mu*x), (5, 4) = -sin(mu*x), (5, 5) = -cosh(mu*x), (5, 6) = -sinh(mu*x), (5, 7) = cos(mu*x), (5, 8) = sin(mu*x), (6, 1) = -sinh(mu*x), (6, 2) = -cosh(mu*x), (6, 3) = -sin(mu*x), (6, 4) = cos(mu*x), (6, 5) = sinh(mu*x), (6, 6) = cosh(mu*x), (6, 7) = sin(mu*x), (6, 8) = -cos(mu*x), (7, 1) = (EI*sinh(mu*x)*c8*mu^3-cosh(mu*x)*L^3)/L^3, (7, 2) = (EI*cosh(mu*x)*c8*mu^3-sinh(mu*x)*L^3)/L^3, (7, 3) = (EI*sin(mu*x)*c8*mu^3-L^3*cos(mu*x))/L^3, (7, 4) = (-EI*cos(mu*x)*c8*mu^3-sin(mu*x)*L^3)/L^3, (7, 5) = cosh(mu*x), (7, 6) = sinh(mu*x), (7, 7) = cos(mu*x), (7, 8) = sin(mu*x), (8, 1) = (-EI*cosh(mu*x)*c44*mu^2-L*sinh(mu*x)*mu)/L^2, (8, 2) = (-EI*sinh(mu*x)*c44*mu^2-L*cosh(mu*x)*mu)/L^2, (8, 3) = (EI*cos(mu*x)*c44*mu^2+L*sin(mu*x)*mu)/L^2, (8, 4) = (EI*sin(mu*x)*c44*mu^2-L*cos(mu*x)*mu)/L^2, (8, 5) = sinh(mu*x)*mu/L, (8, 6) = cosh(mu*x)*mu/L, (8, 7) = -sin(mu*x)*mu/L, (8, 8) = cos(mu*x)*mu/L})

(35)

Program end

 

NULL

 

``


 

Download Vibration_of_a_cracked_composite_beam.mwVibration_of_a_cracked_composite_beam.mwVibration_of_a_cracked_composite_beam.mw

 

Splitting PDE parameterized symmetries

and Parameter-continuous symmetry transformations

The determination of symmetries for partial differential equation systems (PDE) is relevant in several contexts, the most obvious of which is of course the determination of the PDE solutions. For instance, generally speaking, the knowledge of a N-dimensional Lie symmetry group can be used to reduce the number of independent variables of PDE by N. So if PDE depends only on N independent variables, that amounts to completely solving it. If only N-1 symmetries are known or can be successfully used then PDE becomes and ODE; etc., all advantageous situations. In Maple, a complete set of symmetry commands, to perform each step of the symmetry approach or several of them in one go, is part of the PDEtools  package.

 

Besides the dependent and independent variables, PDE frequently depends on some constant parameters, and besides the PDE symmetries for arbitrary values of those parameters, for some particular values of them, PDE transforms into a completely different problem, admitting different symmetries. The question then is: how can you determine those particular values of the parameters and the corresponding different symmetries? That was the underlying subject of a recent question in Mapleprimes. The answer to those questions is relatively simple and yet not entirely obvious for most of us, motivating this post, organized briefly around one example.

 

To reproduce the input/output below you need Maple 2019 and to have installed the Physics Updates v.449 or higher.

 

Consider the family of Korteweg-de Vries equation for u(x, t)involving three constant parameters a, b, q. For convenience (simpler input and more readable output) use the diff_table  and declare  commands

with(PDEtools)

U := diff_table(u(x, t))

pde := b*U[]*U[x]+a*U[x]+q*U[x, x, x]+U[t] = 0

b*u(x, t)*(diff(u(x, t), x))+a*(diff(u(x, t), x))+q*(diff(diff(diff(u(x, t), x), x), x))+diff(u(x, t), t) = 0

(1)

declare(U[])

` u`(x, t)*`will now be displayed as`*u

(2)

This pde admits a 4-dimensional symmetry group, whose infinitesimals - for arbitrary values of the parameters a, b, q- are given by

I__1 := Infinitesimals(pde, [u], specialize_Cn = false)

[_xi[x](x, t, u) = (1/3)*_C1*x+_C3*t+_C4, _xi[t](x, t, u) = _C1*t+_C2, _eta[u](x, t, u) = (1/3)*((-2*b*u-2*a)*_C1+3*_C3)/b]

(3)

Looking at pde (1) as a nonlinear problem in u, a, b and q, it splits into four cases for some particular values of the parameter:

pde__cases := casesplit(b*u(x, t)*(diff(u(x, t), x))+a*(diff(u(x, t), x))+q*(diff(diff(diff(u(x, t), x), x), x))+diff(u(x, t), t) = 0, parameters = {a, b, q}, caseplot)

`========= Pivots Legend =========`

 

p1 = q

 

p2 = b*u(x, t)+a

 

p3 = b

 

 

`casesplit/ans`([diff(diff(diff(u(x, t), x), x), x) = -(b*u(x, t)*(diff(u(x, t), x))+a*(diff(u(x, t), x))+diff(u(x, t), t))/q], [q <> 0]), `casesplit/ans`([diff(u(x, t), x) = -(diff(u(x, t), t))/(b*u(x, t)+a), q = 0], [b*u(x, t)+a <> 0]), `casesplit/ans`([u(x, t) = -a/b, q = 0], [b <> 0]), `casesplit/ans`([diff(u(x, t), t) = 0, a = 0, b = 0, q = 0], [])

(4)

The legend above indicates the pivots and the tree of cases, depending on whether each pivot is equal or different from 0. At the end there is the algebraic sequence of cases. The first case is the general case, for which the symmetry infinitesimals were computed as I__1 above, but clearly the other three cases admit more general symmetries. Consider for instance the second case, pass the ignoreparameterizingequations to ignore the parameterizing equation q = 0, and you get

I__2 := Infinitesimals(pde__cases[2], ignore)

`* Partial match of  'ignore' against keyword 'ignoreparameterizingequations'`

 

[_xi[x](x, t, u) = _F3(x, t, u), _xi[t](x, t, u) = Intat(((b*u+a)*(D[1](_F3))(_a, ((b*u+a)*t-x+_a)/(b*u+a), u)-_F1(u, ((b*u+a)*t-x)/(b*u+a))*b+(D[2](_F3))(_a, ((b*u+a)*t-x+_a)/(b*u+a), u))/(b*u+a)^2, _a = x)+_F2(u, ((b*u+a)*t-x)/(b*u+a)), _eta[u](x, t, u) = _F1(u, ((b*u+a)*t-x)/(b*u+a))]

(5)

These infinitesimals are indeed much more general than I__1, in fact so general that (5) is almost unreadable ... Specialize the three arbitrary functions into something "easy" just to be able follow - e.g. take _F1 to be just the + operator, _F2 the * operator and _F3 = 1

eval(I__2, [_F1 = `+`, _F2 = `*`, _F3 = 1])

[_xi[x](x, t, u) = 1, _xi[t](x, t, u) = Intat(-(u+((b*u+a)*t-x)/(b*u+a))*b/(b*u+a)^2, _a = x)+u*((b*u+a)*t-x)/(b*u+a), _eta[u](x, t, u) = u+((b*u+a)*t-x)/(b*u+a)]

(6)

simplify(value([_xi[x](x, t, u) = 1, _xi[t](x, t, u) = Intat(-(u+((b*u+a)*t-x)/(b*u+a))*b/(b*u+a)^2, _a = x)+u*((b*u+a)*t-x)/(b*u+a), _eta[u](x, t, u) = u+((b*u+a)*t-x)/(b*u+a)]))

[_xi[x](x, t, u) = 1, _xi[t](x, t, u) = (b^3*t*u^4+((3*a*t-x)*u^3-u^2*x-t*x*u)*b^2+((3*a^2*t-2*a*x)*u^2-a*u*x-a*t*x+x^2)*b+a^2*u*(a*t-x))/(b*u+a)^3, _eta[u](x, t, u) = (b*u^2+(b*t+a)*u+a*t-x)/(b*u+a)]

(7)

This symmetry is of course completely different than [_xi[x](x, t, u) = (1/3)*_C1*x+_C3*t+_C4, _xi[t](x, t, u) = _C1*t+_C2, _eta[u](x, t, u) = ((-2*b*u-2*a)*_C1+3*_C3)/(3*b)]computed for the general case.

 

The symmetry (7) can be verified against pde__cases[2] or directly against pde after substituting q = 0.

[_xi[x](x, t, u) = (1/3)*_C1*x+_C3*t+_C4, _xi[t](x, t, u) = _C1*t+_C2, _eta[u](x, t, u) = (1/3)*((-2*b*u-2*a)*_C1+3*_C3)/b]

(8)

SymmetryTest([_xi[x](x, t, u) = 1, _xi[t](x, t, u) = (b^3*t*u^4+((3*a*t-x)*u^3-u^2*x-t*x*u)*b^2+((3*a^2*t-2*a*x)*u^2-a*u*x-a*t*x+x^2)*b+a^2*u*(a*t-x))/(b*u+a)^3, _eta[u](x, t, u) = (b*u^2+(b*t+a)*u+a*t-x)/(b*u+a)], pde__cases[2], ignore)

`* Partial match of  'ignore' against keyword 'ignoreparameterizingequations'`

 

{0}

(9)

SymmetryTest([_xi[x](x, t, u) = 1, _xi[t](x, t, u) = (b^3*t*u^4+((3*a*t-x)*u^3-u^2*x-t*x*u)*b^2+((3*a^2*t-2*a*x)*u^2-a*u*x-a*t*x+x^2)*b+a^2*u*(a*t-x))/(b*u+a)^3, _eta[u](x, t, u) = (b*u^2+(b*t+a)*u+a*t-x)/(b*u+a)], subs(q = 0, pde))

{0}

(10)

Summarizing: "to split PDE symmetries into cases according to the values of the PDE parameters, split the PDE into cases with respect to these parameters (command PDEtools:-casesplit ) then compute the symmetries for each case"

 

Parameter continuous symmetry transformations

 

A different, however closely related question, is whether pde admits "symmetries with respect to the parameters a, b and q", so whether exists continuous transformations of the parameters a, b and q that leave pde invariant in form.

 

Beforehand, note that since the parameters are constants with regards to the dependent and independent variables (here u(x, t)), such continuous symmetry transformations cannot be used directly to compute a solution for pde. They can, however, be used to reduce the number of parameters. And in some contexts, that is exactly what we need, for example to entirely remove the splitting into cases due to their presence, or to proceed applying a solving method that is valid only when there are no parameters (frequently the case when computing exact solutions to "PDE & Boundary Conditions").

 

To compute such "continuous symmetry transformations of the parameters" that leave pde invariant one can always think of these parameters as "additional independent variables of pde". In terms of formulation, that amounts to replacing the dependency in the dependent variable, i.e. replace u(x, t) by u(x, t, a, b, q)

 

pde__xtabq := subs((x, t) = (x, t, a, b, q), pde)

b*u(x, t, a, b, q)*(diff(u(x, t, a, b, q), x))+a*(diff(u(x, t, a, b, q), x))+q*(diff(diff(diff(u(x, t, a, b, q), x), x), x))+diff(u(x, t, a, b, q), t) = 0

(11)

Compute now the infinitesimals: note there are now three additional ones, related to continuous transformations of "a,b,"and q - for readability, avoid displaying the redundant functionality x, t, a, b, q, u on the left-hand sides of these infinitesimals

Infinitesimals(pde__xtabq, displayfunctionality = false)

[_xi[x] = (1/3)*(_F4(a, b, q)*q+_F3(a, b, q))*x/q+_F6(a, b, q)*t+_F7(a, b, q), _xi[t] = _F4(a, b, q)*t+_F5(a, b, q), _xi[a] = _F1(a, b, q), _xi[b] = _F2(a, b, q), _xi[q] = _F3(a, b, q), _eta[u] = (1/3)*((b*u+a)*_F3(a, b, q)-2*((b*u+a)*_F4(a, b, q)+(3/2)*u*_F2(a, b, q)+(3/2)*_F1(a, b, q)-(3/2)*_F6(a, b, q))*q)/(b*q)]

(12)

This result is more general than what is convenient for algebraic manipulations, so specialize the seven arbitrary functions of a, b, q and keep only the first symmetry that result from this specialization: that suffices to illustrate the removal of any of the three parameters a, b, or q

S := Library:-Specialize_Fn([_xi[x] = (1/3)*(_F4(a, b, q)*q+_F3(a, b, q))*x/q+_F6(a, b, q)*t+_F7(a, b, q), _xi[t] = _F4(a, b, q)*t+_F5(a, b, q), _xi[a] = _F1(a, b, q), _xi[b] = _F2(a, b, q), _xi[q] = _F3(a, b, q), _eta[u] = (1/3)*((b*u+a)*_F3(a, b, q)-2*((b*u+a)*_F4(a, b, q)+(3/2)*u*_F2(a, b, q)+(3/2)*_F1(a, b, q)-(3/2)*_F6(a, b, q))*q)/(b*q)])[1 .. 1]

[_xi[x] = 0, _xi[t] = 0, _xi[a] = 1, _xi[b] = 0, _xi[q] = 0, _eta[u] = -1/b]

(13)

To remove the parameters, as it is standard in the symmetry approach, compute a transformation to canonical coordinates, with respect to the parameter a. That means a transformation that changes the list of infinitesimals, or likewise its infinitesimal generator representation,

InfinitesimalGenerator(S, [u(x, t, a, b, q)])

proc (f) options operator, arrow; diff(f, a)-(diff(f, u))/b end proc

(14)

into [_xi[x] = 0, _xi[t] = 0, _xi[a] = 1, _xi[b] = 0, _xi[q] = 0, _eta[u] = 0] or its equivalent generator representation  proc (f) options operator, arrow; diff(f, a) end proc

That same transformation, when applied to pde__xtabq, entirely removes the parameter a.

The transformation is computed using CanonicalCoordinates and the last argument indicates the "independent variable" (in our case a parameter) that the transformation should remove. We choose to remove a

CanonicalCoordinates(S, [u(x, t, a, b, q)], [upsilon(xi, tau, alpha, beta, chi)], a)

{alpha = a, beta = b, chi = q, tau = t, xi = x, upsilon(xi, tau, alpha, beta, chi) = (b*u(x, t, a, b, q)+a)/b}

(15)

declare({alpha = a, beta = b, chi = q, tau = t, xi = x, upsilon(xi, tau, alpha, beta, chi) = (b*u(x, t, a, b, q)+a)/b})

` u`(x, t, a, b, q)*`will now be displayed as`*u

 

` upsilon`(xi, tau, alpha, beta, chi)*`will now be displayed as`*upsilon

(16)

Invert this transformation in order to apply it

solve({alpha = a, beta = b, chi = q, tau = t, xi = x, upsilon(xi, tau, alpha, beta, chi) = (b*u(x, t, a, b, q)+a)/b}, {a, b, q, t, x, u(x, t, a, b, q)})

{a = alpha, b = beta, q = chi, t = tau, x = xi, u(x, t, a, b, q) = (upsilon(xi, tau, alpha, beta, chi)*beta-alpha)/beta}

(17)

The next step is not necessary, but just to understand how all this works, verify its action over the infinitesimal generator proc (f) options operator, arrow; diff(f, a)-(diff(f, u))/b end proc

ChangeSymmetry({a = alpha, b = beta, q = chi, t = tau, x = xi, u(x, t, a, b, q) = (upsilon(xi, tau, alpha, beta, chi)*beta-alpha)/beta}, proc (f) options operator, arrow; diff(f, a)-(diff(f, u))/b end proc, [upsilon(xi, tau, alpha, beta, chi), xi, tau, alpha, beta, chi])

proc (f) options operator, arrow; diff(f, alpha) end proc

(18)

Now that we see the transformation (17) is the one we want, just use it to change variables in pde__xtabq

PDEtools:-dchange({a = alpha, b = beta, q = chi, t = tau, x = xi, u(x, t, a, b, q) = (upsilon(xi, tau, alpha, beta, chi)*beta-alpha)/beta}, pde__xtabq, [upsilon(xi, tau, alpha, beta, chi), xi, tau, alpha, beta, chi], simplify)

upsilon(xi, tau, alpha, beta, chi)*(diff(upsilon(xi, tau, alpha, beta, chi), xi))*beta+chi*(diff(diff(diff(upsilon(xi, tau, alpha, beta, chi), xi), xi), xi))+diff(upsilon(xi, tau, alpha, beta, chi), tau) = 0

(19)

As expected, this result depends only on two parameters, beta, and chi, and the one equivalent to a (that is alpha, see the transformation used (17)), is not present anymore.

To remove b or q we use the same steps, (15), (17) and (19), just changing the parameter to be removed, indicated as the last argument  in the call to CanonicalCoordinates . For example, to eliminate b (represented in the new variables by beta), input

CanonicalCoordinates(S, [u(x, t, a, b, q)], [upsilon(xi, tau, alpha, beta, chi)], b)

{alpha = b, beta = a, chi = q, tau = t, xi = x, upsilon(xi, tau, alpha, beta, chi) = (b*u(x, t, a, b, q)+a)/b}

(20)

solve({alpha = b, beta = a, chi = q, tau = t, xi = x, upsilon(xi, tau, alpha, beta, chi) = (b*u(x, t, a, b, q)+a)/b}, {a, b, q, t, x, u(x, t, a, b, q)})

{a = beta, b = alpha, q = chi, t = tau, x = xi, u(x, t, a, b, q) = (upsilon(xi, tau, alpha, beta, chi)*alpha-beta)/alpha}

(21)

PDEtools:-dchange({a = beta, b = alpha, q = chi, t = tau, x = xi, u(x, t, a, b, q) = (upsilon(xi, tau, alpha, beta, chi)*alpha-beta)/alpha}, pde__xtabq, [upsilon(xi, tau, alpha, beta, chi), xi, tau, alpha, beta, chi], simplify)

upsilon(xi, tau, alpha, beta, chi)*(diff(upsilon(xi, tau, alpha, beta, chi), xi))*alpha+chi*(diff(diff(diff(upsilon(xi, tau, alpha, beta, chi), xi), xi), xi))+diff(upsilon(xi, tau, alpha, beta, chi), tau) = 0

(22)

and as expected this result does not contain "beta. "To remove a second parameter, the whole cycle is repeated starting with computing infinitesimals, for instance for (22). Finally, the case of function parameters is treated analogously, by considering the function parameters as additional dependent variables instead of independent ones.

 


 

Download How_to_split_symmetries_into_cases_(II).mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Application developed using Maple and MapleSim. You can observe the vector analysis using Maple and the simulation using MapleSim. Also included a video of the result. It is a simple structure. A pole fastened by two cables and a force applied to the top. The results are to calculate tensions one and two. Consider the mass of each rope. In spanish.

POSTE_PARADO.zip

Lenin Araujo Castillo

Ambassador of Maple

 

I have noticed that there exists a Stack Exchange site for mathematica, and not for maple. My discussions with the part of Stack Exchange that handle the creation of a new Stack Exchange community have said that I must accrue a certain level of interest in the subject in order for it to be approved, and so I thought I would begin here to see if there is suffice level of interest.

This would not diminish the use of the Maple Primes forum, and an additional proposal, in consideration of the years of dedication that have gone into this domain, be to pool the data between the two, make reputation points the same on both, perhaps even user profiles and questions answered already linkable, and all of the questions already addressed here showing up in the search on both domains.

I am proposing this simply because I want to encourage the use of maple, and have noted that Stack Exchange is very popular. 

So I am posting this to get overall feedback from other Maple users, as to what their opinion is regarding this proposal, and advice on whether it should and how it ought to be pursued.

Integral Transforms (revamped) and PDEs

 

Integral transforms, implemented in Maple as the inttrans  package, are special integrals that appear frequently in mathematical-physics and that have remarkable properties. One of the main uses of integral transforms is for the computation of exact solutions to ordinary and partial differential equations with initial/boundary conditions. In Maple, that functionality is implemented in dsolve/inttrans  and in pdsolve/boundary conditions .

 

During the last months, we have been working heavily on several aspects of these integral transform functions and this post is about that. This is work in progress, in collaboration with Katherina von Bulow

 

The integral transforms are represented by the commands of the inttrans  package:

with(inttrans)

[addtable, fourier, fouriercos, fouriersin, hankel, hilbert, invfourier, invhilbert, invlaplace, invmellin, laplace, mellin, savetable, setup]

(1)

Three of these commands, addtable, savetable, and setup (this one is new, only present after installing the Physics Updates) are "administrative" commands while the others are computational representations for integrals. For example,

FunctionAdvisor(integral_form, fourier)

[fourier(a, b, z) = Int(a/exp(I*b*z), b = -infinity .. infinity), MathematicalFunctions:-`with no restrictions on `(a, b, z)]

(2)

FunctionAdvisor(integral_form, mellin)

[mellin(a, b, z) = Int(a*b^(z-1), b = 0 .. infinity), MathematicalFunctions:-`with no restrictions on `(a, b, z)]

(3)

For all the integral transform commands, the first argument is the integrand, the second one is the dummy integration variable of a definite integral and the third one is the evaluation point. (also called transform variable). The integral representation is also visible using the convert network

laplace(f(t), t, s); % = convert(%, Int)

laplace(f(t), t, s) = Int(f(t)*exp(-s*t), t = 0 .. infinity)

(4)

Having in mind the applications of these integral transforms to compute integrals and exact solutions to PDE with boundary conditions, five different aspects of these transforms received further development:

• 

Compute Derivatives: Yes or No

• 

Numerical Evaluation

• 

Two Hankel Transform Definitions

• 

More integral transform results

• 

Mellin and Hankel transform solutions for Partial Differential Equations with boundary conditions


The project includes having all these tranforms available at user level (not ready), say as FourierTransform for inttrans:-fourier, so that we don't need to input with(inttrans) anymore. Related to these changes we also intend to have Heaviside(0) not return undefined anymore, and return itself instead, unevaluated, so that one can set its value according to the problem/preferred convention (typically 0, 1/2 or 1) and have all the Maple library following that choice.

The material presented in the following sections is reproducible already in Maple 2019 by installing the latest Physics Updates (v.435 or higher),

Compute derivatives: Yes or No.

 

For historical reasons, previous implementations of these integral transform commands did not follow a standard paradigm of computer algebra: "Given a function f(x), the input diff(f(x), x) should return the derivative of f(x)". The implementation instead worked in the opposite direction: if you were to input the result of the derivative, you would receive the derivative representation. For example, to the input laplace(-t*f(t), t, s) you would receive d*laplace(f(t), t, s)/ds. This is particularly useful for the purpose of using integral transforms to solve differential equations but it is counter-intuitive and misleading; Maple knows the differentiation rule of these functions, but that rule was not evident anywhere. It was not clear how to compute the derivative (unless you knew the result in advance).

 

To solve this issue, a new command, setup, has been added to the package, so that you can set "whether or not" to compute derivatives, and the default has been changed to computederivatives = true while the old behavior is obtained only if you input setup(computederivatives = false). For example, after having installed the Physics Updates,

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 435 and is the same as the version installed in this computer, created 2019, October 1, 12:46 hours, found in the directory /Users/ecterrab/maple/toolbox/2019/Physics Updates/lib/`

(1.1)

the current settings can be queried via

setup(computederivatives)

computederivatives = true

(1.2)

and so differentiating returns the derivative computed

(%diff = diff)(laplace(f(t), t, s), s)

%diff(laplace(f(t), t, s), s) = -laplace(f(t)*t, t, s)

(1.3)

while changing this setting to work as in previous releases you have this computation reversed: you input the output (1.3) and you get the corresponding input

setup(computederivatives = false)

computederivatives = false

(1.4)

%diff(laplace(f(t), t, s), s) = -laplace(t*f(t), t, s)

%diff(laplace(f(t), t, s), s) = diff(laplace(f(t), t, s), s)

(1.5)

Reset the value of computederivatives

setup(computederivatives = true)

computederivatives = true

(1.6)

%diff(laplace(f(t), t, s), s) = -laplace(t*f(t), t, s)

%diff(laplace(f(t), t, s), s) = -laplace(f(t)*t, t, s)

(1.7)

In summary: by default, derivatives of integral transforms are now computed; if you need to work with these derivatives as in  previous releases, you can input setup(computederivatives = false). This setting can be changed any time you want within one and the same Maple session, and changing it does not have any impact on the performance of intsolve, dsolve and pdsolve to solve differential equations using integral transforms.

``

Numerical Evaluation

 

In previous releases, integral transforms had no numerical evaluation implemented. This is in the process of changing. So, for example, to numerically evaluate the inverse laplace transform ( invlaplace  command), three different algorithms have been implemented: Gaver-Stehfest, Talbot and Euler, following the presentation by Abate and Whitt, "Unified Framework for Numerically Inverting Laplace Transforms", INFORMS Journal on Computing 18(4), pp. 408–421, 2006.

 

For example, consider the exact solution to this partial differential equation subject to initial and boundary conditions

pde := diff(u(x, t), x) = 4*(diff(u(x, t), t, t))

iv := u(x, 0) = 0, u(0, t) = 1

 

Note that these two conditions are not entirely compatible: the solution returned cannot be valid for x = 0 and t = 0 simultaneously. However, a solution discarding that point does exist and is given by

sol := pdsolve([pde, iv])

u(x, t) = -invlaplace(exp(-(1/2)*s^(1/2)*t)/s, s, x)+1

(2.1)

Verifying the solution, one condition remains to be tested

pdetest(sol, [pde, iv])

[0, 0, -invlaplace(exp(-(1/2)*s^(1/2)*t)/s, s, 0)]

(2.2)

Since we now have numerical evaluation rules, we can test that what looks different from 0 in the above is actually 0.

zero := [0, 0, -invlaplace(exp(-(1/2)*s^(1/2)*t)/s, s, 0)][-1]

-invlaplace(exp(-(1/2)*s^(1/2)*t)/s, s, 0)

(2.3)

Add a small number to the initial value of t to skip the point t = 0

plot(zero, t = 0+10^(-10) .. 1)

 

The default method used is the method of Euler sums and the numerical evaluation is performed as usual using the evalf command. For example, consider

F := sin(sqrt(2*t))

 

The Laplace transform of F is given by

LT := laplace(F, t, s)

(1/2)*2^(1/2)*Pi^(1/2)*exp(-(1/2)/s)/s^(3/2)

(2.4)

and the inverse Laplace transform of LT in inert form is

ILT := %invlaplace(LT, s, t)

%invlaplace((1/2)*2^(1/2)*Pi^(1/2)*exp(-(1/2)/s)/s^(3/2), s, t)

(2.5)

At t = 1 we have

eval(ILT, t = 1)

%invlaplace((1/2)*2^(1/2)*Pi^(1/2)*exp(-(1/2)/s)/s^(3/2), s, 1)

(2.6)

evalf(%invlaplace((1/2)*2^(1/2)*Pi^(1/2)*exp(-(1/2)/s)/s^(3/2), s, 1))

.9877659460

(2.7)

This result is consistent with the one we get if we first compute the exact form of the inverse Laplace transform at t = 1:

%invlaplace((1/2)*2^(1/2)*Pi^(1/2)*exp(-(1/2)/s)/s^(3/2), s, 1) = value(%invlaplace((1/2)*2^(1/2)*Pi^(1/2)*exp(-(1/2)/s)/s^(3/2), s, 1))

%invlaplace((1/2)*2^(1/2)*Pi^(1/2)*exp(-(1/2)/s)/s^(3/2), s, 1) = sin(2^(1/2))

(2.8)

evalf(%invlaplace((1/2)*2^(1/2)*Pi^(1/2)*exp(-(1/2)/s)/s^(3/2), s, 1) = sin(2^(1/2)))

.9877659460 = .9877659459

(2.9)

In addition to the standard use of evalf to numerically evaluate inverse Laplace transforms, one can invoke each of the three different methods implemented using the MathematicalFunctions:-Evalf  command

with(MathematicalFunctions, Evalf)

[Evalf]

(2.10)

Evalf(%invlaplace((1/2)*2^(1/2)*Pi^(1/2)*exp(-(1/2)/s)/s^(3/2), s, 1), method = Talbot)

.9877659460

(2.11)

MF:-Evalf(%invlaplace((1/2)*2^(1/2)*Pi^(1/2)*exp(-(1/2)/s)/s^(3/2), s, 1), method = GaverStehfest)

.9877659460

(2.12)

MF:-Evalf(%invlaplace((1/2)*2^(1/2)*Pi^(1/2)*exp(-(1/2)/s)/s^(3/2), s, 1), method = Euler)

.9877659460

(2.13)

Regarding the method we use by default: from a numerical experiment with varied problems we have concluded that our implementation of the Euler (sums) method is faster and more accurate than the other two.

 

Two Hankel transform definitions

 


In previous Maple releases, the definition of the Hankel transform was given by

hankel(f(t), t, s, nu) = Int(f(t)*sqrt(s*t)*BesselJ(nu, s*t), t = 0 .. infinity)

where BesselJ(nu, s*t) is the BesselJ(nu, s*t) function. This definition, sometimes called alternative definition of the Hankel transform, has the inconvenience of the square root sqrt(s*t) in the integrand, complicating the form of the hankel transform for the Laplacian in cylindrical coordinates. On the other hand, the definition more frequently used in the literature is

 hankel(f(t), t, s, nu) = Int(f(t)*t*BesselJ(nu, s*t), t = 0 .. infinity)

With it, the Hankel transform of diff(u(r, t), r, r)+(diff(u(r, t), r))/r+diff(u(r, t), t, t) is given by the simple ODE form d^2*`&Hopf;`(k, t)/dt^2-k^2*`&Hopf;`(k, t). Not just this transform but several other ones acquire a simpler form with the definition that does not have a square root in the integrand.

So the idea is to align Maple with this simpler definition, while keeping the previous definition as an alternative. Hence, by default, when you load the inttrans package, the new definition in use for the Hankel transform is

hankel(f(t), t, s, nu); % = convert(%, Int)

hankel(f(t), t, s, nu) = Int(f(t)*t*BesselJ(nu, s*t), t = 0 .. infinity)

(3.1)

You can change this default so that Maple works with the alternative definition as in previous releases.  For that purpose, use the new inttrans:-setup command (which you can also use to query about the definition in use at any moment):

setup(alternativehankeldefinition)

alternativehankeldefinition = false

(3.2)

This change in definition is automatically taken into account by other parts of the Maple library using the Hankel transform. For example, the differentiation rule with the new definition is

(%diff = diff)(hankel(f(t), t, z, nu), z)

%diff(hankel(f(t), t, z, nu), z) = -hankel(t*f(t), t, z, nu+1)+nu*hankel(f(t), t, z, nu)/z

(3.3)

This differentiation rule resembles (is connected to) the differentiation rule for BesselJ, and this is another advantage of the new definition.

(%diff = diff)(BesselJ(nu, z), z)

%diff(BesselJ(nu, z), z) = -BesselJ(nu+1, z)+nu*BesselJ(nu, z)/z

(3.4)

Furthermore, several transforms have acquired a simpler form, as for example:

`assuming`([(%hankel = hankel)(exp(I*a*r)/r, r, k, 0)], [a > 0, k < a])

%hankel(exp(I*a*r)/r, r, k, 0) = 1/(-a^2+k^2)^(1/2)

(3.5)

Let's compare: make the definition be as in previous releases.

setup(alternativehankeldefinition = true)

alternativehankeldefinition = true

(3.6)

hankel(f(t), t, s, nu); % = convert(%, Int)

hankel(f(t), t, s, nu) = Int(f(t)*(s*t)^(1/2)*BesselJ(nu, s*t), t = 0 .. infinity)

(3.7)

The differentiation rule with the previous (alternative) definition was not as simple:

(%diff = diff)(hankel(f(t), t, s, nu), s)

%diff(hankel(f(t), t, s, nu), s) = -hankel(t*f(t), t, s, nu+1)+nu*hankel(f(t), t, s, nu)/s+(1/2)*hankel(f(t), t, s, nu)/s

(3.8)

And the transform (3.5) was also not so simple:

`assuming`([(%hankel = hankel)(exp(I*a*r)/r, r, k, 0)], [a > 0, k < a])

%hankel(exp(I*a*r)/r, r, k, 0) = (I*a*hypergeom([3/4, 3/4], [3/2], a^2/k^2)*GAMMA(3/4)^4+Pi^2*k*hypergeom([1/4, 1/4], [1/2], a^2/k^2))/(k*Pi*GAMMA(3/4)^2)

(3.9)

Reset to the new default value of the definition.

setup(alternativehankeldefinition = false)

alternativehankeldefinition = false

(3.10)

hankel(f(t), t, s, nu); % = convert(%, Int)

hankel(f(t), t, s, nu) = Int(f(t)*t*BesselJ(nu, s*t), t = 0 .. infinity)

(3.11)

More integral transform results

 

 

The revision of the integral transforms includes also filling gaps: previous transforms that were not being computed are now computed. Still with the Hankel transform, consider the operators

`D/t` := proc (u) options operator, arrow; (diff(u, t))/t end proc
formula_plus := t^(-nu)*(`D/t`@@m)(t^(m+nu)*u(t))

formula_minus := t^nu*(`D/t`@@m)(t^(m-nu)*u(t))

 

Being able to transform these operators into algebraic expressions or differential equations of lower order is key for solving PDE problems with Boundary Conditions.

 

Consider, for instance, this ODE

setup(computederivatives = false)

computederivatives = false

(4.1)

simplify(eval(formula_minus, [nu = 6, m = 3]))

((diff(diff(diff(u(t), t), t), t))*t^3-12*(diff(diff(u(t), t), t))*t^2+57*(diff(u(t), t))*t-105*u(t))/t^3

(4.2)

Its Hankel transform is a simple algebraic expression

hankel(((diff(diff(diff(u(t), t), t), t))*t^3-12*(diff(diff(u(t), t), t))*t^2+57*(diff(u(t), t))*t-105*u(t))/t^3, t, s, 6)

-s^3*hankel(u(t), t, s, 3)

(4.3)

An example with formula_plus

simplify(eval(formula_plus, [nu = 7, m = 4]))

((diff(diff(diff(diff(u(t), t), t), t), t))*t^4+38*(diff(diff(diff(u(t), t), t), t))*t^3+477*(diff(diff(u(t), t), t))*t^2+2295*(diff(u(t), t))*t+3465*u(t))/t^4

(4.4)

hankel(((diff(diff(diff(diff(u(t), t), t), t), t))*t^4+38*(diff(diff(diff(u(t), t), t), t))*t^3+477*(diff(diff(u(t), t), t))*t^2+2295*(diff(u(t), t))*t+3465*u(t))/t^4, t, s, 7)

s^4*hankel(u(t), t, s, 11)

(4.5)

In the case of hankel , not just differential operators but also several new transforms are now computable

hankel(1, r, k, nu)

piecewise(nu = 0, Dirac(k)/k, nu/k^2)

(4.6)

hankel(r^m, r, k, nu)

piecewise(And(nu = 0, m = 0), Dirac(k)/k, 2^(m+1)*k^(-m-2)*GAMMA(1+(1/2)*m+(1/2)*nu)/GAMMA((1/2)*nu-(1/2)*m))

(4.7)

NULL

Mellin and Hankel transform solutions for Partial Differential Equations with Boundary Conditions

 


In previous Maple releases, the Fourier and Laplace transforms were used to compute exact solutions to PDE problems with boundary conditions. Now, Mellin and Hankel transforms are also used for that same purpose.

 

Example:

pde := x^2*(diff(u(x, y), x, x))+x*(diff(u(x, y), x))+diff(u(x, y), y, y) = 0

iv := u(x, 0) = 0, u(x, 1) = piecewise(0 <= x and x < 1, 1, 1 < x, 0)

sol := pdsolve([pde, iv])

u(x, y) = invmellin(sin(s*y)/(sin(s)*s), s, x)

(5.1)


As usual, you can let pdsolve choose the solving method, or indicate the method yourself:

pde := diff(u(r, t), r, r)+(diff(u(r, t), r))/r+diff(u(r, t), t, t) = -Q__0*q(r)
iv := u(r, 0) = 0

pdsolve([pde, iv])

u(r, t) = Q__0*(-hankel(exp(-s*t)*hankel(q(r), r, s, 0)/s^2, s, r, 0)+hankel(hankel(q(r), r, s, 0)/s^2, s, r, 0))

(5.2)

It is sometimes preferable to see these solutions in terms of more familiar integrals. For that purpose, use

convert(u(r, t) = Q__0*(-hankel(exp(-s*t)*hankel(q(r), r, s, 0)/s^2, s, r, 0)+hankel(hankel(q(r), r, s, 0)/s^2, s, r, 0)), Int, only = hankel)

u(r, t) = Q__0*(-(Int(exp(-s*t)*(Int(q(r)*r*BesselJ(0, r*s), r = 0 .. infinity))*BesselJ(0, r*s)/s, s = 0 .. infinity))+Int((Int(q(r)*r*BesselJ(0, r*s), r = 0 .. infinity))*BesselJ(0, r*s)/s, s = 0 .. infinity))

(5.3)

An example where the hankel transform is computable to the end:

pde := c^2*(diff(u(r, t), r, r)+(diff(u(r, t), r))/r) = diff(u(r, t), t, t)
iv := u(r, 0) = A*a/(a^2+r^2)^(1/2), (D[2](u))(r, 0) = 0
NULL

`assuming`([pdsolve([pde, iv], method = Hankel)], [r > 0, t > 0, a > 0])

u(r, t) = (1/2)*A*a*((-c^2*t^2+(2*I)*a*c*t+a^2+r^2)^(1/2)+(-c^2*t^2-(2*I)*a*c*t+a^2+r^2)^(1/2))/((-c^2*t^2-(2*I)*a*c*t+a^2+r^2)^(1/2)*(-c^2*t^2+(2*I)*a*c*t+a^2+r^2)^(1/2))

(5.4)

``


 

Download Integral_Transforms_(revamped).mw

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

I’m very pleased to announce that we have just released the Maple Companion mobile app for iOS and Android phones. As its name implies, this free app is a complement to Maple. You can use it to take pictures of math you find out in the wild (e.g. in your handwritten notes, on a blackboard, in a textbook), and bring that math into Maple so you can get to work.

The Maple Companion lets you:

  • Avoid the mistakes that can occur when transcribing mathematical expressions into Maple manually
  • Save time when entering multiple equations into Maple, such as when you are checking your homework or pulling information from a reference book
  • Push math you’ll need later into Maple now, even if you don’t have your computer handy

The Maple Companion is an idea we started playing with recently. We believe it has interesting potential as a tool to help students learn math, and we’d really like your feedback to help shape its future direction. This first release is a step towards that goal, so you can try it out and start thinking about what else you would like to see from an app like this. Should it bring in entire documents? Integrate with tutors and Math Apps? Help students figure out where they went wrong when solving a problem? Let us know what you think!

Visit Maple Companion to learn more, link to the app stores so you can download the app, and access the feedback form. And of course, you are also welcome to give us your ideas in the comment section of this post.

Although the graph of a parametrized surface can be viewed and manipulated on the computer screen as a surface in 3D, it is not quite suitable for printing on a 3D printer since such a surface has zero thickness, and thus it does not correspond to physical object.

To produce a 3D printout of a surface, it needs to be endowed with some "thickness".  To do that, we move every point from the surface in the direction of that point's nomral vector by the amount ±T/2, where T is the desired thickness.  The locus of the points thus obtained forms a thin shell of thickness T around the original surface, thus making it into a proper solid. The result then may be saved into a file in the STL format and be sent to a 3D printner for reproduction.

The worksheet attached to this post provides a facility for translating a parametrized surface into an STL file.  It also provides a command for viewing the thickened object on the screen.  The details are documented within that worksheet.

Here are a few samples.  Each sample is shown twice—one as it appears within Maple, and another as viewed by loading the STL file into MeshLab which is a free mesh viewing/manipulation software.

 

Here is the worksheet that produced these:  thicken.mw

 

 

Analysis in Dynamics of Structures with Maplesim for Engineering
Here is the power of Maplesim in modeling and simulation. With Maplesim you can model structures at rest and dynamics. Considering real patterns of our world for better optimization.Project developed for students of Civil Engineering, Architecture, Mechatronics and all those professional careers related to structures.

CIMAC_UNALM_2019.pdf

Lenin Araujo Castillo

Ambassador of Maple

This post is closely related to the previous one  https://www.mapleprimes.com/posts/210930-Numbrix-Puzzle-By-The-Branch-And-Bound-Method  which presents the procedure  NumbrixPuzzle   that allows you to effectively solve these puzzles (the text of this procedure is also available in the worksheet below).  
This post is about generating these puzzles. To do this, we need the procedure  SerpentinePaths  (see below) , which allows us to generate a large number of serpentine paths in a matrix of a specified size, starting with a specified matrix element. Note that for a square matrix of the order  n , the number of such paths starting from [1,1] - position is the sequence  https://oeis.org/search?q=1%2C2%2C8%2C52%2C824&language=english&go=Search .

The required parameter of  SerpentinePaths procedure is the list  S , which defines the dimensions of the matrix. The optional parameter is the list  P  - this is the position of the number 1 (by default P=[1,1] ).
As an example below, we generate 20 puzzles of size 6 by 6. In exactly the same way, we can generate the desired number of puzzles for matrices of other sizes.


 

restart;

SerpentinePaths:=proc(S::list, P::list:=[1,1])
local OneStep, A, m, F, B, T, a;

OneStep:=proc(A::listlist)
local s, L, B, T, k, l;

s:=max[index](A);
L:=[[s[1]-1,s[2]],[s[1]+1,s[2]],[s[1],s[2]-1],[s[1],s[2]+1]];
T:=table(); k:=0;
for l in L do
if l[1]>=1 and l[1]<=S[1] and l[2]>=1 and l[2]<=S[2] and A[op(l)]=0 then k:=k+1; B:=subsop(l=a+1,A);
T[k]:=B fi;
od;
convert(T, list);
end proc;
A:=convert(Matrix(S[], {(P[])=1}), listlist);
m:=S[1]*S[2]-1;
B:=[$ 1..m];
F:=LM->ListTools:-FlattenOnce(map(OneStep, `if`(nops(LM)<=30000,LM,LM[-30000..-1])));
T:=[A];
for a in B do
T:=F(T);
od;
map(convert, T, Matrix);

end proc:
 

NumbrixPuzzle:=proc(A::Matrix)
local A1, L, N, S, MS, OneStepLeft, OneStepRight, F1, F2, m, L1, p, q, a, b, T, k, s1, s, H, n, L2, i, j, i1, j1, R;
uses ListTools;
S:=upperbound(A); N:=nops(op(A)[3]); MS:=`*`(S);
A1:=convert(A, listlist);
for i from 1 to S[1] do
for j from 1 to S[2] do
for i1 from i to S[1] do
for j1 from 1 to S[2] do
if A1[i,j]<>0 and A1[i1,j1]<>0 and abs(A1[i,j]-A1[i1,j1])<abs(i-i1)+abs(j-j1) then return `no solutions` fi;
od; od; od; od;
L:=sort(select(e->e<>0, Flatten(A1)));
L1:=[`if`(L[1]>1,seq(L[1]-k, k=0..L[1]-2),NULL)];
L2:=[seq(seq(`if`(L[i+1]-L[i]>1,L[i]+k,NULL),k=0..L[i+1]-L[i]-2), i=1..nops(L)-1), `if`(L[-1]<MS,seq(L[-1]+k,k=0..MS-L[-1]-1),NULL)];
OneStepLeft:=proc(A1::listlist)
local s, M, m, k, T;
uses ListTools;
s:=Search(a, Matrix(A1));   
M:=[[s[1]-1,s[2]],[s[1]+1,s[2]],[s[1],s[2]-1],[s[1],s[2]+1]];
T:=table(); k:=0;
for m in M do
if m[1]>=1 and m[1]<=S[1] and m[2]>=1 and m[2]<=S[2] and A1[op(m)]=0 then k:=k+1; T[k]:=subsop(m=a-1,A1);
fi;
od;
convert(T, list);
end proc;
OneStepRight:=proc(A1::listlist)
local s, M, m, k, T, s1;
uses ListTools;
s:=Search(a, Matrix(A1));  s1:=Search(a+2, Matrix(A1));  
M:=[[s[1]-1,s[2]],[s[1]+1,s[2]],[s[1],s[2]-1],[s[1],s[2]+1]];
T:=table(); k:=0;
for m in M do
if m[1]>=1 and m[1]<=S[1] and m[2]>=1 and m[2]<=S[2] and A1[op(m)]=0 and `if`(a+2 in L, `if`(is(abs(s1[1]-m[1])+abs(s1[2]-m[2])>1),false,true),true) then k:=k+1; T[k]:=subsop(m=a+1,A1);
fi;
od;
convert(T, list);   
end proc;
F1:=LM->ListTools:-FlattenOnce(map(OneStepLeft, LM));
F2:=LM->ListTools:-FlattenOnce(map(OneStepRight, LM));
T:=[A1];
for a in L1 do
T:=F1(T);
od;
for a in L2 do
T:=F2(T);
od;
R:=map(t->convert(t,Matrix), T);
if nops(R)=0 then return `no solutions` else R fi;
end proc:


Simple examples

SerpentinePaths([3,3]);  # All the serpentine paths for the matrix  3x3, starting with [1,1]-position
SerpentinePaths([3,3],[1,2]);  # No solutions if the start with [1,2]-position
SerpentinePaths([4,4]):  # All the serpentine paths for the matrix  4x4, starting with [1,1]-position
nops(%);
nops(SerpentinePaths([4,4],[1,2]));  # The number of all the serpentine paths for the matrix  4x4, starting with [1,2]-position
nops(SerpentinePaths([4,4],[2,2]));  # The number of all the serpentine paths for the matrix  4x4, starting with [2,2]-position

[Matrix(3, 3, {(1, 1) = 1, (1, 2) = 6, (1, 3) = 7, (2, 1) = 2, (2, 2) = 5, (2, 3) = 8, (3, 1) = 3, (3, 2) = 4, (3, 3) = 9}), Matrix(3, 3, {(1, 1) = 1, (1, 2) = 8, (1, 3) = 7, (2, 1) = 2, (2, 2) = 9, (2, 3) = 6, (3, 1) = 3, (3, 2) = 4, (3, 3) = 5}), Matrix(3, 3, {(1, 1) = 1, (1, 2) = 8, (1, 3) = 9, (2, 1) = 2, (2, 2) = 7, (2, 3) = 6, (3, 1) = 3, (3, 2) = 4, (3, 3) = 5}), Matrix(3, 3, {(1, 1) = 1, (1, 2) = 4, (1, 3) = 5, (2, 1) = 2, (2, 2) = 3, (2, 3) = 6, (3, 1) = 9, (3, 2) = 8, (3, 3) = 7}), Matrix(3, 3, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 9, (2, 1) = 4, (2, 2) = 3, (2, 3) = 8, (3, 1) = 5, (3, 2) = 6, (3, 3) = 7}), Matrix(3, 3, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 3, (2, 1) = 8, (2, 2) = 7, (2, 3) = 4, (3, 1) = 9, (3, 2) = 6, (3, 3) = 5}), Matrix(3, 3, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 3, (2, 1) = 8, (2, 2) = 9, (2, 3) = 4, (3, 1) = 7, (3, 2) = 6, (3, 3) = 5}), Matrix(3, 3, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 3, (2, 1) = 6, (2, 2) = 5, (2, 3) = 4, (3, 1) = 7, (3, 2) = 8, (3, 3) = 9})]

 

[]

 

52

 

25

 

36

(1)


Below we find 12,440 serpentine paths in the matrix  6x6 starting from various positions (the set  L )

k:=0:  n:=6:
for i from 1 to n do
for j from i to n do
k:=k+1; S[k]:=SerpentinePaths([n,n],[i,j])[];
od: od:
L1:={seq(S[i][], i=1..k)}:
L2:=map(A->A^%T, L1):
L:=L1 union L2:
nops(L);

12440

(2)


Further, using the list  L, we generate 20 examples of Numbrix puzzles with the unique solutions

T:='T':
N:=20:
M:=[seq(L[i], i=combinat:-randcomb(nops(L),N))]:
for i from 1 to N do
for k from floor(n^2/4) do
T[i]:=Matrix(n,{seq(op(M[i])[3][j], j=combinat:-randcomb(n^2,k))});
if nops(NumbrixPuzzle(T[i]))=1 then break; fi;
od:  od:
T:=convert(T,list):
T1:=[seq([seq(T[i+j],i=1..5)],j=[0,5,10,15])]:
DocumentTools:-Tabulate(Matrix(4,5, (i,j)->T1[i,j]), fillcolor = "LightYellow", width=95):


The solutions of these puzzles

DocumentTools:-Tabulate(Matrix(4,5, (i,j)->NumbrixPuzzle(T1[i,j])[]), fillcolor = "LightYellow", width=95):

 


For some reason, these 20 examples and their solutions did not load here.

 Edit. I separately inserted these generated 20 puzzles as a picture:

 

Download SerpPathsinMatrix.mw

 


 

WE20 Oceanography Historical Perspective

 

Maple is a trademark of Waterloo Maple Inc.

 

Adapted from Introductory Oceanography 10th ed. by Harold V. Thurman and Alan P. Trujillo

 

1.  How did the view of the ocean by early Mediterranean cultures influence the naming of planet Earth?

 

Early cultures envisioned the world as composed of large landmasses surrounded by marginal bodies of water.

 

2.  What is the difference between an ocean and a sea?  Which ones are the seven seas?

 

A sea is

   •  Smaller and shallower than an ocean (this is why the Arctic Ocean might be more appropriately considered a sea)

   •  Composed of salt water (many "seas" such as the Caspian Sea in Asia, are actually large fresh water lakes)

   •  Somewhat enclosed by land (but some seas, such as the Sargasso Sea in the Atlantic Ocean, are defined by strong ocean currents rather than land.

 

The seven seas:  the North Pacifiic, the South Pacific, the North Atlantic, the South Atlantic, the Indian, the Arctic, and the Southern or Antarctic.

 

3.  Describe the development of navigation techniques that have enabled sailors to navigate the open ocean far from land.

 

Initially, navigators in the Northern Hemisphere measured the angle between the horizon and the North Star (Polaris), which is directly above the North Pole.  Latitude could be determined by noting the angular difference between the horizon and the North Star.  In the Southern Hemisphere, the angle between the horizon and the Southern Cross was used because the Southern Cross is directly overhead at the South Pole.

 

There was no method of determining longitude until one based on time was developed at the end of the 18th century.  Pendulum-driven clocks in use in the early 1700s would not work for long on a rocking ship at sea.  In 1728 a cabinetmaker in Lincolnshire, England, named John Harrison, began working on a new type of time peace.  The "chronometer" was driven by a helical balance spring that remained horizontal and independent of ship motion.

 

As Earth turns on its rotational axis it moves through 2Pi radian every 24 hours (one complete rotation).  Earth, therefore, rotates through (1/12)*Pi radian of longitude per hour.  As a result, a navigator need only know the time at the prime or Greenwich at the exact same time the sun is at its highest point (local noon) at the ship's location.

 

Suppose a ship sets sail west across the Atlantic Ocean from Europe, checking its longitude each day when the sun is at its highest point (solar noon) at the ship's location.  On one day the chronometer reads 16:18 hours.  What is the location of the ship?

 

The ship is 4 hours and 18 minutes behind (west of) Greenwich time.  To determine the longitude we must convert time into longitude.  

 

(1/12)*Pi radian of longitude per hour

(1/12)*Pi*(1/60) = (1/720)*Piradian of longitude per minute

(1/720)*Pi*(1/60) = (1/43200)*Piradian of longitude per second

 

4*((1/12)*Pi)+18*((1/720)*Pi) = 43*Pi*(1/120)

 

180*(43*Pi*(1/120))/Pi = 7740*(1/120) and 7740*(1/120) = 129/2 and 129/2 = 64.5degree west of the Greenwich meridian.

 

In Maple:

dg := proc (hr, mn, sc) local r, d, d_dec; r := (1/12)*hr*Pi+(1/720)*mn*Pi+(1/4320)*sc*Pi; d := 180*r/Pi; d_dec := evalf[5](d); print(d, d_dec) end proc

dg(4, 18, 0)

129/2, 64.500

(1)

4.  Construct a time line that includes the major events of human history that have resulted in greater understanding of our planet in general and the oceans in particular.

 

 

 

 

 

 

5.  Using a diagram, illustrate the method used by Eratosthenes to calculate the circumference of Earth.

 

Eratoshenes (276–192 BCE) had heard that at noon on the longest day of the year the Sun shone directly into the waters of a deep,vertical well in Syene (Aswan), which was 800 kilometers (500 miles) to the south.  At the same time in Alexandria, he noticed a vertical pole cast a slight shadow when the Sun was at its apex in the sky over Alexandria.  He accurately measured the shadow the pole cast, which was 7.2 degree.

 

Convert 7.2 ° to radian  alpha^R = ((1/180)*Pi*`#msup(mi("&alpha;",fontstyle = "normal"),mo("&compfn;"))`*Pi)*`#msup(mn("7.2"),mo("&compfn;"))` and ((1/180)*Pi*`#msup(mi("&alpha;",fontstyle = "normal"),mo("&compfn;"))`*Pi)*`#msup(mn("7.2"),mo("&compfn;"))` = (1/25)*Pi

7.2*(1/180)

0.4000000000e-1

(2)

convert(0.4000000000e-1, 'rational', 'exact')

1/25

(3)

(2*Pi*800)*km/((1/25)*Pi) = 40000*km

(2*Pi*800)/((1/25)*Pi)

40000

(4)

 The equatorial circumference of Earth is about 24,901 miles (40,075 km). However, from pole-to-pole — the meridional circumference — Earth is only 24,860 miles (40,008 km) around. This shape, caused by the flattening at the poles, is called an oblate spheroid.  Since Eratoshenes was calculating the meridional circumference, his calculation was only 8 km different from the accepted modern measurement.

 

The following calculations are for the diagram.

  

NULLNULL`implies`(40000/(2*Pi) = 20000*alpha/Pi and 20000*alpha/Pi = (1/25)*Pi*sin(alpha) and (1/25)*Pi*sin(alpha) = y/c, c*sin(alpha) = y)

`&approx;`(20000*sin((1/25)*Pi)/Pi, 798*kg)NULLNULL

20000*sin((1/25)*Pi)/Pi

20000*sin((1/25)*Pi)/Pi

(5)

evalf[10](20000*sin((1/25)*Pi)/Pi)

797.8961462

(6)

`implies`(tan(alpha) = y/x implies tan(alpha)/y = 1/x, y/tan(alpha) = 20000*x*sin((1/25)*Pi)/(Pi*tan((1/25)*Pi)) and `&approx;`(20000*x*sin((1/25)*Pi)/(Pi*tan((1/25)*Pi)), 6316*km))

20000*sin((1/25)*Pi)/(Pi*tan((1/25)*Pi))

20000*sin((1/25)*Pi)/(Pi*tan((1/25)*Pi))

(7)

evalf[10](20000*sin((1/25)*Pi)/(Pi*tan((1/25)*Pi)))

6315.998350

(8)

NULL

 

with(plottools); with(plots)

p1 := circle([0, 0], 20000/Pi)

p2 := line([0, 0], [6316, 798])

p3 := line([0, 0], [6316, 0])

p4 := pointplot([[6316, 0], [6316, 798]], color = yellow, symbol = solidcircle, symbolsize = 25, transparency = .3)

p5 := textplot({[4400, -600, "Syene (Aswan)"], [4400, 1300, "Alexandria"]}, font = [Perpetua, bold, 18])

display(p1, p2, p3, p4, p5, scaling = constrained, size = [350, 350], axes = none)

 

 

6.  While the Arabs dominated the Mediterranean region during the Middle Ages, what were the most significant ocean-related events taking place in Europe?

 

Between 831 and 1071, the Emirate of Sicily was one of the major centers of Islamic culture in the Mediterranean. After its conquest by the Christian Normans, the island developed its own distinct culture with the fusion of Latin and Byzantine influences. Palermo remained a leading artistic and commercial center of the Mediterranean well into the Middle Ages.

 

Europe was reviving, however, as more organized and centralized states began to form in the later Middle Ages after the Renaissance of the 12th century. Motivated by religion and dreams of conquest, the kings of Europe launched a number of Crusades to try to roll back Muslim power and retake the holy land. The Crusades were unsuccessful in this goal, but they were far more effective in weakening the already tottering Byzantine Empire that began to lose increasing amounts of territory to the Seljuk Turks and later to the Ottoman Turks. They also rearranged the balance of power in the Muslim world as Egypt once again emerged as a major power in the eastern Mediterranean.

 

7.  Describe the important events in oceanography that occurred during the Age of Discovery in Europe.

 

One of the most famous voyages during the Age of Discovery began in 1768 when the HMS Endeavour left Portsmouth, England, under the command of Captain James Cook. Over 10 years Cook led three world-encircling expeditions and mapped many countries, including Australia, New Zealand and the Hawaiian Islands. He was an expert seaman, navigator and scientist who made keen observations wherever he went. He was also one of the first ship captains to recognize that a lack of Vitamin C in sailors’ diets (due mostly to a lack of fresh fruit) caused scurvy, a serious disease that killed many sailors in those times. Cook always sailed with lots of pickled cabbage, which he insisted that the sailors eat. Scurvy was never a problem on his ships because the cabbage contained lots of Vitamin C.

 

8.  List some of the major achievements of Captain James Cook.

.com

Three important voyages commanded by Captain Cook:  

1771–1768  Endeavor observes the transit of Venus in Tahiti; charts New Zealand; charts the eastern coastline of Australia and continues on to New Guinea and Java.

 

1772–1776 Resolution crosses the Anartic circle for the first time in history.  On returning to England Cook writes about preventing scurvy on long voyages.

 

1776–1779 Resolution and Discovery visit New Zealand, Tonga, Tahiti, and Christmas Island; Hawaiian islands discovered; expedition crosses the Pacific eastwards to make landfall off the coast of Oregon.  Cook sails into the Bering Straits but foiled by ice he returns to Hawaii where he is killed by natives on 14 Feb 1779.

 

9.  Describe, in general, the voyages of  HMS Challenger and HMS Beagle.

 

The Beagle sailed from Plymouth Sound on 27 December 1831 under the command of Captain Robert FitzRoy. While the expedition was originally planned to last two years, it lasted almost five—the Beagle did not return until 2 October 1836. Darwin spent most of this time exploring on land (three years and three months on land; 18 months at sea). The book he wrote is a vivid travel memoir as well as a detailed scientific field journal covering biology, geology, and anthropology that demonstrates Darwin's keen powers of observation, written at a time when Western Europeans were exploring and charting the whole world.

 

Darwin's notes made during the voyage include comments hinting at his changing views on the inflexibility of species. On his return to England, he wrote the book based on these notes, at a time when he was first developing his theories of evolution through common descent and natural selection. The book includes some suggestions of his ideas, particularly in the second edition of 1845 (Thurman and Trujillo, p. 23).

 

On December 21, 1872 the HMS. Challenger sailed from Portsmouth, England, for an epic voyage which would last almost three and a half years. It  was the first expedition organized and funded for a specific scientific purpose: to examine the deep-sea floor and answer questions about the ocean environment.  Although the mission was scientific, another purpose was to collect information that could be used in the laying of communication cables along the sea floor.

 

The expedition covered 69,000 miles (about 130,000 km) and gathered data on currents, water chemistry, temperature, bottom deposits and marine life at 362 oceanographic stations. More than 4700 new species of marine animals were discovered during the course of the voyage, many of which were found on the seafloor – an environment that scientists originally believed to be too inhospitable to support life (https://paleonerdish.wordpress.com/2013/07/01/the-challenger-expedition-and-the-beginning-of-oceanography/).

 

10.  Describe the voyages of the Fram and how it helped prove there was no continent beneath the Arctic ice pack.

 

The Fram was the first ship specially built (in Norway) for polar research. She was used on three important expeditions: with Fridtjof Nansen on a drift over the Arctic Ocean 1893-96, with Otto Sverdrup to the arctic archipelago west of Greenland - now the Nunavut region of Canada - 1898-1902, and with Roald Amundsen to Antarctica for his South Pole expedition 1910-12. The Fram is now housed and exhibited in the Fram Museum at Bygdøynes, Oslo

(https://frammuseum.no/polar_history/vessels/the_polar_ship_fram/).

 

11.  Why did Benjamin Franklin want to know about the surface current pattern in the North Atlantic Ocean?

 

As Deputy Postmaster General of the American colonies, Franklin promoted using the Gulf Stream to speed up delivery of mail from America to Europe, as well as to improve other commercial shipping (https://divediscover.whoi.edu/history-of-oceanography/benjamin-franklin-discovering-the-gulf-stream/).

 

12.  What was Alexander Agassiz's major contribution to an increased knowledge of the oceans?

 

Agassiz is widely acknowledged as the driving force that brought oceanography recognition as a science.  His training as a mining engineer led him to develop ingenious oceanographic sampling devices—the prototypes for many devices in use on research vessels today—that improved the quantitative value of biological sampling (Thurman and Trujillo, p. 27).

 

13.  What important oceanographic inventions and data came out of Word Wars I and II?

The need to detect submarines led the navies of the world to greatly expand their studies of the sea. This led to the founding of oceanography departments at state universities, including Oregon State, Texas A&M University, University of Miami, and University of Rhode Island,

and the founding of national ocean laboratories such as the various Institutes of Oceanographic Science (https://earthweb.ess.washington.edu/booker/ESS514/stewart/ stewart_ocean_book.pdf).

 

14.  List features of the oceans that can be studied remotely by use of satellites.

 

• phytoplankton concentrations

• heat storage and aerosol formation and other ocean influences on climate processes

• cycles of carbon, sulfur, and nitrogen concentrations

(https://www.nrcan.gc.ca/earth-sciences/geomatics/satellite-imagery-air-photos/satellite-imagery-products/educational-resources/9359).

• Bathymetry/Seafloor (Bathymetry is the measurement of depth of water in oceans seas, or lakes)

• Topography

• Costal Process

• Marine Geophysics

• Ocean Acoustics

• Ocean Chemistry

• Ocean Circulation

• Ocean Heat Budget

• Ocean Optics

• Ocean Pressure

• Ocean Temperature

• Ocean Waves

• Ocean Winds

• Salinity/Density

• Sea ice

• Sea Surface Topography

(https://earthdata.nasa.gov/learn/discipline/ocean)

 

15.  Discuss what problems the human body can experience as a result of diving underwater.

 

Nitrogen narcosis (also referred to as inert gas narcosis, raptures of the deep, and the Martini effect) :  While scuba diving does sometimes involve breathing air that’s mixed with nitrogen, this condition is caused when the diver goes deeper into the water, where the partial pressure of nitrogen increases and more nitrogen ends up getting absorbed into the bloodstream. The higher the nitrogen concentration in the bloodstream, the slower the nervous system will be, and the more likely the diver will experience intoxicating effects that can seriously impair their judgment underwater—possibly enough to lead them into dangerous situations (https://www.leisurepro.com/blog/scuba-guides/dealing-nitrogen-narcosis-2/).

 

Barotrauma: Trauma caused by rapid or extreme changes in air pressure, especially affecting enclosed cavities within the body such as the middle ear (otic barotrauma), the sinuses (sinus barotrauma), and the lungs (pulmonary barotrauma) (https://www.medicinenet.com/script/main/art.asp?articlekey=31722).

 

Decompression illness is caused by intravascular or extravascular bubbles that are formed as a result of reduction in environmental pressure (decompression). The term covers both arterial gas embolism, in which alveolar gas or venous gas emboli (via cardiac shunts or via pulmonary vessels) are introduced into the arterial circulation, and decompression sickness, which is caused by in-situ bubble formation from dissolved inert gas. Both syndromes can occur in divers, compressed air workers, aviators, and astronauts, but arterial gas embolism also arises from iatrogenic causes unrelated to decompression. Risk of decompression illness is affected by immersion, exercise, and heat or cold. Manifestations range from itching and minor pain to neurological symptoms, cardiac collapse, and death. First-aid treatment is 100% oxygen and definitive treatment is recompression to increased pressure, breathing 100% oxygen. Adjunctive treatment, including fluid administration and prophylaxis against venous thromboembolism in paralysed patients, is also recommended. Treatment is, in most cases, effective although residual deficits can remain in serious cases, even after several recompressions (https://www.thelancet.com/journals/lancet/article/PIIS0140-6736(10)61085-9/fulltext).


 

Download WE20_Oceanography_Historical_Persepceive.mw

I experienced a significant obstacle while trying to generate independent random samples with Statistics:-Sample on different nodes of a Grid multi-processing environment. After many hours of trial-and-error, I discovered an astonishing workaround, and I achieved excellent time and memory performance. Since this seems like a generally useful computation, I thought that it was worthy of a Post.

This Post is also worth reading to learn how to use Grid when you need to initialize a substantial environment on each node before using Grid:-Map or Grid:-Seq.

All remaining details are in the following worksheet.
 

How to use Statistics:-Sample in the `Grid` environment

Author: Carl Love <carl.j.love@gmail.com> 1 August 2019

 

I experienced a significant obstacle while trying to generate indenpendent random samples with Statistics:-Sample on the nodes of a multi-processor Grid (on a single computer). After several hours of trial-and-error, I discovered that two things are necessary to do this:

1. 

The random number generator needs to be seeded differently in each node. (The reason for this is easy to understand.)

2. 

The random variables generated by Statistics:-RandomVariable need to have different names in each node. This one is mind-boggling to me. Afterall, each node has its own kernel and so its own memory It's as if the names of random variables are stored in a disk file which all kernels access. And also the generator has been seeded differently in each node.

 

Once these things were done, the time and memory performance of the computation were excellent.

restart
:

Digits:= 15
:

#Specify the size of the computation:
(n1,n2,n3):= (100, 100, 1000):
# n1 = size of each random sample;
# n2 = number of samples in a batch;
# n3 = number of batches.

#
#Procedure to initialize needed globals on each node:
Init:= proc(n::posint)
local node:= Grid:-MyNode();
   #This is wrapped in parse so that it'll act globally. Otherwise, an environment
   #variable would be reset when this procedure ends.
   parse("Digits:= 15;", 'statement');

   randomize(randomize()+node); #Initialize independent RNG for this node.
   #If repeatability of results is desired, remove the inner randomize().

   (:-X,:-Y):= Array(1..n, 'datatype'= 'hfloat') $ 2;

   #Perhaps due to some oversight in the design of Statistics, it seems necessary that
   #r.v.s in different nodes **need different names** in order to be independent:
   N||node:= Statistics:-RandomVariable('Normal'(0,1));
   :-TRS:= (X::rtable)-> Statistics:-Sample(N||node, X);
   #To verify that different names are needed, change N||node to N in both lines.
   #Doing so, each node will generate identical samples!

   #Perform some computation. For the pedagogical purpose of this worksheet, all that
   #matters is that it's some numeric computation on some Arrays of random Samples.
   :-GG:= (X::Array, Y::Array)->
      evalhf(
         proc(X::Array, Y::Array, n::posint)
         local s, k, S:= 0, p:= 2*Pi;
            for k to n do
               s:= sin(p*X[k]);  
               S:= S + X[k]^2*cos(p*Y[k])/sqrt(2-sin(s)) + Y[k]^2*s
            od
         end proc
         (X, Y, n)
      )      
   ;
   #Perform a batch of the above computations, and somehow numerically consolidate the
   #results. Once again, pedagogically it doesn't matter how they're consolidated.  
   :-TRX1:= (n::posint)-> add(GG(TRS(X), TRS(Y)), 1..n);
   
   #It doesn't matter much what's returned. Returning `node` lets us verify that we're
   #actually running this on a grid.
   return node
end proc
:

The procedure Init above uses the :- syntax to set variables globally for each node. The variables set are X, Y, N||node, TRS, GG, and TRX1. Names constructed by concatenation, such as N||node, are always global, so :- isn't needed for those.

#
#Time the initialization:
st:= time[real]():
   #Send Init to each node, but don't run it yet:
   Grid:-Set(Init)
   ;
   #Run Init on each node:
   Nodes:= Grid:-Run(Init, [n1], 'wait');
time__init_Grid:= time[real]() - st;

Array(%id = 18446745861500764518)

1.109

The only purpose of array Nodes is that it lets us count the nodes, and it lets us verify that Grid:-MyNode() returned a different value on each node.

num_nodes:= numelems(Nodes);

8

#Time the actual execution:
st:= time[real]():
   R1:= [Grid:-Seq['tasksize'= iquo(n3, num_nodes)](TRX1(k), k= [n2 $ n3])]:
time__run_Grid:= time[real]() - st

4.440

#Just for comparison, run it sequentially:
st:= time[real]():
   Init(n1):
time__init_noGrid:= time[real]() - st;

st:= time[real]():
   R2:= [seq(TRX1(k), k= [n2 $ n3])]:
time__run_noGrid:= time[real]() - st;

0.16e-1

24.483

R1 and R2 will be different because different random numbers were used, but they should have similar histograms.

plots:-display(
   Statistics:-Histogram~(
      <R1 | R2>, #side-by-side plots
      'title'=~ <<"With Grid\n"> | <"Without Grid\n">>,
      'gridlines'= false
   )
);

(Plot output deleted because MaplePrimes cannot handle side-by-side plots!)

They look similar enough to me!

 

Let's try to quantify the benefit of using Grid:

speedup_factor:= time__run_noGrid / time__run_Grid;

5.36319824753560

Express that as a fraction of the theoretical maximum speedup:

efficiency:= speedup_factor / num_nodes;

.670399780941950

I think that that's really good!

 

The memory usage of this code is insignificant, which can be verified from an external memory monitor such as Winodws Task Manager. It's just a little bit more than that needed to start a kernel on each node. It's also possible to measure the memory usage programmatically. Doing so for a Grid:-Seq computation is a little bit beyond the scope of this worksheet.

 


 

Download GridRandSample.mw

Here are the histograms:

In this post, the Numbrix Puzzle is solved by the branch and bound method (see the details of this puzzle in  https://www.mapleprimes.com/posts/210643-Solving-A-Numbrix-Puzzle-With-Logic). The main difference from the solution using the  Logic  package is that here we get not one but all possible solutions. In the case of a unique solution, the  NumbrixPuzzle procedure is faster than the  Numbrix  one (for convenience, I inserted the code for Numbrix procedure into the worksheet below). In the case of many solutions, the  Numbrix  procedure is usually faster (see all the examples below).

 

restart;

NumbrixPuzzle:=proc(A::Matrix)
local A1, L, N, S, MS, OneStepLeft, OneStepRight, F1, F2, m, L1, p, q, a, b, T, k, s1, s, H, n, L2, i, j, i1, j1, R;
uses ListTools;
S:=upperbound(A); N:=nops(op(A)[3]); MS:=`*`(S);
A1:=convert(A, listlist);
for i from 1 to S[1] do
for j from 1 to S[2] do
for i1 from i to S[1] do
for j1 from 1 to S[2] do
if A1[i,j]<>0 and A1[i1,j1]<>0 and abs(A1[i,j]-A1[i1,j1])<abs(i-i1)+abs(j-j1) then return `no solutions` fi;
od; od; od; od;
L:=sort(select(e->e<>0, Flatten(A1)));
L1:=[`if`(L[1]>1,seq(L[1]-k, k=0..L[1]-2),NULL)];
L2:=[seq(seq(`if`(L[i+1]-L[i]>1,L[i]+k,NULL),k=0..L[i+1]-L[i]-2), i=1..nops(L)-1), `if`(L[-1]<MS,seq(L[-1]+k,k=0..MS-L[-1]-1),NULL)];
  

OneStepLeft:=proc(A1::listlist)
local s, M, m, k, T;
uses ListTools;
s:=Search(a, Matrix(A1));   
M:=[[s[1]-1,s[2]],[s[1]+1,s[2]],[s[1],s[2]-1],[s[1],s[2]+1]];
T:=table(); k:=0;
for m in M do
if m[1]>=1 and m[1]<=S[1] and m[2]>=1 and m[2]<=S[2] and A1[op(m)]=0 then k:=k+1; T[k]:=subsop(m=a-1,A1);
fi;
od;
convert(T, list);
end proc;

 
OneStepRight:=proc(A1::listlist)
local s, M, m, k, T, s1;
uses ListTools;
s:=Search(a, Matrix(A1));  s1:=Search(a+2, Matrix(A1));  
M:=[[s[1]-1,s[2]],[s[1]+1,s[2]],[s[1],s[2]-1],[s[1],s[2]+1]];
T:=table(); k:=0;
for m in M do
if m[1]>=1 and m[1]<=S[1] and m[2]>=1 and m[2]<=S[2] and A1[op(m)]=0 and `if`(a+2 in L, `if`(is(abs(s1[1]-m[1])+abs(s1[2]-m[2])>1),false,true),true) then k:=k+1; T[k]:=subsop(m=a+1,A1);
fi;
od;
convert(T, list);   
end proc;

F1:=LM->ListTools:-FlattenOnce(map(OneStepLeft, LM));
F2:=LM->ListTools:-FlattenOnce(map(OneStepRight, LM));

T:=[A1];
for a in L1 do
T:=F1(T);
od;

for a in L2 do
T:=F2(T);
od;

R:=map(t->convert(t,Matrix), T);
if nops(R)=0 then return `no solutions` else R[] fi;

end proc:

Numbrix := proc( M :: ~Matrix, { inline :: truefalse := false } )

local S, adjacent, eq, i, initial, j, k, kk, m, n, one, single, sol, unique, val, var, x;

    (m,n) := upperbound(M);

    initial := &and(seq(seq(ifelse(M[i,j] = 0
                                   , NULL
                                   , x[i,j,M[i,j]]
                                  )
                            , i = 1..m)
                        , j = 1..n));

    adjacent := &and(seq(seq(seq(x[i,j,k] &implies &or(NULL
                                                       , ifelse(i>1, x[i-1, j, k+1], NULL)
                                                       , ifelse(i<m, x[i+1, j, k+1], NULL)
                                                       , ifelse(j>1, x[i, j-1, k+1], NULL)
                                                       , ifelse(j<n, x[i, j+1, k+1], NULL)
                                                      )
                                 , i = 1..m)
                             , j = 1..n)
                         , k = 1 .. m*n-1));

    one := &or(seq(seq(x[i,j,1], i=1..m), j=1..n));   


    single := &not(&or(seq(seq(seq(seq(x[i,j,k] &and x[i,j,kk], kk = k+1..m*n), k = 1..m*n-1)
                                , i = 1..m), j = 1..n)));

    sol := Logic:-Satisfy(&and(initial, adjacent, one, single));
    
    if sol = NULL then
        error "no solution";
    end if;
if inline then
        S := M;
     else
        S := Matrix(m,n);
    end if;

    for eq in sol do
        (var, val) := op(eq);
        if val then
            S[op(1..2, var)] := op(3,var);
        end if;
    end do;
    S;
end proc:

           Two simple examples

A:=<0,0,5; 0,0,0; 0,0,9>;
# The unique solution
NumbrixPuzzle(A);

A:=<0,0,5; 0,0,0; 0,8,0>;
# 4 solutions
NumbrixPuzzle(A);

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

 

Matrix(3, 3, {(1, 1) = 3, (1, 2) = 4, (1, 3) = 5, (2, 1) = 2, (2, 2) = 7, (2, 3) = 6, (3, 1) = 1, (3, 2) = 8, (3, 3) = 9})

 

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

 

Matrix(%id = 18446746210121682686), Matrix(%id = 18446746210121682806), Matrix(%id = 18446746210121674750), Matrix(%id = 18446746210121674870)

(1)


Comparison with Numbrix procedure. The example is taken from
http://rosettacode.org/wiki/Solve_a_Numbrix_puzzle 

 A:=<0, 0, 0, 0, 0, 0, 0, 0, 0;
 0, 0, 46, 45, 0, 55, 74, 0, 0;
 0, 38, 0, 0, 43, 0, 0, 78, 0;
 0, 35, 0, 0, 0, 0, 0, 71, 0;
 0, 0, 33, 0, 0, 0, 59, 0, 0;
 0, 17, 0, 0, 0, 0, 0, 67, 0;
 0, 18, 0, 0, 11, 0, 0, 64, 0;
 0, 0, 24, 21, 0, 1, 2, 0, 0;
 0, 0, 0, 0, 0, 0, 0, 0, 0>;
CodeTools:-Usage(NumbrixPuzzle(A));
CodeTools:-Usage(Numbrix(A));

Matrix(9, 9, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (1, 9) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 46, (2, 4) = 45, (2, 5) = 0, (2, 6) = 55, (2, 7) = 74, (2, 8) = 0, (2, 9) = 0, (3, 1) = 0, (3, 2) = 38, (3, 3) = 0, (3, 4) = 0, (3, 5) = 43, (3, 6) = 0, (3, 7) = 0, (3, 8) = 78, (3, 9) = 0, (4, 1) = 0, (4, 2) = 35, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (4, 8) = 71, (4, 9) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 33, (5, 4) = 0, (5, 5) = 0, (5, 6) = 0, (5, 7) = 59, (5, 8) = 0, (5, 9) = 0, (6, 1) = 0, (6, 2) = 17, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 0, (6, 8) = 67, (6, 9) = 0, (7, 1) = 0, (7, 2) = 18, (7, 3) = 0, (7, 4) = 0, (7, 5) = 11, (7, 6) = 0, (7, 7) = 0, (7, 8) = 64, (7, 9) = 0, (8, 1) = 0, (8, 2) = 0, (8, 3) = 24, (8, 4) = 21, (8, 5) = 0, (8, 6) = 1, (8, 7) = 2, (8, 8) = 0, (8, 9) = 0, (9, 1) = 0, (9, 2) = 0, (9, 3) = 0, (9, 4) = 0, (9, 5) = 0, (9, 6) = 0, (9, 7) = 0, (9, 8) = 0, (9, 9) = 0})

 

memory used=7.85MiB, alloc change=-3.01MiB, cpu time=172.00ms, real time=212.00ms, gc time=93.75ms

 

Matrix(9, 9, {(1, 1) = 49, (1, 2) = 50, (1, 3) = 51, (1, 4) = 52, (1, 5) = 53, (1, 6) = 54, (1, 7) = 75, (1, 8) = 76, (1, 9) = 81, (2, 1) = 48, (2, 2) = 47, (2, 3) = 46, (2, 4) = 45, (2, 5) = 44, (2, 6) = 55, (2, 7) = 74, (2, 8) = 77, (2, 9) = 80, (3, 1) = 37, (3, 2) = 38, (3, 3) = 39, (3, 4) = 40, (3, 5) = 43, (3, 6) = 56, (3, 7) = 73, (3, 8) = 78, (3, 9) = 79, (4, 1) = 36, (4, 2) = 35, (4, 3) = 34, (4, 4) = 41, (4, 5) = 42, (4, 6) = 57, (4, 7) = 72, (4, 8) = 71, (4, 9) = 70, (5, 1) = 31, (5, 2) = 32, (5, 3) = 33, (5, 4) = 14, (5, 5) = 13, (5, 6) = 58, (5, 7) = 59, (5, 8) = 68, (5, 9) = 69, (6, 1) = 30, (6, 2) = 17, (6, 3) = 16, (6, 4) = 15, (6, 5) = 12, (6, 6) = 61, (6, 7) = 60, (6, 8) = 67, (6, 9) = 66, (7, 1) = 29, (7, 2) = 18, (7, 3) = 19, (7, 4) = 20, (7, 5) = 11, (7, 6) = 62, (7, 7) = 63, (7, 8) = 64, (7, 9) = 65, (8, 1) = 28, (8, 2) = 25, (8, 3) = 24, (8, 4) = 21, (8, 5) = 10, (8, 6) = 1, (8, 7) = 2, (8, 8) = 3, (8, 9) = 4, (9, 1) = 27, (9, 2) = 26, (9, 3) = 23, (9, 4) = 22, (9, 5) = 9, (9, 6) = 8, (9, 7) = 7, (9, 8) = 6, (9, 9) = 5})

 

memory used=1.21GiB, alloc change=307.02MiB, cpu time=37.00s, real time=31.88s, gc time=9.30s

 

Matrix(%id = 18446746210094669942)

(2)


In the example below, which has 104 solutions, the  Numbrix  procedure is faster.

C:=Matrix(5,{(1,1)=1,(5,5)=25});
CodeTools:-Usage(NumbrixPuzzle(C)):
nops([%]);
CodeTools:-Usage(Numbrix(C)):

Matrix(5, 5, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 25})

 

memory used=0.94GiB, alloc change=-22.96MiB, cpu time=12.72s, real time=11.42s, gc time=2.28s

 

104

 

memory used=34.74MiB, alloc change=0 bytes, cpu time=781.00ms, real time=783.00ms, gc time=0ns

 

 


 

Download NumbrixPuzzle.mw

First 11 12 13 14 15 16 17 Last Page 13 of 55