MaplePrimes Questions

Way back in Maple 10 (I'd like to pay special attention to http://www.mapleprimes.com/questions/43066-Maple-10-How-Do-I-Change-Number-Formats) it was suggested even hinted by a Maplesoft employee that this availability would be in a future version of Maple. 

Since then there have been numerous requests on how to get Maple to change to scientific or engineering notation of the sorts. 

So what is that now, v11 v12 v13 v14 v15 v16 v17 v18 v2015 v2016 ... 10 versions!  and no implementation of engineering / scientific notation conversions. 

We rely today on printf or sprintf for e notations however I could't come up with an output of converting 3530 to simply 3.53 x 103 .  Can someone produce a proc to do so, I have tried and I can not. 

Hi, given a, b and n such that a^x is congurent to b (mod n) how could one write a procedure to calculate x using baby step giant step method to calculate x for example i would like to be able to show that x=60 when a=3 b=64 and n=137

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)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,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

 

 

Hi!

I hope every one is ok.

I am running this code (see below)

m := 2;


X[0] := 14;
                              
Y[0] := 18;
                        
a := 1; b := 1; c := .1; d := 1;

alpha := 1;

for k from 0 to m do X[k+1] := GAMMA(k*alpha+1)*(a*X(k)-b*(sum(X(s)*Y(k-s), s = 0 .. k)))/GAMMA(k*alpha+1+1); Y[k+1] := GAMMA(k*alpha+1)*(-c*Y(k)+d*(sum(X(s)*Y(k-s), s = 0 .. k)))/GAMMA(k*alpha+1+1) end do

x := 0; y := 0

The following message pop out.

PLease HELP! HELP!.....

\

 

I can't get Simpson's Rule to work properly in Maple for f(x)=cos(e^-x)

According to Wolfram Alpha, I should be getting something like -0.5. Clearly that's not what I'm getting. Please help?

> f := proc (x) options operator, arrow; cos(6*exp(-x)) end proc;
x -> cos(6 exp(-x))

S := evalf(int(f(x), x = 0 .. 1));
                         -0.4411788573
S1 := evalf((1/6)*(1+0)*(f(0)+4*f(1)+f(2)));
                         -0.1215440391
S2 := evalf((1/12)*(1+0)*(f(0)+4*f(1)+2*f(2)+4*f(3)+f(4)));
                          0.3979663797
S-S1;
                         -0.3196348182
100*(S-S1)/S;
                          72.45016685
S-S2;
                         -0.8391452370
100*(S-S2)/S;
                          190.2052247

 

Mathematica does it simply like this

Can Maple do it similarily easily?  how?

Hi ,

I have recently got to know this software and its capabilities and was wondering if I can use it to start an initial systems design for an E-scooter as a first step (virtual validation). then feed this data to a designer which will design and cooperate with an engineer to realise the design again on this platform.

SO i have the range of my scooter , the weight it carries , the enviroment's average topography which i will be simplifying it at the first step to a 15% hill climb , and finally some dynamic/static restrictions... which i hope ican build upon . like adding chasis loads and analysis to data.

I want it to give me the cell number of the batteries , verify the loads and give me a electric-motor description . 

 

this was the road map.

 

Thank you for your kind replies .

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

Hello,

Say I have a rational function 

 

f:= q^4*(q^2+1)*((q^6+q^5-q^4-2*q^3+q+1)^6/q^13+(q^6+q^5-2*q^3-q^2+q+1)^6/q^25)/((1+q)^4*(-q^2+1)^2)

 

in a variable q, with big degrees in numerator and denominator. I happen to know that if I make a change of variable q=exp(Ix) this rational function can be written in the form

f(exp(Ix))=\sum_{k>0, n>=0} (coefficient(n,k)) sin^(2n-2)(kx/2), where this sum is finite.

I'm trying to find (1) what is the best way to simplify the rational function f and (2) how can I make the change of variable into these variables. 

