Maple 18 Questions and Posts

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

Hi, My name is mohammed and I am a P.h.D student . I am a new user with Maple . I had two questions

First one : How can I execute a number of commands by using worksheet or document mode ? can any one  provide me an example?

Second : How can I measure the time for a number of command? can any one provide with syntax of the command?

to compute a maple program using the paper posted in the reply 

Hi!

I want to select 'Export using shapes for greater fidelity' under option, Export. But I can't find the tab ' Export to PDF-Format'. I'm using Maple 18 on a Mac-computer. 

Can anyone help?

Thanks

 

Esben 

Hello maple users,

I have 2 functions and each functions has 8 variables. I run a matlab code and get outputs for different values of these variables. I assumed 3 of them as constant because the combinations are too many. Anyway, I plot the results and I can see that one function is much better than the other. But I need to compare these functions mathematically. I need to show some proofs. Has anyone any idea what should I do? I wrote the functions on maple and take derivative with respect to one variable and try to see the reaction of the functions to that variable. i am confused.

 

Thanks

 

Hello

I have some problem with " For loop". If i add more then one expression the, i recieve an error. Could you please help me to solve it? I have attached my file. Thank you.


restart 

with(ImageTools):NULL

with(FileTools):NULLNULL

Input Section

 

``

filelocation := "C:\\Users\\Mohammad\\Desktop\\ExerciseII\\1.jpg":

k := 3:``

 

zimage := Read(filelocation):

 

zwidth := Width(zimage):``

kernell := VectorCalculus:-`+`(VectorCalculus:-`*`(2, k), 1):NULLNULL

kerneld := `~`[`*`](Array(1 .. kernell, 1 .. kernell, 1), 1/kernell^2):

imheight := Height(zimage):NULL

imwidth := Width(zimage):````

Width(zimage, lower):

Width(zimage, upper):

View(zimage):NULL

new1zpic := Convolution(zimage, kerneld):

View(new1zpic)NULL``

aa := zimage(1 .. (), 1 .. (), 1):

bb := zimage(1 .. (), 1 .. (), 2):

cc := zimage(1 .. (), 1 .. (), 3):NULL

subimage := Matrix(VectorCalculus:-`+`(VectorCalculus:-`*`(2, k), 1), VectorCalculus:-`+`(VectorCalculus:-`*`(2, k), 1), 0):

newaa := aa:

"for i from k+1 to (RowDimension(aa)-k-1) do     for j from k+1 to (ColumnDimension(aa)-k-1) do     subimage:=aa(i-k..i+k,j-k..j+k).~kerneld     newaa(i,j):=add(add(subimage(m,n),m=1..(2 .k+1),n=1..(2*k+1))) end do; end do;"

Error, unterminated loop

"for i from k+1 to (RowDimension(aa)-k-1) do     for j from k+1 to (ColumnDimension(aa)-k-1) do  subimage:=aa(i-k..i+k,j-k..j+k).~kerneld    newaa(i,j):=add(add(subimage(m,n),m=1..(2 .k+1),n=1..(2*k+1))) end do; end do;"

 

 

``


Download pak2.mw

Hello

Is there any option to create a vector with logaritmically spaced? somthing like "logspace" in matlab. (logspace(0:10:20))

Thank you.

Hello

1)I need some guides to solve my problem. I have attached my file. Could you please help me to understand what's wrong in my code?

2) Is there any option to pause "Loops" and watching results, something like break point.

THank you.

 

 

restart

 

with(ImageTools):``

with(FileTools):````

Input Section

 

NULL

filelocation := "C:\\Users\\Mohammad\\Desktop\\1.jpg":

k := 1:NULL

 

zimage := Read(filelocation):

zwidth := Width(zimage):NULL

kernel__length := VectorCalculus:-`+`(VectorCalculus:-`*`(2, k), 1):````

kernel__data := `~`[`*`](Matrix(1 .. kernel__length, 1 .. kernel__length, 1), 1/kernel__length^2):

imheight := Height(zimage):``

imwidth := Width(zimage):NULLNULL

Width(zimage, lower):

Width(zimage, upper):

View(zimage):``

new1zpic := Convolution(zimage, kernel__data):

View(new1zpic)``NULL

