Items tagged with multiplication

I have two symmetric real matrices as below (Mt,Kk).

I multilpy them in Mt.Kk.Mt.

But the result is not symmetric.!!!!why????

 

``

restart; with(LinearAlgebra)

Error, invalid input: with expects its 1st argument, pname, to be of type {`module`, package}, but received shareman

 

Mt := ImportMatrix("C:/Mt.mpl"); -1; Norm(Mt-LinearAlgebra:-HermitianTranspose(Mt), 2)

0.

(1)

Kk := ImportMatrix("C:/Kk.mpl"); -1; Norm(Kk-LinearAlgebra:-HermitianTranspose(Kk), 2)

0.

(2)

Aa := Typesetting:-delayDotProduct(Typesetting:-delayDotProduct(Mt, Kk), Mt); -1; Norm(Aa-LinearAlgebra:-HermitianTranspose(Aa))

4608.00000953674316

(3)

Aa

RTABLE(18446744074182082558, complex[8], Matrix, rectangular, Fortran_order, [], 2, 1 .. 45, 1 .. 45)

(4)

``

``

``

``

``

``

``

``

``

``

``

``

``

Download question.mw

I couldnt upload Kk.mlp and Mt.mlp so changed their extensions to mw. for using please change them to .mlp

Download Kk.mw

Download Mt.mw

 

Hi there,

I'm new here. My first question:

Is there a way to make Maple output display explicit multiplcations signs in 2D-math?

Example:
When you enter 5*2^x Maple will output 5*2^x. Is there a way to make Maple display the multiplications signs in output in stead just implicit multiplication signs (i.e. whitepaces)? (I would settle for Maple display all multiplication signs in output - not just the ones which are made explicit in the input.)

I searched this site. No luck. I looked into "Typesetting Rule Assistant", but I couldn't find a way to alter the output of multiplication sign (*).

Can you guys help me?

Kind Regards,

Jens

 

P.S.: I'm a teacher from Denmark. We use Maple before college/university for a lot of pupils. Some less competent pupils have a tendency to overlook the whitespace.

Consider the following code:

LM := [
   Matrix([[1,2],[3,4]]),
   Matrix([[5,6],[7,8]])
];
A := Matrix([[0,1],[1,0]]);
map(x -> A . x,LM);
A .~ LM;

where LM is a list of two matrices (just a test example), and A is some (test)matrix that I want to multiply onto each of these two matrices from the left, say. The map-construction works, as expected, but the elementwise operation .~ produces an error. Why?

I found the following: 

Question:matrix multiplication element by element

Does this not apply to vectors?  If not what syntax is required?  I cannot seem to execute this simple operation which I can easily do in MATLAB.  If you have such a capability why is it not clearly documented in the HELP pages?

Dear all,

I am creating an animation, and I was wondering if I can add a multiplier to my equation in a specific range.  So starting from z:=0.2 add a multiplier (z+1). The code I have so far is added. Does anyone know a code for this?

Kind regards

restart; 
with(plots); 
a := -1/2; b := 1/2; c := -2; d := 2; n := 20; 
g := proc (x) options operator, arrow; value(Int(sigma(t), t = 0 .. x)) end proc; 
sigma := proc (z) options operator, arrow; 2*sqrt(2*h^2-4*z^2)*z/h^2 end proc; 
h := i/n; 
for i to n do 
an2[i] := plot(sigma(z), z = -(1/2)*h .. (1/2)*h, view = [a .. b, c .. d], color = AQUAMARINE); 
an3[i] := plot(2*g(x), x = 0 .. (1/2)*h, view = [a .. b, c .. d], color = RED) 
end do; 
p := plots[display]([seq(an2[i], i = 1 .. n)], insequence = true); 
q := plots[display]([seq(an3[i], i = 1 .. n)], insequence = true); display(p, q)

 

Hej all,

I have a problem. When i have a 9-1 vector "DD" how can i get maple to solve DD^2 my equation is A=(pi/4)*DD^2 should be simple.

 

