Maple 2016 Questions and Posts

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

Hey guys,

I'm trying to build up some program to manage my composites data. But I am struggling with my compliance/stiffness in the global coordinates:

-Basically, I have the lamina's properties in local coordinates.

-When I make walls out of them with 30degress fibers orientation, I need to rotate the local stiffness several times to get the the stiffness of that particular wall.

-While I do understand the concept and manage to get the final rotation matrix correctly, I often find myself making mistakes regarding the sense of rotation of my local axis relatively to the global one.

I try to stick with one direction of rotation but if Maple has a smart way whereas I can plug in the initial configuration of the local coords relatively to the global one, show the final configuration (local aligned to the global), and get the rotation matrix that made it happen, it would be more helpful.

Thank you

Update:

I enclosed an example of the kind of operations I do:

And here is the kind of code I'm using:

PB2_W1.mw
 

NULL

restart:

with(LinearAlgebra):

Stiffness:=Matrix(6,6): Stiffness:=Matrix(6, 6, {(1, 1) = 20.4, (1, 2) = .537, (1, 3) = 1.01, (1, 4) = 0., (1, 5) = 0., (1, 6) = -0., (2, 1) = .537, (2, 2) = 1.59, (2, 3) = .73, (2, 4) = 0., (2, 5) = 0., (2, 6) = -0., (3, 1) = 1.01, (3, 2) = .73, (3, 3) = 2.86, (3, 4) = 0., (3, 5) = 0., (3, 6) = -0., (4, 1) = 0., (4, 2) = 0., (4, 3) = 0., (4, 4) = 1.5, (4, 5) = 0., (4, 6) = -0., (5, 1) = 0., (5, 2) = 0., (5, 3) = 0., (5, 4) = 0., (5, 5) = 2., (5, 6) = -0., (6, 1) = 0., (6, 2) = 0., (6, 3) = 0., (6, 4) = 0., (6, 5) = 0., (6, 6) = .8});

Stiffness := Matrix(6, 6, {(1, 1) = 20.4, (1, 2) = .537, (1, 3) = 1.01, (1, 4) = 0., (1, 5) = 0., (1, 6) = -0., (2, 1) = .537, (2, 2) = 1.59, (2, 3) = .73, (2, 4) = 0., (2, 5) = 0., (2, 6) = -0., (3, 1) = 1.01, (3, 2) = .73, (3, 3) = 2.86, (3, 4) = 0., (3, 5) = 0., (3, 6) = -0., (4, 1) = 0., (4, 2) = 0., (4, 3) = 0., (4, 4) = 1.5, (4, 5) = 0., (4, 6) = -0., (5, 1) = 0., (5, 2) = 0., (5, 3) = 0., (5, 4) = 0., (5, 5) = 2., (5, 6) = -0., (6, 1) = 0., (6, 2) = 0., (6, 3) = 0., (6, 4) = 0., (6, 5) = 0., (6, 6) = .8})

(1)

Q1:=Matrix(3,3): Q1[1,1]:=sin(Pi/4); Q1[1,2]:=0; Q1[1,3]:=cos(Pi/4); Q1[2,1]:=cos(Pi/4); Q1[2,2]:=0; Q1[2,3]:=-sin(Pi/4); Q1[3,1]:=0; Q1[3,2]:=1; Q1[3,3]:=0;

(1/2)*2^(1/2)

 

0

 

(1/2)*2^(1/2)

 

(1/2)*2^(1/2)

 

0

 

-(1/2)*2^(1/2)

 

0

 

1

 

0

(2)

Q1;

Matrix(3, 3, {(1, 1) = (1/2)*sqrt(2), (1, 2) = 0, (1, 3) = (1/2)*sqrt(2), (2, 1) = (1/2)*sqrt(2), (2, 2) = 0, (2, 3) = -(1/2)*sqrt(2), (3, 1) = 0, (3, 2) = 1, (3, 3) = 0})

(3)

