## 10 Reputation

6 years, 334 days

## Change the value of a variable, that I h...

Maple

Hi! I need a help to understand how the variables in maple 17 works

I want to know if it's possible to change a variable, that I have already declared in a proc, along the body of a procedure. For example this procedure:

local A;
A:=FN(a,b,c,d,Q); #vector of another gobal variable
while A[1] >0 do
Q:=Q+pr ;#"Q"and "pr" are both a list, wich the first value of the vector B decrease his value after an increase estimated in "pr" in "Q"
A[1];
end do;
end proc;

After execute the worksheet, maple display this message:" illegal use of a formal parameter ". I want to know if its possible to use Q as a local variable chaging his value in this loop

Thank you all and sorry for my english!

## Eigenvalues. Mechanical problem...

Maple 17

I solve a mechanical exercise but i had a problem.

I know M (mass) and K (stifness) matrices (4x4).

I want to solve the (λ2M+K)v=0  eigenvalue problem, where λ are the eigenvalues and v eigenvectors.

How can i solve this problem.  I tried with the Eigenvectors() command but it didn't give the right solution.

The Eigenvalues are okay, but the eigenvectors not

K := Matrix([[4*10^7,-1.50*10^7,2*10^7,0],[-1.50*10^7,1.50*10^7,0,1.50*10^7],[2*10^7,0,8*10^7,2*10^7],[0,1.50*10^7,2*10^7,4*10^7]]);

M:=Matrix([[121.90,99.048,-91.429,0],[99.048,594.29,0,-99.048],[-91.429,0,243.81,-91.429],[0,-99.048,-91.429,121.90]]);

w1,w2:=Eigenvectors(K,M);

Acoording with the book the right eigenvectors(shape mode) are:

[0.013 991,  0.034 233,  0.073 683,  0.090 573]
[0.035 637, 0, -0.032 213, 0]
[0 ,-0.034 233, 0, 0.090 573]
[-0.013 991, 0.034 233, -0.073 683, 0.090 573]

Thank you

## Creating a list of Matrices...

Maple 17

I need to create a list of matrices.

with(LinearAlgebra):
interface(rtablesize=50);
E:=[E1,E2,E3]:
P:=[0,1,2]:
N:=3:
B:=[1,2,3]:
for b from 1 to 12 by 5 do
B:=(i,j)->
if i=b+P[a] and j=b+P[a] then E[a]
elif i=b+P[a] and j=b+N+2+P[a] then -E[a]
elif i=b+P[a]+N+2 and j=b+P[a] then -E[a]
elif i=b+P[a]+N+2 and j=b+P[a]+N+2 then E[a]
else 0:
end if: