serena88

105 Reputation

7 Badges

10 years, 255 days

MaplePrimes Activity


These are replies submitted by serena88

@Jarekkk Thank you very much. =D

@Jarekkk Thank you very much. =D

thank you very much. it is very useful

thank you very much. it is very useful

@pagan 

Hi, similar to the above example, I now have a 1x3 matrix. For example, I have A:=Matrix([1,4,1]). I want an output of [1,4,2,4,2,4,2,4,2,4,2,4,1]

Here is what I did, but it is not working. Please help. Thanks.

E11M:=Matrix([1,13]):

for i from 1 to 6 do
nod:=(2*(i-1))+1;
E11M[nod..nod+2]:=E11
end do:

E11M

Please help. Many thanks

@pagan 

Hi, similar to the above example, I now have a 1x3 matrix. For example, I have A:=Matrix([1,4,1]). I want an output of [1,4,2,4,2,4,2,4,2,4,2,4,1]

Here is what I did, but it is not working. Please help. Thanks.

E11M:=Matrix([1,13]):

for i from 1 to 6 do
nod:=(2*(i-1))+1;
E11M[nod..nod+2]:=E11
end do:

E11M

Please help. Many thanks


Hi, Thanks for your response, Below is what I have. But if I change elenum to elenum:=Array([2,4,6,8,16]). Other changes that I made was in E0:= evalf(map(c->c*((map(int,((B1^%T).(B1).J), xi=0..1))),L)) and I also changed E2.

I cannot work out the big matrix to get E0M and E2M. Could you please help me out. Thanks

restart

NULLNULL

with(LinearAlgebra):``NULL

elenum := 16:

nodes := 2*elenum+1:

kx := 1:

ky := 1:

k := sqrt(kx^2+ky^2):

a := 1:

ka := k*a:

g := 9.81:

A := 1:

h := 10:

z := 0:

t := 0:NULL

interface(rtablesize = 33):

omega := g*k*tanh(k*h):

NULLNULL

NULL

`xη` := a*cos(eta/a):NULL``

`yη` := a*sin(eta/a):

L := evalf(Pi/(2*elenum))

0.9817477044e-1

(1)

NULL

NULL

J0 := (diff(`yη`, eta))*`xη`-`yη`*(diff(`xη`, eta)):

J := abs(J0)NULL

b1 := Matrix([[diff(`yη`, eta)], [-(diff(`xη`, eta))]])/J: 

b2 := Matrix([[-`yη`], [`xη`]])/J:

N0 := Matrix([[-(2*(1-eta))*(eta-1/2), 4*eta*(1-eta), 2*eta*(eta-1/2)]]):

B1 := Typesetting:-delayDotProduct(b1, N0):NULL

B2 := Typesetting:-delayDotProduct(b2, map(diff, N0, eta)):

E0 := evalf(map(int, 2.*Typesetting:-delayDotProduct(B1^%T, B1)*J*L, eta = 0 .. 1))

Matrix([[0.2617993879e-1, 0.1308996939e-1, -0.6544984697e-2], [0.1308996939e-1, .1047197551, 0.1308996939e-1], [-0.6544984697e-2, 0.1308996939e-1, 0.2617993879e-1]])

(3)

 

E1 := map(int, Typesetting:-delayDotProduct(B2^%T, B1)*J, eta = 0 .. 1):

E2 := evalf(map(int, Typesetting:-delayDotProduct(B2^%T, B2)*J/(2*L), eta = 0 .. 1))

Matrix([[11.88356909, -13.58122181, 1.697652727], [-13.58122181, 27.16244363, -13.58122181], [1.697652727, -13.58122181, 11.88356909]])

(4)

``

E0M := Matrix(33):

for i to elenum do nod := 2*(i-1)+1; E0M[nod .. nod+2, nod .. nod+2] := E0M[nod .. nod+2, nod .. nod+2]+E0 end do: 

E0M:

E2M := Matrix(33): 

for i to elenum do nod := 2*(i-1)+1; E2M[nod .. nod+2, nod .. nod+2] := E2M[nod .. nod+2, nod .. nod+2]+E2 end do:

E2M:NULL

E0E2 := evalf(Typesetting:-delayDotProduct(1/E0M, E2M)):

 



 


Hi, Thanks for your response, Below is what I have. But if I change elenum to elenum:=Array([2,4,6,8,16]). Other changes that I made was in E0:= evalf(map(c->c*((map(int,((B1^%T).(B1).J), xi=0..1))),L)) and I also changed E2.

I cannot work out the big matrix to get E0M and E2M. Could you please help me out. Thanks

restart

NULLNULL

with(LinearAlgebra):``NULL

elenum := 16:

nodes := 2*elenum+1:

kx := 1:

ky := 1:

k := sqrt(kx^2+ky^2):

a := 1:

ka := k*a:

g := 9.81:

A := 1:

h := 10:

z := 0:

t := 0:NULL

interface(rtablesize = 33):

omega := g*k*tanh(k*h):

NULLNULL

NULL

`xη` := a*cos(eta/a):NULL``

`yη` := a*sin(eta/a):

L := evalf(Pi/(2*elenum))

0.9817477044e-1

(1)

NULL

NULL

J0 := (diff(`yη`, eta))*`xη`-`yη`*(diff(`xη`, eta)):

J := abs(J0)NULL

b1 := Matrix([[diff(`yη`, eta)], [-(diff(`xη`, eta))]])/J: 

b2 := Matrix([[-`yη`], [`xη`]])/J:

N0 := Matrix([[-(2*(1-eta))*(eta-1/2), 4*eta*(1-eta), 2*eta*(eta-1/2)]]):

B1 := Typesetting:-delayDotProduct(b1, N0):NULL

B2 := Typesetting:-delayDotProduct(b2, map(diff, N0, eta)):

E0 := evalf(map(int, 2.*Typesetting:-delayDotProduct(B1^%T, B1)*J*L, eta = 0 .. 1))

Matrix([[0.2617993879e-1, 0.1308996939e-1, -0.6544984697e-2], [0.1308996939e-1, .1047197551, 0.1308996939e-1], [-0.6544984697e-2, 0.1308996939e-1, 0.2617993879e-1]])

(3)

 

E1 := map(int, Typesetting:-delayDotProduct(B2^%T, B1)*J, eta = 0 .. 1):

E2 := evalf(map(int, Typesetting:-delayDotProduct(B2^%T, B2)*J/(2*L), eta = 0 .. 1))

Matrix([[11.88356909, -13.58122181, 1.697652727], [-13.58122181, 27.16244363, -13.58122181], [1.697652727, -13.58122181, 11.88356909]])

(4)

``

E0M := Matrix(33):

for i to elenum do nod := 2*(i-1)+1; E0M[nod .. nod+2, nod .. nod+2] := E0M[nod .. nod+2, nod .. nod+2]+E0 end do: 

E0M:

E2M := Matrix(33): 

for i to elenum do nod := 2*(i-1)+1; E2M[nod .. nod+2, nod .. nod+2] := E2M[nod .. nod+2, nod .. nod+2]+E2 end do:

E2M:NULL

E0E2 := evalf(Typesetting:-delayDotProduct(1/E0M, E2M)):

 



 

Thanks.

Hi, I have a array with 5 numbers in it. I would like to multiply it into a 3x3 matrix, how do i do that?

for example A:=([3,5,7,9,15])

B:=Matrix([3x+4,2x-9,42],[8x+2,93x^2,6y],[5x/y,34y,32y^2])

how do i get 5 sets of output when i multiply it together? And can i get pick out each outpur as well? for example, I want the 3rd output which is the matrix multiply with 7, can I pick it out seperately if I wanted?

Please advice. Thanks.

Thanks.

Hi, I have a array with 5 numbers in it. I would like to multiply it into a 3x3 matrix, how do i do that?

for example A:=([3,5,7,9,15])

B:=Matrix([3x+4,2x-9,42],[8x+2,93x^2,6y],[5x/y,34y,32y^2])

how do i get 5 sets of output when i multiply it together? And can i get pick out each outpur as well? for example, I want the 3rd output which is the matrix multiply with 7, can I pick it out seperately if I wanted?

Please advice. Thanks.

Or if I have a 3x3 matrix, how can I integrate each row by a different term?

Thanks

@Jarekkk Thank you much for your help. xx

@Jarekkk Thank you much for your help. xx

@acer

Hi Acer, I have written a worksheet that gives me correct answers. However, it seems very complicated and doesn't seem to be the right way to do it. I am using too many "map" and "zip" in it. I will be using and editting this worksheet for a couple more month. Is there a way that i can send it over to you someone to check and see if you can simplify or see what is it that i'm doing wrong.

Please advice. Thanks

@acer

Hi Acer, I have written a worksheet that gives me correct answers. However, it seems very complicated and doesn't seem to be the right way to do it. I am using too many "map" and "zip" in it. I will be using and editting this worksheet for a couple more month. Is there a way that i can send it over to you someone to check and see if you can simplify or see what is it that i'm doing wrong.

Please advice. Thanks

1 2 3 4 5 6 Page 3 of 6