Also when i have two vectors one is 9-1 and the other is 5-1 i want to divide the 5-1 / 9-1 but i want all possible soluitons? not just 5 results but 45 results.(the zip fuction only gives me 5 results)

 

Pls help 

 

Kind regards

system3d := a[1](a[1])+a[2]*a[4]+a[3]*a[7]-a[1](a[1])-a[2]*a[10]-a[3]*a[19], a[1]*a[2]-a[1]*a[2]+a[2]*a[5]-a[2]*a[11]+a[3]*a[8]-a[3]*a[20], a[1]*a[3]-a[1]*a[3]+a[2]*a[6]-a[2]*a[12]+a[3]*a[9]-a[3]*a[21], a[1]*a[4]-a[1]*a[4]-a[2]*a[13]-a[3]*a[22]+a[4]*a[5]+a[6]*a[7], a[2]*a[4]+a[5](a[5])+a[6]*a[8]-a[1]*a[5]-a[2]*a[14]-a[3]*a[23], a[3]*a[4]+a[5]*a[6]+a[6]*a[9]-a[1]*a[6]-a[2]*a[15]-a[3]*a[24], a[1]*a[7]+a[4]*a[8]+a[7]*a[9] = a[1]*a[7]+a[2]*a[16]+a[3]*a[25], a[2]*a[7]+a[5]*a[8]+a[8]*a[9] = a[1]*a[8]+a[2]*a[17]+a[3]*a[26], a[3]*a[7]+a[6]*a[8]+a[9](a[9]) = a[1]*a[9]+a[2]*a[18]+a[3]*a[27];
print(`output redirected...`); # input placeholder
a[2] a[4] - a[2] a[10] + a[3] a[7] - a[3] a[19],

a[2] a[5] - a[2] a[11] + a[3] a[8] - a[3] a[20],

a[2] a[6] - a[2] a[12] + a[3] a[9] - a[3] a[21],

-a[2] a[13] - a[3] a[22] + a[4] a[5] + a[6] a[7], a[2] a[4]

+ a[5](a[5]) + a[6] a[8] - a[1] a[5] - a[2] a[14] - a[3] a[23],
-a[1] a[6] - a[2] a[15] + a[3] a[4] - a[3] a[24] + a[5] a[6]

+ a[6] a[9], a[1] a[7] + a[4] a[8] + a[7] a[9] = a[1] a[7]

+ a[2] a[16] + a[3] a[25], a[2] a[7] + a[5] a[8] + a[8] a[9] =

a[1] a[8] + a[2] a[17] + a[3] a[26], a[3] a[7] + a[6] a[8]

+ a[9](a[9]) = a[1] a[9] + a[2] a[18] + a[3] a[27]