new2zpic := zimage:

dummy := 0:

"for i from (k+1)  to (Width(zimage,upper)-k) do     for j from (k+1)  to (Height(zimage,upper)-k) do           for m from 1 to kernel[length]  do               for n from 1 to kernel[length]  do                         dummy:=dummy+kernel[data] (m, n)*new2zpic(i+m-2, j+n-2)                                         end do;              end do;                      new2zpic(i,j):=dummy:                   dummy:=0:   end do; end do;"

Error, final value in for loop must be numeric or character

 

 

 

 

NULL

 

Download Exercise_II-1.0.mw

restart

 

with(ImageTools):``

with(FileTools):````

Input Section

 

NULL

filelocation := "C:\\Users\\Mohammad\\Desktop\\1.jpg":

k := 1:NULL

 

zimage := Read(filelocation):

zwidth := Width(zimage):NULL

kernel__length := VectorCalculus:-`+`(VectorCalculus:-`*`(2, k), 1):````

kernel__data := `~`[`*`](Matrix(1 .. kernel__length, 1 .. kernel__length, 1), 1/kernel__length^2):

imheight := Height(zimage):``

imwidth := Width(zimage):NULLNULL

Width(zimage, lower):

Width(zimage, upper):

View(zimage):``

new1zpic := Convolution(zimage, kernel__data):

View(new1zpic)``NULL

new2zpic := zimage:

dummy := 0:

"for i from (k+1)  to (Width(zimage,upper)-k) do     for j from (k+1)  to (Height(zimage,upper)-k) do           for m from 1 to kernel[length]  do               for n from 1 to kernel[length]  do                         dummy:=dummy+kernel[data] (m, n)*new2zpic(i+m-2, j+n-2)                                         end do;              end do;                      new2zpic(i,j):=dummy:                   dummy:=0:   end do; end do;"

Error, final value in for loop must be numeric or character

 

 

 

 

NULL

 

Download Exercise_II-1.0.mw

So here is the issue: I have a 50 by 50 tridiagonal matrix. The entries in the first row, first column are -i*x and the last row last column is -i*x; these are along the main diagonal, where i is complex and x is a variable. Everything in between these two entries is 0. Above and below the main diagonal the entries are -1. My issue is that I have to find a conditon on x that makes the eigenvalues real. I am completely new to maple and have no programming experience.. Can someone show me how to this?

I am trying to expand out the terms  of equation 13.  The expand command causes the lhs to be zero?


Initialize the metric and tetrad

 

restart; with(Physics); with(Tetrads); with(PDETools)

0, "%1 is not a command in the %2 package", Tetrads, Physics

(1.1)

X = [zetabar, zeta, v, u]

X = [zetabar, zeta, v, u]

(1.2)

ds2 := Physics:-`*`(Physics:-`*`(2, dzeta), dzetabar)+Physics:-`*`(Physics:-`*`(2, du), dv)+Physics:-`*`(Physics:-`*`(2, H(zetabar, zeta, v, u)), (du+Physics:-`*`(Ybar(zetabar, zeta, v, u), dzeta)+Physics:-`*`(Y(zetabar, zeta, v, u), dzetabar)-Physics:-`*`(Physics:-`*`(Y(zetabar, zeta, v, u), Ybar(zetabar, zeta, v, u)), dv))^2)

2*dzeta*dzetabar+2*du*dv+2*H(zetabar, zeta, v, u)*(du+Ybar(zetabar, zeta, v, u)*dzeta+Y(zetabar, zeta, v, u)*dzetabar-Y(zetabar, zeta, v, u)*Ybar(zetabar, zeta, v, u)*dv)^2

(1.3)

declare(ds2)

Ybar(zetabar, zeta, v, u)*`will now be displayed as`*Ybar

(1.4)

NULL