I managed to put the rational function in terms of cos(x) and sin(x), however after a day of calculations the computer couldn't simplify the expression. 

For this I was using:  simplify(rationalize(convert(subs(q=exp(Ix),factor(rationalize(f))),trig)))

I appreciate any help.

Edit: Another way of getting this variables would be to force Maple to use multiple angle identities to write the powers of cosine(x) in terms of sin(kx). Is there any way to force this kind of simplification?

Suppose i have a message X encrypted using RSA with public code (n,e) and ascii (Here we treat the message as an array so don't worry about block-length) how would one go about writing a procedure that given a public key (n,e) with small n and a ciphertext message x will decrypt x. I have been looking online to see how we can get maple to take ascii into consideration but to no avail any help would be appreciated

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

 

 

Dear friends! I am facing problem to solve the below system of ODEs numerically please find the mistake and correct it.

alpha := -1; R := 2; m := 2; Pr := 7; Le := 1.25; Nt := .2; Nb := .2; g := .5; K1 := .1; Q := .5

Eq1 := eta^3*(diff(F(eta), eta, eta, eta, eta))+alpha*(eta^4*(diff(F(eta), eta, eta, eta))+eta^3*(diff(F(eta), eta, eta))-eta^2*F(eta))-2*eta^2*(diff(F(eta), eta, eta, eta))+3*eta*(diff(F(eta), eta, eta))-3*(diff(F(eta), eta))+eta*R*(diff(F(eta), eta))^2-3*eta*R*F(eta)*(diff(F(eta), eta, eta))+3*R*F(eta)*(diff(F(eta), eta))+3*eta^2*R*F(eta)*(diff(F(eta), eta, eta, eta))-eta^2*(diff(F(eta), eta))*(diff(F(eta), eta, eta))-M^2*(eta^3*(diff(F(eta), eta, eta))-eta^2*(diff(F(eta), eta))); Eq2 := eta*(diff(G(eta), eta, eta))+alpha*Pr*eta^2*(diff(G(eta), eta))+R*Pr*F(eta)*(diff(G(eta), eta))+Nb*eta*(diff(G(eta), eta))*(diff(H(eta), eta))+Nt*eta*(diff(G(eta), eta))^2+diff(G(eta), eta)+Q*Pr*eta*G(eta) = 0; Eq3 := eta*(diff(H(eta), eta, eta))+alpha*Le*Pr*eta^2*(diff(H(eta), eta))+R*Le*Pr*F(eta)*(diff(H(eta), eta))+Nt*eta*(diff(G(eta), eta, eta))/Nb+Nt*(diff(G(eta), eta))/Nb+diff(H(eta), eta)-g*Le*Pr*eta*H(eta)-Le*Pr*K1*eta = 0;

IC1 := F(0) = 0, F(1) = 1, (D(F))(0) = 0, (D(F))(1) = 0, (D(G))(0) = 0, G(1) = 1, (D(H))(0) = 0, H(1) = lambda; dsys1 := {Eq1, Eq2, Eq3, IC1}; dsol1 := dsolve(dsys1, numeric, continuation = lambda, range = 0 .. 1);

dsol1x := subs(dsol1, F(eta));

dsol1y := subs(dsol1, G(eta)); dsol1z := subs(dsol1, H(eta));
 

With my best regards and sincerely.

Muhammad Usman

School of Mathematical Sciences 
Peking University, Beijing, China

Hi all

I have 4 - 2a and (2x^2 - 2x + sqrt(2))^2. How to factor it become 2(2-a) and 2(sqrt(2)x^2 - sqrt(2)x + 1)^2 ?

Thanks you very much.

 

Hello people,

I am looking to use Maple and its loops, to develop the tensorial expressions in index notations such as this one:

My Sigma[11] is supposed to be a summation of the terms obtained when i then j are vary throughout the values, 1, 2 3 

 

Thanks

First 1016 1017 1018 1019 1020 1021 1022 Last Page 1018 of 2429