solve({system3d}, {a[1]*a[2], a[1]*a[3], a[1]*a[4], a[1]*a[5], a[1]*a[6], a[1]*a[7], a[1]*a[8], a[1]*a[9], a[2]*a[4], a[2]*a[5], a[2]*a[6], a[2]*a[7], a[2]*a[10], a[2]*a[11], a[2]*a[12], a[2]*a[13], a[2]*a[14], a[2]*a[15], a[2]*a[16], a[2]*a[17], a[2]*a[18], a[3]*a[4], a[3]*a[7], a[3]*a[8], a[3]*a[9], a[3]*a[19], a[3]*a[20], a[3]*a[21], a[3]*a[22], a[3]*a[23], a[3]*a[24], a[3]*a[25], a[3]*a[26], a[3]*a[27], a[4]*a[5], a[4]*a[8], a[5]*a[6], a[5]*a[8], a[6]*a[7], a[6]*a[8], a[6]*a[9], a[7]*a[9], a[8]*a[9], a[1](a[1]), a[5](a[5]), a[9](a[9])});
%;
Warning, solving for expressions other than names or functions is not recommended.
{a[1] a[2] = a[1] a[2], a[1] a[3] = a[1] a[3],

a[1] a[4] = a[1] a[4], a[1] a[5] = a[2] a[10] - a[3] a[7]

+ a[3] a[19] + a[5](a[5]) + a[6] a[8] - a[2] a[14]

- a[3] a[23], a[1] a[6] = -a[2] a[15] + a[3] a[4] - a[3] a[24]

+ a[5] a[6] + a[6] a[9], a[1] a[7] = a[1] a[7], a[1] a[8] = a[

2] a[7] - a[2] a[17] - a[3] a[26] + a[5] a[8] + a[8] a[9], a[1]

a[9] = a[3] a[7] + a[6] a[8] + a[9](a[9]) - a[2] a[18]

- a[3] a[27], a[2] a[4] = a[2] a[10] - a[3] a[7] + a[3] a[19],

a[2] a[5] = a[2] a[11] - a[3] a[8] + a[3] a[20],

a[2] a[6] = a[2] a[12] - a[3] a[9] + a[3] a[21],

a[2] a[7] = a[2] a[7], a[2] a[10] = a[2] a[10],

a[2] a[11] = a[2] a[11], a[2] a[12] = a[2] a[12],

a[2] a[13] = -a[3] a[22] + a[4] a[5] + a[6] a[7],

a[2] a[14] = a[2] a[14], a[2] a[15] = a[2] a[15],

a[2] a[16] = -a[3] a[25] + a[4] a[8] + a[7] a[9],

a[2] a[17] = a[2] a[17], a[2] a[18] = a[2] a[18],

a[3] a[4] = a[3] a[4], a[3] a[7] = a[3] a[7],

a[3] a[8] = a[3] a[8], a[3] a[9] = a[3] a[9],

a[3] a[19] = a[3] a[19], a[3] a[20] = a[3] a[20],

a[3] a[21] = a[3] a[21], a[3] a[22] = a[3] a[22],

a[3] a[23] = a[3] a[23], a[3] a[24] = a[3] a[24],

a[3] a[25] = a[3] a[25], a[3] a[26] = a[3] a[26],

a[3] a[27] = a[3] a[27], a[4] a[5] = a[4] a[5],

a[4] a[8] = a[4] a[8], a[5] a[6] = a[5] a[6],

a[5] a[8] = a[5] a[8], a[6] a[7] = a[6] a[7],

a[6] a[8] = a[6] a[8], a[6] a[9] = a[6] a[9],

a[7] a[9] = a[7] a[9], a[8] a[9] = a[8] a[9],

a[1](a[1]) = a[1](a[1]), a[5](a[5]) = a[5](a[5]),

a[9](a[9]) = a[9](a[9])}

 

 

 

the program runs however the warning message pops ...what can i do to eliminate the problem??? 


Hello! 

I'm trying to plt something, I can't see why Maple isn't multiplying these two rows as it should. 

Can anyone see the problem?

 

This preamble is loaded:

restart;

with(Units[Standard]);
with(ArrayTools);

with(LinearAlgebra);

with(Statistics);
with(plots);
with(CurveFitting);

 

 

 

 

 

with(plots):

with(LinearAlgebra):

 

asd := [3.5400000*10^5, 3.4700000*10^5, 3.3700000*10^5, 3.2700000*10^5, 3.1700000*10^5, 3.0900000*10^5, 3.0300000*10^5, 2.9600000*10^5, 2.9200000*10^5, 2.8900000*10^5, 2.8600000*10^5, 2.8500000*10^5, 2.8200000*10^5, 2.8100000*10^5, 2.7900000*10^5, 2.7800000*10^5, 2.7800000*10^5, 2.7700000*10^5, 2.7600000*10^5]:
 

NULL

asf := [0.2866400798e-1, 0.6112772793e-1, 0.9946549241e-1, .1349950150, .1645923341, .1877395591, .2054364684, .2189514789, .2293646837, .2374847679, .2439099369, .2490583805, .2532402792, .2566744211, .2595269747, .2619197962, .2639470478, .2656751966, .2671596322]:

 

asd*asf;