vierbien = Matrix([[1, 0, -Ybar(zetabar, zeta, v, u), 0], [0, 1, -Y(zetabar, zeta, v, u), 0], [Physics:-`*`(H(zetabar, zeta, v, u), Y(zetabar, zeta, v, u)), Physics:-`*`(H(zetabar, zeta, v, u), Ybar(zetabar, zeta, v, u)), 1-Physics:-`*`(Physics:-`*`(H(zetabar, zeta, v, u), Y(zetabar, zeta, v, u)), Ybar(zetabar, zeta, v, u)), H(zetabar, zeta, v, u)], [Y(zetabar, zeta, v, u), Ybar(zetabar, zeta, v, u), -Physics:-`*`(Y(zetabar, zeta, v, u), Ybar(zetabar, zeta, v, u)), 1]])

vierbien = (Matrix(4, 4, {(1, 1) = 1, (1, 2) = 0, (1, 3) = -Ybar(zetabar, Zeta, v, u), (1, 4) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = -Y(zetabar, Zeta, v, u), (2, 4) = 0, (3, 1) = H(zetabar, Zeta, v, u)*Y(zetabar, Zeta, v, u), (3, 2) = H(zetabar, Zeta, v, u)*Ybar(zetabar, Zeta, v, u), (3, 3) = 1-H(zetabar, Zeta, v, u)*Y(zetabar, Zeta, v, u)*Ybar(zetabar, Zeta, v, u), (3, 4) = H(zetabar, Zeta, v, u), (4, 1) = Y(zetabar, Zeta, v, u), (4, 2) = Ybar(zetabar, Zeta, v, u), (4, 3) = -Y(zetabar, Zeta, v, u)*Ybar(zetabar, Zeta, v, u), (4, 4) = 1}))

(1.5)

``

NULL

Setup(tetrad = rhs(vierbien = Matrix(%id = 18446744078213056502)), metric = ds2, mathematicalnotation = true, automaticsimplification = true, coordinatesystems = (X = [zetabar, zeta, v, u]), signature = "+++-")

[automaticsimplification = true, coordinatesystems = {X}, mathematicalnotation = true, metric = {(1, 1) = 2*H(X)*Y(X)^2, (1, 2) = 1+2*H(X)*Y(X)*Ybar(X), (1, 3) = -2*H(X)*Y(X)^2*Ybar(X), (1, 4) = 2*H(X)*Y(X), (2, 2) = 2*H(X)*Ybar(X)^2, (2, 3) = -2*H(X)*Ybar(X)^2*Y(X), (2, 4) = 2*H(X)*Ybar(X), (3, 3) = 2*H(X)*Y(X)^2*Ybar(X)^2, (3, 4) = 1-2*H(X)*Y(X)*Ybar(X), (4, 4) = 2*H(X)}, signature = `+ + + -`, tetrad = {(1, 1) = 1, (1, 3) = -Ybar(X), (2, 2) = 1, (2, 3) = -Y(X), (3, 1) = H(X)*Y(X), (3, 2) = H(X)*Ybar(X), (3, 3) = 1-H(X)*Y(X)*Ybar(X), (3, 4) = H(X), (4, 1) = Y(X), (4, 2) = Ybar(X), (4, 3) = -Y(X)*Ybar(X), (4, 4) = 1}]

(1.6)

gamma_[4, 1, 1] = 0

diff(Ybar(X), zeta)-(diff(Ybar(X), u))*Ybar(X) = 0

(1)

gamma_[4, 2, 2] = 0

diff(Y(X), zetabar)-(diff(Y(X), u))*Y(X) = 0

(2)

gamma_[1, 4, 4] = 0

(diff(Ybar(X), u))*Y(X)*Ybar(X)-Y(X)*(diff(Ybar(X), zeta))-Ybar(X)*(diff(Ybar(X), zetabar))-(diff(Ybar(X), v)) = 0

(3)

gamma_[2, 4, 4] = 0

(diff(Y(X), u))*Y(X)*Ybar(X)-Y(X)*(diff(Y(X), zeta))-(diff(Y(X), zetabar))*Ybar(X)-(diff(Y(X), v)) = 0

(4)

gamma_[3, 4, 4] = 0

0 = 0

(5)

gamma_[4, 4, 4] = 0

0 = 0

(6)

shearconditions := {diff(Y(X), zetabar)-(diff(Y(X), u))*Y(X) = 0, diff(Ybar(X), zeta)-(diff(Ybar(X), u))*Ybar(X) = 0, (diff(Y(X), u))*Y(X)*Ybar(X)-Y(X)*(diff(Y(X), zeta))-(diff(Y(X), zetabar))*Ybar(X)-(diff(Y(X), v)) = 0, (diff(Ybar(X), u))*Y(X)*Ybar(X)-Y(X)*(diff(Ybar(X), zeta))-Ybar(X)*(diff(Ybar(X), zetabar))-(diff(Ybar(X), v)) = 0}:

 

 

RicciT := proc (a, b) options operator, arrow; SumOverRepeatedIndices(Ricci[mu, nu]*e_[a, `~mu`]*e_[b, `~nu`]) end proc

proc (a, b) options operator, arrow; Physics:-SumOverRepeatedIndices(Physics:-`*`(Physics:-`*`(Physics:-Ricci[mu, nu], Physics:-Tetrads:-e_[a, `~mu`]), Physics:-Tetrads:-e_[b, `~nu`])) end proc

(7)

SlashD := proc (f, a) options operator, arrow; SumOverRepeatedIndices(D_[b](f)*e_[a, `~b`]) end proc

proc (f, a) options operator, arrow; Physics:-SumOverRepeatedIndices(Physics:-`*`(Physics:-D_[b](f), Physics:-Tetrads:-e_[a, `~b`])) end proc

(8)

SlashD(f(X), 1)

diff(f(X), zeta)-Ybar(X)*(diff(f(X), u))

(9)

SlashD(f(X), 2)

diff(f(X), zetabar)-Y(X)*(diff(f(X), u))

(10)

SlashD(f(X), 3)

(1+H(X)*Y(X)*Ybar(X))*(diff(f(X), u))-H(X)*((diff(f(X), zeta))*Y(X)+Ybar(X)*(diff(f(X), zetabar))+diff(f(X), v))

(11)

SlashD(f(X), 4)

-Y(X)*Ybar(X)*(diff(f(X), u))+Ybar(X)*(diff(f(X), zetabar))+(diff(f(X), zeta))*Y(X)+diff(f(X), v)

(12)

NULL

  simplify(RicciT(1, 2), shearconditions) = 0

H(X)*(diff(diff(Y(X), zeta), zetabar))*Ybar(X)-H(X)*Ybar(X)*Y(X)*(diff(diff(Ybar(X), u), zetabar))-H(X)*Ybar(X)^2*(diff(diff(Y(X), u), zetabar))-H(X)*Y(X)^2*(diff(diff(Ybar(X), u), zeta))-2*H(X)*Y(X)*Ybar(X)*(diff(diff(Y(X), u), zeta))+H(X)*Y(X)^2*Ybar(X)*(diff(diff(Ybar(X), u), u))-H(X)*Y(X)*(diff(diff(Ybar(X), u), v))+H(X)*Y(X)*Ybar(X)^2*(diff(diff(Y(X), u), u))-H(X)*(diff(diff(Y(X), u), v))*Ybar(X)+H(X)*(diff(Ybar(X), zetabar))^2+(-3*H(X)*Y(X)*(diff(Ybar(X), u))-(diff(H(X), u))*Y(X)*Ybar(X)+(diff(H(X), zeta))*Y(X)+(diff(H(X), zetabar))*Ybar(X)+diff(H(X), v))*(diff(Ybar(X), zetabar))+H(X)*(diff(Y(X), zeta))^2+(-4*H(X)*(diff(Y(X), u))*Ybar(X)-(diff(H(X), u))*Y(X)*Ybar(X)+(diff(H(X), zeta))*Y(X)+(diff(H(X), zetabar))*Ybar(X)+diff(H(X), v))*(diff(Y(X), zeta))+2*H(X)*Y(X)^2*(diff(Ybar(X), u))^2-Y(X)*(-(diff(H(X), u))*Y(X)*Ybar(X)+(diff(H(X), zeta))*Y(X)+(diff(H(X), zetabar))*Ybar(X)+diff(H(X), v))*(diff(Ybar(X), u))+2*(diff(Y(X), u))*Ybar(X)*(H(X)*(diff(Y(X), u))*Ybar(X)+(1/2)*(diff(H(X), u))*Y(X)*Ybar(X)-(1/2)*(diff(H(X), zeta))*Y(X)-(1/2)*(diff(H(X), zetabar))*Ybar(X)-(1/2)*(diff(H(X), v))) = 0