Q2:=Matrix(3,3): Q2[1,1]:=0; Q2[1,2]:=0; Q2[1,3]:=1; Q2[2,1]:=1; Q2[2,2]:=0; Q2[2,3]:=0; Q2[3,1]:=0; Q2[3,2]:=1; Q2[3,3]:=0;

0

 

0

 

1

 

1

 

0

 

0

 

0

 

1

 

0

(4)

Q2;

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

(5)

Q3:=Matrix(3,3): Q3[1,1]:=0; Q3[1,2]:=-1; Q3[1,3]:=0; Q3[2,1]:=1; Q3[2,2]:=0; Q3[2,3]:=0; Q3[3,1]:=0; Q3[3,2]:=0; Q3[3,3]:=1;

0

 

-1

 

0

 

1

 

0

 

0

 

0

 

0

 

1

(6)

Q3;

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

(7)

S1:=Transpose(Q1); S2:=Transpose(Q2); S3:=Transpose(Q3);

S1 := Matrix(3, 3, {(1, 1) = (1/2)*sqrt(2), (1, 2) = (1/2)*sqrt(2), (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 1, (3, 1) = (1/2)*sqrt(2), (3, 2) = -(1/2)*sqrt(2), (3, 3) = 0})

 

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

 

S3 := Matrix(3, 3, {(1, 1) = 0, (1, 2) = 1, (1, 3) = 0, (2, 1) = -1, (2, 2) = 0, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1})

(8)

S4:=Multiply(S3,S2);

S4 := Matrix(3, 3, {(1, 1) = 0, (1, 2) = 0, (1, 3) = 1, (2, 1) = 0, (2, 2) = -1, (2, 3) = 0, (3, 1) = 1, (3, 2) = 0, (3, 3) = 0})

(9)

S5:=Multiply(S4,S1);

S5 := Matrix(3, 3, {(1, 1) = (1/2)*sqrt(2), (1, 2) = -(1/2)*sqrt(2), (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = -1, (3, 1) = (1/2)*sqrt(2), (3, 2) = (1/2)*sqrt(2), (3, 3) = 0})

(10)

R:=Matrix(6,6): R[1,1]:=S5[1,1]^2; R[1,2]:=S5[1,2]^2; R[1,3]:=S5[1,3]^2; R[2,1]:=S5[2,1]*S5[1,1]; R[2,2]:=S5[2,2]*S5[1,2]; R[2,3]:=S5[2,3]*S5[1,3]; R[3,1]:=S5[2,1]^2; R[3,2]:=S5[2,2]^2; R[3,3]:=S5[2,3]^2; R[1,4]:=2*S5[1,2]*S5[1,3]; R[1,5]:=2*S5[1,1]*S5[1,3]; R[1,6]:=2*S5[1,1]*S5[1,2]; R[2,4]:=S5[2,2]*S5[1,3]+S5[2,3]*S5[1,2]; R[2,5]:=S5[2,1]*S5[1,3]+S5[2,3]*S5[1,1]; R[2,6]:=S5[2,1]*S5[1,2]+S5[2,2]*S5[1,1]; R[3,4]:=2*S5[2,2]*S5[2,3]; R[3,5]:=2*S5[2,1]*S5[2,3]; R[3,6]:=2*S5[2,1]*S5[2,2];

R[4,1]:=S5[3,1]*S5[1,1]; R[4,2]:=S5[3,2]*S5[1,2]; R[4,3]:=S5[3,3]*S5[1,3]; R[4,4]:=S5[3,2]*S5[1,3]+S5[3,3]*S5[1,2]; R[4,5]:=S5[3,1]*S5[1,3]+S5[3,3]*S5[1,1]; R[4,6]:=S5[3,1]*S5[1,2]+S5[3,2]*S5[1,1]; R[5,1]:=S5[3,1]*S5[2,1]; R[5,2]:=S5[3,2]*S5[2,2]; R[5,3]:=S5[3,3]*S5[2,3]; R[5,4]:=S5[3,2]*S5[2,3]+S5[3,3]*S5[2,2]; R[5,5]:=S5[3,1]*S5[2,3]+S5[3,3]*S5[2,1]; R[5,6]:=S5[3,1]*S5[2,2]+S5[3,2]*S5[2,1];R[6,1]:=S5[3,1]^2; R[6,2]:=S5[3,2]^2; R[6,3]:=S5[3,3]^2; R[6,4]:=2*S5[3,3]*S5[3,2]; R[6,5]:=2*S5[3,1]*S5[3,3]; R[6,6]:=2*S5[3,1]*S5[3,2];

1/2

 

1/2

 

0

 

0

 

0

 

0

 

0

 

0

 

1

 

0

 

0

 

-1

 

(1/2)*2^(1/2)

 

-(1/2)*2^(1/2)

 

0

 

0

 

0

 

0

 

1/2

 

-1/2

 

0

 

0

 

0

 

0

 

0

 

0

 

0

 

-(1/2)*2^(1/2)

 

-(1/2)*2^(1/2)

 

0

 

1/2

 

1/2

 

0

 

0

 

0

 

1

(11)

print(R);

Matrix(6, 6, {(1, 1) = 1/2, (1, 2) = 1/2, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = -1, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = (1/2)*sqrt(2), (2, 5) = -(1/2)*sqrt(2), (2, 6) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (4, 1) = 1/2, (4, 2) = -1/2, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = -(1/2)*sqrt(2), (5, 5) = -(1/2)*sqrt(2), (5, 6) = 0, (6, 1) = 1/2, (6, 2) = 1/2, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 1})

(12)

RTrans:=Transpose(R);

RTrans := Matrix(6, 6, {(1, 1) = 1/2, (1, 2) = 0, (1, 3) = 0, (1, 4) = 1/2, (1, 5) = 0, (1, 6) = 1/2, (2, 1) = 1/2, (2, 2) = 0, (2, 3) = 0, (2, 4) = -1/2, (2, 5) = 0, (2, 6) = 1/2, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (4, 1) = 0, (4, 2) = (1/2)*sqrt(2), (4, 3) = 0, (4, 4) = 0, (4, 5) = -(1/2)*sqrt(2), (4, 6) = 0, (5, 1) = 0, (5, 2) = -(1/2)*sqrt(2), (5, 3) = 0, (5, 4) = 0, (5, 5) = -(1/2)*sqrt(2), (5, 6) = 0, (6, 1) = -1, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 1})

(13)

Stiff1:=Matrix(6,6): Stiff1:=Multiply(Stiffness, RTrans);

Stiff1 := Matrix(6, 6, {(1, 1) = 10.46850000, (1, 2) = 0., (1, 3) = 1.01, (1, 4) = 9.931500000, (1, 5) = 0., (1, 6) = 10.46850000, (2, 1) = 1.063500000, (2, 2) = 0., (2, 3) = .73, (2, 4) = -.5265000000, (2, 5) = 0., (2, 6) = 1.063500000, (3, 1) = .8700000000, (3, 2) = 0., (3, 3) = 2.86, (3, 4) = .1400000000, (3, 5) = 0., (3, 6) = .8700000000, (4, 1) = 0., (4, 2) = .7500000000*sqrt(2), (4, 3) = 0., (4, 4) = 0., (4, 5) = -.7500000000*sqrt(2), (4, 6) = 0., (5, 1) = 0., (5, 2) = -1.000000000*sqrt(2), (5, 3) = 0., (5, 4) = 0., (5, 5) = -1.000000000*sqrt(2), (5, 6) = 0., (6, 1) = -.8, (6, 2) = 0., (6, 3) = 0., (6, 4) = 0., (6, 5) = 0., (6, 6) = .8})

(14)

StiffnessW1:=Matrix(6,6): StiffnessW1:=Multiply(R,Stiff1); evalf(StiffnessW1,3);

StiffnessW1 := Matrix(6, 6, {(1, 1) = 6.566000000, (1, 2) = 0., (1, 3) = .8700000000, (1, 4) = 4.702500000, (1, 5) = 0., (1, 6) = 4.966000000, (2, 1) = 0., (2, 2) = 1.750000000, (2, 3) = 0., (2, 4) = 0., (2, 5) = .2500000000, (2, 6) = 0., (3, 1) = .8700000000, (3, 2) = 0., (3, 3) = 2.86, (3, 4) = .1400000000, (3, 5) = 0., (3, 6) = .8700000000, (4, 1) = 4.702500000, (4, 2) = 0., (4, 3) = .1400000000, (4, 4) = 5.229000000, (4, 5) = 0., (4, 6) = 4.702500000, (5, 1) = 0., (5, 2) = .2500000000, (5, 3) = 0., (5, 4) = 0., (5, 5) = 1.750000000, (5, 6) = 0., (6, 1) = 4.966000000, (6, 2) = 0., (6, 3) = .8700000000, (6, 4) = 4.702500000, (6, 5) = 0., (6, 6) = 6.566000000})

 

Matrix(6, 6, {(1, 1) = 6.57, (1, 2) = 0., (1, 3) = .870, (1, 4) = 4.70, (1, 5) = 0., (1, 6) = 4.97, (2, 1) = 0., (2, 2) = 1.75, (2, 3) = 0., (2, 4) = 0., (2, 5) = .250, (2, 6) = 0., (3, 1) = .870, (3, 2) = 0., (3, 3) = 2.86, (3, 4) = .140, (3, 5) = 0., (3, 6) = .870, (4, 1) = 4.70, (4, 2) = 0., (4, 3) = .140, (4, 4) = 5.23, (4, 5) = 0., (4, 6) = 4.70, (5, 1) = 0., (5, 2) = .250, (5, 3) = 0., (5, 4) = 0., (5, 5) = 1.75, (5, 6) = 0., (6, 1) = 4.97, (6, 2) = 0., (6, 3) = .870, (6, 4) = 4.70, (6, 5) = 0., (6, 6) = 6.57})

(15)

 

 

NULL


 

Download PB2_W1.mw

It is decent enough to get results if human mistakes don't happen when it comes to rotation orientation (which tends to happen more often than not). 

I am aware though that it is not written with wits or in an efficient format. If you have a suggestion, Im all ears.

 

Thanks again

 

 

Is there a way to change the numeric formatting of 'Scientific' to use a cdot instead of a cross to represent multiplication?

Hello! 

I got a set of data imported from excel which is of the size 2001x2. I've use DataPlot to plot the graph of this data but I can't seem to find a way to integrate it. I've used BSplineCurve to make the discreate values continious but I cant seem to integrate this new curve. Can someone please give me a solution or an alternative way to find an approximative way to find the area under the curve.

Thanks

Guys

I can't seem to work out how the cylinder in my animation won't extend to of the bottom of the sphere initially. and how to make it stop at the maximum volume coordinates.

cylinder_in_sphere_ani.mw

 

 

Hey guys,

I have this (6x1) matrix:

And I wish to factor a vector of the recurring terms out of it, this particular vector:

So that I end up with a (6x6) Matrix multiplied to that vector.

 

Thank you

Let us consider 

restart; 
MultiSeries:-limit(sin(n)/n, n = infinity, complex);
0

The answer is wrong: in view of the Casorati-Weierstrass theorem the limit does not exist. Let us try another limit command of Maple

limit(sin(n)/n, n = infinity, complex);


(lim) (sin(n))/(n)

which fails. Therefore, Maple user does not obtain the correct answer. 

Hi

I have this problem that my computer crashed during Maple 2016.1 to 2016.2 update.

Now it won't start at all.

I have tried reinstalling Maple several times, tried not updating to 2016.1 and running the program as vesion 2016.0.

I get this error in my eventlog, when I try to run the program.

Name of program errors: javaw.exe, version: 8.0.1020.14, timestamp: 0x576af3f4
Name of the module with error: nvSCPAPI64.dll, version: 7.17.13.7849, timestamp: 0x588218a5
Exception code: 0xc0000409
Displacement by mistake 0x0000000000034b2f
Process ID 0x166c
The program's start time 0x01d279add4515202
Program path: E: \ School Program Files \ Maple 2016 \ jre \ bin \ javaw.exe
Module path: C: \ Program Files (x86) \ NVIDIA Corporation \ 3D Vision \ nvSCPAPI64.dll
Report ID: d52f952d-8fd2-4130-890a-196e6a7bdc92
Full name of the program with the error:
Relatively application ID for program errors:

So as my titel suggests I need help to remove all files associated with Maple so I can install the program anew. It has worked fine for over a year so far. Only stopped working after that crash.

I have even tried installing the older version, Maple 2015 and it doesn't work either, so I am guessing the files which are corrupted aren't removed during a normal uninstall process, and they are shared among the versions of the program.

Thanks in advance :)

Hi all,

I am using Maple 2016.

I have defined 5 polynomials: f1, f2, f3, f4 and f5 with 5 unknowns q1,q2 ,q3, q4 and lamda.

After this, I generated the Gröbner basis. But when I try to find the normal set I got an error.

 

with(Groebner);

f1 := lamda*q1-(3380075947548081*q1*(1/140737488355328)-259050600068343*q2*(1/140737488355328)-1826834460600733*q3*(1/1125899906842624)+4414049272733425*q4*(1/9007199254740992))*(q2*(8289619202186977*q1*(1/9007199254740992)+3380075947548081*q2*(1/281474976710656)-4414049272733425*q3*(1/18014398509481984)-1826834460600733*q4*(1/2251799813685248))+q3*(1826834460600733*q1*(1/2251799813685248)-4414049272733425*q2*(1/18014398509481984)+843667886835955*q3*(1/70368744177664)-215663898201129*q4*(1/9007199254740992))-q4*(4414049272733425*q1*(1/18014398509481984)+1826834460600733*q2*(1/2251799813685248)+431327796402257*q3*(1/18014398509481984)+843667886835955*q4*(1/70368744177664))-q1*(3380075947548081*q1*(1/281474976710656)-259050600068343*q2*(1/281474976710656)-1826834460600733*q3*(1/2251799813685248)+4414049272733425*q4*(1/18014398509481984)));
f2 := lamda*q2+(259050600068343*q1*(1/140737488355328)+3380075947548081*q2*(1/140737488355328)-4414049272733425*q3*(1/9007199254740992)-1826834460600733*q4*(1/1125899906842624))*(q2*(8289619202186977*q1*(1/9007199254740992)+3380075947548081*q2*(1/281474976710656)-4414049272733425*q3*(1/18014398509481984)-1826834460600733*q4*(1/2251799813685248))+q3*(1826834460600733*q1*(1/2251799813685248)-4414049272733425*q2*(1/18014398509481984)+843667886835955*q3*(1/70368744177664)-215663898201129*q4*(1/9007199254740992))-q4*(4414049272733425*q1*(1/18014398509481984)+1826834460600733*q2*(1/2251799813685248)+431327796402257*q3*(1/18014398509481984)+843667886835955*q4*(1/70368744177664))-q1*(3380075947548081*q1*(1/281474976710656)-259050600068343*q2*(1/281474976710656)-1826834460600733*q3*(1/2251799813685248)+4414049272733425*q4*(1/18014398509481984)));
f3 := (1826834460600733*q1*(1/1125899906842624)-4414049272733425*q2*(1/9007199254740992)+843667886835955*q3*(1/35184372088832)-862655592804515*q4*(1/18014398509481984))*(q2*(8289619202186977*q1*(1/9007199254740992)+3380075947548081*q2*(1/281474976710656)-4414049272733425*q3*(1/18014398509481984)-1826834460600733*q4*(1/2251799813685248))+q3*(1826834460600733*q1*(1/2251799813685248)-4414049272733425*q2*(1/18014398509481984)+843667886835955*q3*(1/70368744177664)-215663898201129*q4*(1/9007199254740992))-q4*(4414049272733425*q1*(1/18014398509481984)+1826834460600733*q2*(1/2251799813685248)+431327796402257*q3*(1/18014398509481984)+843667886835955*q4*(1/70368744177664))-q1*(3380075947548081*q1*(1/281474976710656)-259050600068343*q2*(1/281474976710656)-1826834460600733*q3*(1/2251799813685248)+4414049272733425*q4*(1/18014398509481984)))+lamda*q3;
f4 := lamda*q4-(4414049272733425*q1*(1/9007199254740992)+1826834460600733*q2*(1/1125899906842624)+862655592804515*q3*(1/18014398509481984)+843667886835955*q4*(1/35184372088832))*(q2*(8289619202186977*q1*(1/9007199254740992)+3380075947548081*q2*(1/281474976710656)-4414049272733425*q3*(1/18014398509481984)-1826834460600733*q4*(1/2251799813685248))+q3*(1826834460600733*q1*(1/2251799813685248)-4414049272733425*q2*(1/18014398509481984)+843667886835955*q3*(1/70368744177664)-215663898201129*q4*(1/9007199254740992))-q4*(4414049272733425*q1*(1/18014398509481984)+1826834460600733*q2*(1/2251799813685248)+431327796402257*q3*(1/18014398509481984)+843667886835955*q4*(1/70368744177664))-q1*(3380075947548081*q1*(1/281474976710656)-259050600068343*q2*(1/281474976710656)-1826834460600733*q3*(1/2251799813685248)+4414049272733425*q4*(1/18014398509481984)));
f5 := q1^2+q2^2+q3^2+q4^2-1;
ord := tdeg(q1, q2, q3, q4, lamda);
                  tdeg(q1, q2, q3, q4, lamda)
G := Basis([f1, f2, f3, f4, f5], ord);

IsZeroDimensional(G);
                             false
ns, rv := NormalSet(G, ord);
Error, (in Groebner:-NormalSet) The case of non-zero-dimensional varieties is not handled.

 

Any help please ?

Thank you.

Hello,

I was wondering if it is possible to use units in Maple so I can always check if the result I have at the end of calculation is the meter.  For example:

>c:=3e8m/s
>Ec:=1J
>Ec*c

The answer is of course 3.10^8 m^3*kg/s^3

I try to do something with the units but I am unable to crreate something that will simplify the m/s ffactor to 1.

Any idea?

Thank you in advance for your help.

 

I have recently been working on a problem using fractional calculus and have come across something in Maple's fracdiff  command that makes no sense to me.

fracdiff(1, x, 1/2) = 0

It should be:     1/(sqrt(x)*sqrt(Pi))

Thanks.

fracdiff.mw

The first half of this work sheet deals with SHM of pendulum. In the second half of the work sheet I attempt to solve for the general case of a swinging pendulum. Maple introduces a place holder (correct me if I have used the incorrect termonology) " __a" which I do not understand. What variable(s) should I replace it with and is there an automatic way of doing so?
 

restart

NULL

``

``

Simple*Harmonic*Motion*of*a*Pendulum

NULL

Eq1 := diff(Theta(t), t, t) = -omega^2*Theta(t)

diff(diff(Theta(t), t), t) = -omega^2*Theta(t)

(1)

ics := Theta(0) = 0, (D(Theta))(0) = Vmax

Theta(0) = 0, (D(Theta))(0) = Vmax

(2)

SHM := dsolve({Eq1, ics})

Theta(t) = Vmax*sin(omega*t)/omega

(3)

diffSHM := diff(SHM, t)

diff(Theta(t), t) = Vmax*cos(omega*t)

(4)

convert(diffSHM, D)

(D(Theta))(t) = Vmax*cos(omega*t)

(5)

eval[recurse](%, {t = 0, (D(Theta))(0) = Vmax})

Vmax = Vmax

(6)

solve(%, {_C1})

{_C1 = _C1}

(7)

assign(%); _C1

_C1

(8)

``

SHM

Theta(t) = Vmax*sin(omega*t)/omega

(9)

``

(General*Equation*of*Motion*of)*a*Pendulum

restart

diff(Theta(t), t, t) = -omega^2*sin(Theta(t))

diff(diff(Theta(t), t), t) = -omega^2*sin(Theta(t))

(10)

ics := Theta(0) = 0, (D(Theta))(0) = Vmax

Theta(0) = 0, (D(Theta))(0) = Vmax

(11)

Sol := dsolve(diff(Theta(t), t, t) = -omega^2*sin(Theta(t)))

Intat(1/(2*omega^2*cos(_a)+_C1)^(1/2), _a = Theta(t))-t-_C2 = 0, Intat(-1/(2*omega^2*cos(_a)+_C1)^(1/2), _a = Theta(t))-t-_C2 = 0

(12)

Sol[1]

Intat(1/(2*omega^2*cos(_a)+_C1)^(1/2), _a = Theta(t))-t-_C2 = 0

(13)

_C2 := 0

0

(14)

Sol[1]

Intat(1/(2*omega^2*cos(_a)+_C1)^(1/2), _a = Theta(t))-t = 0

(15)

``

dffSol[1] := diff(Sol[1], t)

(diff(Theta(t), t))/(2*omega^2*cos(Theta(t))+_C1)^(1/2)-1 = 0

(16)

``convert(dffSol[1], D)

(D(Theta))(t)/(2*omega^2*cos(Theta(t))+_C1)^(1/2)-1 = 0

(17)

 

eval[recurse](%, {t = 0, Theta(0) = 0, (D(Theta))(0) = Vmax})

Vmax/(2*omega^2+_C1)^(1/2)-1 = 0

(18)

solve(%, {_C1})

{_C1 = Vmax^2-2*omega^2}

(19)

assign(%); 1; _C1

Vmax^2-2*omega^2

(20)

dffSol[1]

(diff(Theta(t), t))/(2*omega^2*cos(Theta(t))+Vmax^2-2*omega^2)^(1/2)-1 = 0

(21)

``

dsolve(dffSol[1]); 1; SOL1 := int((diff(Theta(t), t))/sqrt(2*omega^2*cos(Theta(t))+Vmax^2-2*omega^2)-1, t = 0 .. Theta(t)) = 0

int((diff(Theta(t), t))/(2*omega^2*cos(Theta(t))+Vmax^2-2*omega^2)^(1/2)-1, t = 0 .. Theta(t)) = 0

(22)

Sol[1]

Intat(1/(2*omega^2*cos(_a)+Vmax^2-2*omega^2)^(1/2), _a = Theta(t))-t = 0

(23)

"Using  ( 1-cos(theta))/(2)=sin(theta/(2))^(2)and substituting by hand"

NotsoSHM := Intat(1/(Vmax*sqrt(1-2*omega^2*sin((1/2)*_a)^2/Vmax^2)), _a = (1/2)*Theta(t))-t = 0

Intat(1/(Vmax*(1-2*omega^2*sin((1/2)*_a)^2/Vmax^2)^(1/2)), _a = (1/2)*Theta(t))-t = 0

(24)

``

``


 

Download SHM_and_not_so_SHM.mw

I am practicing with some diff equations. I am having problem solving for one of the constants. I am having a pproblem assigning a value to derivatives or 2nd derivatives. What is a good general technique is this type of situation?
 

restart

NULL

``

omega^2 = g/l

omega^2 = g/l

(1)

Eq1 := diff(Theta(t), t, t) = -omega^2*Theta(t)

diff(diff(Theta(t), t), t) = -omega^2*Theta(t)

(2)

ics := Theta(0) = 0, (diff(Theta(t), t))(0) = Vmax, (diff(Theta(t), t, t))(0) = 0

Theta(0) = 0, (diff(Theta(t), t))(0) = Vmax, (diff(diff(Theta(t), t), t))(0) = 0

(3)

SHM := dsolve({Eq1, ics})

(4)

SHM := dsolve({Eq1})

{Theta(t) = _C1*sin(omega*t)+_C2*cos(omega*t)}

(5)

SHM := dsolve({Eq1, Theta(0) = 0})

Theta(t) = _C1*sin(omega*t)

(6)

``

diffSHM := diff(SHM, t)

diff(Theta(t), t) = _C1*omega*cos(omega*t)

(7)

``

(Theta(t))(0) = 0, (diff(Theta(t), t))(0) = V

(Theta(t))(0) = 0, (diff(Theta(t), t))(0) = V

(8)

``

``

``

``

``

NULL

NULL


 

Download SHM.mw

I was trying to write a procedure that would compute a simple linear equation using the Extended Euclidean Algorithm. I was thinking of a procedure like the following:

solveEeaMatrix := proc (a::list, b::list) 
 local c::list;  
 c := a -iquo(a[1],b[1])*b;  
 print(c);  
 while (c[1] <> gcd(a[1],b[1]) do 
 ...

I am basically stuck at this part as

1) I don't know how to setup a multi-dimensional array that could dynamically grow(as a possible solution).

2) I can't come up with a recursive function that could possibly take care of this.