[354000.0000, 347000.0000, 337000.0000, 327000.0000, 317000.0000, 309000.0000, 303000.0000, 296000.0000, 292000.0000, 289000.0000, 286000.0000, 285000.0000, 282000.0000, 281000.0000, 279000.0000, 278000.0000, 278000.0000, 277000.0000, 276000.0000]*[0.2866400798e-1, 0.6112772793e-1, 0.9946549241e-1, .1349950150, .1645923341, .1877395591, .2054364684, .2189514789, .2293646837, .2374847679, .2439099369, .2490583805, .2532402792, .2566744211, .2595269747, .2619197962, .2639470478, .2656751966, .2671596322]

(1)

 

NULL

 

Thank you!

Download maple_what.mw

I was wondering if there is a way to represent a matrix in a reduced state.  By this I am talking about:

      | 1/3 1/3|

A:=| 1/3 1/3|  Where A is 2x2 matrix.  I would like represent it as:

 

           | 1 1|

A:=1/3| 1 1| is that possible with maple???

 

Thanks

     

Eight matrices inside the list J:

J := [Matrix([[1, 0], [0, 1]]), Matrix([[0, -I], [-I, 0]]), Matrix([[0, -1], [1, 0]]), Matrix([[-I, 0], [0, I]]), Matrix([[-1, 0], [0, -1]]), Matrix([[0, I], [I, 0]]), Matrix([[0, 1], [-1, 0]]), Matrix([[I, 0], [0, -I]])];

 

Function member identifies J[2] as a member of J and returns its position in j:


member(J[2], J, 'j'); j;

 

Matrix multiplication inside a loop does not have a matrix type:


for i to 1 do for j to 2 do a := J[i].J[j]; member(a, J, 'k'); print(i, j, k, a, whattype(a)) end do end do;

Has anyone any ideia of what is going on?

 


I am trying to setup a Dual Quaternion Multiplication Table. I found the table on Wikki. I  need some help here.

Have set

x1  =1   x2 = i   x3  =j   x4   =k   x5 =e   x6 = ei   x7 = ej   x8 =ek

 

restart

                                                                                                              #    x1   x2    x3   x4    x5   x6    x7   x8

with(DifferentialGeometry):

NULL

 

StructureEquations := [[x1, x1] = x1, [x1, x2] = x2, [x1, x3] = x3, [x1, x4] = x4, [x1, x5] = x1*x5, [x1, x6] = x6, [x1, x7] = x7, [x1, x8] = x8, [x2, x1] = x2, [x2, x2] = -1, [x2, x3] = x4, [x2, x4] = -x3, [x2, x5] = x6, [x2, x6] = -x5, [x2, x7] = x8, [x2, x8] = -x7, [x3, x1] = x3, [x3, x2] = -x4, [x3, x3] = -1, [x3, x4] = x2, [x3, x5] = x7, [x3, x6] = -x8, [x3, x7] = -x5, [x3, x8] = x6, [x4, x1] = x4, [x4, x2] = x3, [x4, x3] = -x2, [x4, x4] = -1, [x4, x5] = x8, [x4, x6] = x7, [x4, x7] = -x6, [x4, x8] = -x5, [x5, x1] = x5, [x5, x2] = x6, [x5, x3] = x7, [x5, x4] = x8, [x5, x5] = 0, [x6, x1] = x6, [x6, x2] = -x5, [x6, x3] = x8, [x6, x4] = -x7, [x7, x1] = x7, [x7, x2] = -x8, [x7, x3] = -x5, [x7, x4] = x6, [x8, x1] = x8, [x8, x2] = x7, [x8, x3] = -x6, [x8, x4] = -x5]