(13)

``

0 = 0

0 = 0

(14)

``

Why does the expand command cause the lhs to be zero?

NULL


Download Question_R12.mw

Hello every one,

Is any one knows how to solve the following inequality with assumptions that all parameters are real positive and k<1 and delta > c*alpha

(1/2)*((alpha*k^2-3*alpha*k-2*beta)*sqrt(delta^2*(k-1)*(k-2)*(c*alpha-delta)^2)-k*delta*(alpha*k^2-3*alpha*k+2*alpha-2*beta)*(c*alpha-delta))/(delta^2*(alpha*k^2-3*alpha*k-2*beta))<0

I tried the following code but it  dosn't make sense:

u:=(1/2)*((alpha*k^2-3*alpha*k-2*beta)*sqrt(delta^2*(k-1)*(k-2)*(c*alpha-delta)^2)-k*delta*(alpha*k^2-3*alpha*k+2*alpha-2*beta)*(c*alpha-delta))/(delta^2*(alpha*k^2-3*alpha*k-2*beta))

solve({u < 0,alpha > 0, beta > 0, c > 0, delta > 0, delta > c*alpha, k > 0, k < 1, })

In fact I want to know under which circumastances the above inequality is negative.

THX

Hi
I have my question makes any sense. I am from Denmark and not used to write math in english.

I have an characteristic matrix with an variable λ that takes on differen values.

How do I write λ in the matrix so Maple knows that when I call out a row with the variable λ in it and asssign

λ to a specific value, Maple changes λ to the specific value.

 

Example (I was thinking something like this):

A:=Matrix(2,2,[(1-λ_i),2,3,(4-λ_i)])

λ_1:=2

λ_2:=4

A[1],λ_1               (1-2) 2

A[1],λ_2               (1-4) 2

A[2],λ_1               3 (4-2)

A[2],λ_2               3 (4-4)

 

Hello,

please explain how to write a code to calculate and output the actual area using integration for y=X^3 over range (0,2) using left-hand rule and 200 subdivisions?

 

Thank you 

please is there any one can help me to find a solution of a sytem of 3 non linear equations each with 3 variable and with more than 30 unknown coefficients

this is the system

solve({EEE_x(x, y, z) = 0, EEE_y(x, y, z) = 0, EEE_z(x, y, z) = 0}, {x, y, z})

where x,y,r are the unknowns

and the three equations are simply the partial derivative with respect to x,y and z repectively

EEE_x(x,y,z):=(&DifferentialD;)/(&DifferentialD; x) EE(x,y,z)

EEE_y(x,y,z):=(&DifferentialD;)/(&DifferentialD; y) EE(x,y,z)

EEE_z(x,y,z):=(&DifferentialD;)/(&DifferentialD;z)EE(x,y,z)

the main equation is EE where (it has 3 variables and more than 30 qunknowns coefficients

(x, y, z) ->

1
----------------------------------------------------------------
2
/ 2 2 2\
hh \ii + jj x + ll z + mm y + 100. y + nn y z + oo x + pp z /

/ 2 2 2 2 3 2
\p z y + q z y + l z x + g z x + o z y + n z x + m y x

2 2 2 3 2 2 2
+ j y x + k y x + i z y + d z y + f z x + h z y

2 2 4 3 2 3
+ e y x + u z y x + v z y x + a + b x + c x + r x + s z

2 2 4 3 4 \
+ t z + bb z + cc y + dd y + ee y + ff y + gg z + aa x/

 

A rigid rotating body is a moving mass, so that kinetic energy can have expressed in terms of the angular speed of the object and a new quantity called moment of inertia, which depends on the mass of the body and how it is such distributed mass. Now we'll see with maple.

 

Momento_de_Inercia.mw

(in spanish)

Atte.

L. Araujo C.

In this section, we will consider several linear dynamical systems in which each mathematical model is a differential equation of second order with constant coefficients with initial conditions specifi ed in a time that we take as t = t0.

All in maple.

 

Vibraciones.mw

(in spanish)

 

Atte.

L.AraujoC.

First 63 64 65 66 67 68 69 Last Page 65 of 86