In short, if I am given for example an equation like: 84*x+203*y = 14

I will transform it into 2 linear equation as follow:
row0 := [203, 0, 1] row1 := [84, 1, 0] Subsequently, I will perform the following:

c := a -iquo(a[1],b[1])*b;  

Where aand b are both lists and arguments of the procedure and cbeing another list and a local variable.

But I don't know how to do the following programmatically:

row3 := row1-iquo(row1[1], row2[1])*row2;
row4 := row2-iquo(row2[1], row3[1])*row3;
row5 := row3-iquo(row3[1], row4[1])*row4;
and so on ...                  

Any hint would be appreciated.

Dear All, 

I am trying to use define_external to use a C dll from inside MAPLE. The C dll exports a function that has a argument of type function pointer which has a return type of pointer. The function itself returns pointers.  

Pointers are needed as return types as the C function needs to return arrays. 

When I try to pass the C function, as maple procedure as the argument, it errs saying "Error, (in rk4_vec) number expected for float[8] parameter, got proc () option remember; table( [( 1 ) = HFloat(1.0), ( 2 ) = HFloat(-0.0) ] ) 'procname(args)' end proc"

rk4_vec is as follows: 

rk4_vec := define_external("rk4vec", 't0' :: float[8], 'm' :: integer[4], 'u0' :: ARRAY(1..2,datatype=float[8]), 'dt' :: float[8], 'f' :: PROC('t' :: float[8], 'm' :: integer[4], 'u' :: ARRAY(1..2,datatype=float[8]), 'RETURN' :: REF(float[8])), 'RETURN' ::REF(float[8]), "WRAPPER", LIB="rk4.dll");

rk4vec in C looks like this: 

double *rk4vec ( double t0, int m, double u0[], double dt, 
  double *f ( double t, int m, double u[] ) )

I am passing as :

rk4vec_test_f := proc(t, n, u)
local uprime :: REF(float[8]);
#uprime := Array(n);
uprime(1) := u(2);
uprime(2) := -u(1);
return uprime;
end proc;

I have tried the RETURN type on the define_external call as : float[8], ARRAY(1..2, datatype=float[8]) , but that didnt work either. I got the idea of using REF from times2 example on this link.

Any guidance in this matter is highly appreciated. 

Attached are the C file, the dll, maple worksheet. Tested on Windows, with 64-bit, Maple 2016 standard. rk4.zip

 

First 33 34 35 36 37 38 39 Last Page 35 of 60