[[x1, x1] = x1, [x1, x2] = x2, [x1, x3] = x3, [x1, x4] = x4, [x1, x5] = x1*x5, [x1, x6] = x6, [x1, x7] = x7, [x1, x8] = x8, [x2, x1] = x2, [x2, x2] = -1, [x2, x3] = x4, [x2, x4] = -x3, [x2, x5] = x6, [x2, x6] = -x5, [x2, x7] = x8, [x2, x8] = -x7, [x3, x1] = x3, [x3, x2] = -x4, [x3, x3] = -1, [x3, x4] = x2, [x3, x5] = x7, [x3, x6] = -x8, [x3, x7] = -x5, [x3, x8] = x6, [x4, x1] = x4, [x4, x2] = x3, [x4, x3] = -x2, [x4, x4] = -1, [x4, x5] = x8, [x4, x6] = x7, [x4, x7] = -x6, [x4, x8] = -x5, [x5, x1] = x5, [x5, x2] = x6, [x5, x3] = x7, [x5, x4] = x8, [x5, x5] = 0, [x6, x1] = x6, [x6, x2] = -x5, [x6, x3] = x8, [x6, x4] = -x7, [x7, x1] = x7, [x7, x2] = -x8, [x7, x3] = -x5, [x7, x4] = x6, [x8, x1] = x8, [x8, x2] = x7, [x8, x3] = -x6, [x8, x4] = -x5]

(1)

``

(2)

DQ := LieAlgebraData(StructureEquations, [x1, x2, x3, x4, x5, x6, x7, x8])

_DG([["LieAlgebra", "L1", [8, table( [ ] )]], [[[1, 2, 2], 1], [[1, 3, 3], 1], [[1, 4, 4], 1], [[1, 5, 1], x5], [[1, 5, 5], x1], [[1, 6, 6], 1], [[1, 7, 7], 1], [[1, 8, 8], 1], [[1, 2, 2], -1], [[2, 3, 4], 1], [[2, 4, 3], -1], [[2, 5, 6], 1], [[2, 6, 5], -1], [[2, 7, 8], 1], [[2, 8, 7], -1], [[1, 3, 3], -1], [[2, 3, 4], 1], [[3, 4, 2], 1], [[3, 5, 7], 1], [[3, 6, 8], -1], [[3, 7, 5], -1], [[3, 8, 6], 1], [[1, 4, 4], -1], [[2, 4, 3], -1], [[3, 4, 2], 1], [[4, 5, 8], 1], [[4, 6, 7], 1], [[4, 7, 6], -1], [[4, 8, 5], -1], [[1, 5, 5], -1], [[2, 5, 6], -1], [[3, 5, 7], -1], [[4, 5, 8], -1], [[1, 6, 6], -1], [[2, 6, 5], 1], [[3, 6, 8], -1], [[4, 6, 7], 1], [[1, 7, 7], -1], [[2, 7, 8], 1], [[3, 7, 5], 1], [[4, 7, 6], -1], [[1, 8, 8], -1], [[2, 8, 7], -1], [[3, 8, 6], 1], [[4, 8, 5], 1]]])

(3)

DGsetup(DQ)

`Lie algebra: L1`

(4)

MultiplicationTable(DQ, "AlgebraTable")

Error, (in DifferentialGeometry:-LieAlgebras:-MultiplicationTable) invalid input: DifferentialGeometry:-ChangeFrame expects its 1st argument, frame_name, to be of type {name, string}, but received _DG([["LieAlgebra", "L1", [8, table( [ ] )]], [[[1, 2, 2], 1], [[1, 3, 3], 1], [[1, 4, 4], 1], [[1, 5, 1], x5], [[1, 5, 5], x1], [[1, 6, 6], 1], [[1, 7, 7], 1], [[1, 8, 8], 1], [[1, 2, 2], -1], [[2, 3, 4], 1], [[2, 4, 3], -1], [[2, 5, 6], 1], [[2, 6, 5], -1], [[2, 7, 8], 1], [[2, 8, 7], -1], [[1, 3, 3], -1], [[2, 3, 4], 1], [[3, 4, 2], 1], [[3, 5, 7], 1], [[3, 6, 8], -1], [[3, 7, 5], -1], [[3, 8, 6], 1], [[1, 4, 4], -1], [[2, 4, 3], -1], [[3, 4, 2]...

 

NULL

 

Download Dual_Quaternion_Defining_Algebra.mw

 

There are the complexes (C), quaternions (H or Q), octionions (O), sedenions (S) and the pathions (P). I have found the multiplication tables of them, although according to signs (+ or -) there differents at pathions. The important question is that How can I multiply two bases, i_n and i_m of higher dimensions, like in the routions or in the voudions?

Should I xor the indexes of the bases? Like this way: i_1 * i_2 = i_(1^2) = i_3

What is about the signs?

Hi....how can i multiply the 9*4 matrix on the left side of this table to the 9*1 vector on the right side of it (last column) with a kind of product of cells that results a 9*4 matrix made up of cells like this one's [(a,b,c,d)⊗(e,f,g,h)=(ae,bf,cg,dh)]

can anyone help me please?

 

SO

ST

WO

WT

Weight

C1

(0.55,0.67,0.78,0.89)

(0.7,0.8,0.8,0.9)

(0.767,0.867,0.93,0.967)

(0.72,0.83,0.83,0.93)

(0.7,0.8,0.8,0.9)

C2

(0.67,0.78,0.89,0.97)

(0.8,0.9,1,1)

(0.73,0.83,0.867,0.93)

(0.66,0.76,0.79,0.90)

(0.8,0.9,1,1)

C3

(0.78,0.89,0.89,1)

(0.8,0.9,1,1)

(7.67,8.67,9.3,9.67)

(0.55,0.66,0.69,0.79)

(0.767,0.867,0.93,0.967)

C4

(0.78,0.89,0.89,1)

(0.06,0.13,0.167.0.267)

(0.8,0.9,1,1)

(0.76,0.86,0.90,0.97)

(0.43,0.53,0.567,0.667)

C5

(0.78,0.89,0.89,1)

(0.8,0.9,1,1)

(0.06,0.13,0.167.0.267)

(0.76,0.86,0.90,0.97)

(0.73,0.83,0.867,0.93)

C6

(0.74,0.85,0.93,1)

(0.67,0.767,0.83,0.9)

(0.73,0.83,0.867,0.93)

(0.62,0.72,0.83,0.90)

(0.8,0.9,1,1)

C7

(0.59,0.70,0.74,0.85)

(0.567,0.667,0.73,0.83)

(0.667,0.767,0.83,0.9)

(0.69,0.79,0.86,0.93)

(0.067,0.1,0.2,0.3)

C8

(0.74,0.85,0.93,1)

(0.7,0.8,0.9,0.93)

(0.567,0.667,0.73,0.83)

(0.79,0.90,0.97,1)

(0.73,0.83,0.867,0.93)

C9

(0.70,0.81,0.85,0.96)

(0.7,0.8,0.9,0.93)

(0.7,0.8,0.8,0.9)

(0.59,69,0.76,0.86)

(0.53,0.63,0.667,0.767)

I want to get the result of multi-matrix multiply like followed below,

but error "final value in for loop must be numeric or character"

(*n is arbitrary and B[1],B[2],...,B[n] have been obtained*)

A:=LinearAlgebra:-IdentityMatrix(n);
#using the multiplication operation of matrix
for i from 1 to n do
   A:=LinearAlgebra:-Multiply(A,B[i]);
od:

return A

help me 

thanks

Perhaps I am being daft, but to me the Physics package seems, quite surprisingly, to have trouble multiplying by a nonzero, non-square matrix. The test code

restart:
with(Physics):
Matrix(2,2,fill = 0) . Vector(2),
Matrix(2,2,fill = 1) . Vector(2),
Matrix(2,3,fill = 0) . Vector(3);
Matrix(2,3,fill = 1) . Vector(3);

produces the following output:

Error, (in Vector[column]) Matrix index out of range

i.e., the last expression cannot be evaluated; while the test code (where no loading of the Physics package is performed)

restart:
#with(Physics):
Matrix(2,2,fill = 0) . Vector(2),
Matrix(2,2,fill = 1) . Vector(2),
Matrix(2,3,fill = 0) . Vector(3),
Matrix(2,3,fill = 1) . Vector(3);

produces the following expected output:

PS: To be sure, I have from http://www.maplesoft.com/products/maple/features/physicsresearch.aspx downloaded the latest version (2014, March 19, 4:0 hours) of the Physics package for Maple 17 (the version I am running).

1 2 Page 1 of 2