sungyg's blog

matrix computation

Dear Sir:

I am still a novice to use the maple. Please give some advice for the
following code. Expecially, I try to construct the final P(3x3) matrix.
In the for-loop, normalized vectors are generated. Then, those are
converted into a matrix. But, I do not know how to write a code.

restart:
with(LinearAlgebra):
interface(displayprecision=4):
mass:=Matrix([[m[1],0,0],[0,m[2],0],[0,0,m[3]]]);
stif:=Matrix([[k[1]+k[2],-k[1],0],[-k[1],k[1]+k[2],-k[2]],[0,-k[2],k[2]]]);
m[1],m[2],m[3],k[1],k[2],k[3]:=4,4,4,4,4,4;
msri:=simplify(MatrixFunction(mass,sqrt(x),x)^(-1));
mass2:=msri.mass.msri; stif2:=msri.stif.msri;

long equation

Dear Sir:

In worksheet mode, I got an evaluation result which has
a very long equation. The maple display it just on one line
so that the result is displayed over window bound.
I want to set it up to display the result on multiline.
So, it is easy to look at my result without moving my mouse.
Could you tell me how to set it up?

Thanks in advance.

Dear Sir:

I am using Maple 11. I try to change the font and size of
both input and output display in TEXT mode as a default mode.
But, I can not find an option to change them under
TOOLS menu.

Could you tell me how to do?

Thanks.

matrix computation

Dear Sir:

I try to learn to use the linear algebra in maple.
I try to compute the following matrices.

restart;
assume(a>0,b>0,c>0);
with(LinearAlgebra):
M:=Matrix([[a, 0],[0, b]]);
K:=Matrix([[c,-c],[-c,c]]);
V:=Eigenvectors(K,M);
X:=V[2];
Multiply(Multiply(X^%T,M),X);

I expect that the final result should be the indentity
matrix. However, it does not produce what I expect.
Please give me some advice to get the identity matrix.

Thank you.

simultaneous equation

Dear Sir:

I try to solve a set of simultaneous equations.
But, it is not easy to get a solution by using
MAPLE package.

restart;
eq1:=P-2*P*cos(w*t[2])+(P+1)*cos(w*t[3])=0;
eq2:=-2*P*sin(w*t[2])+(P+1)*sin(w*t[3])=0;
_EnvAllSolutions:=true: _EnvExplicit:=true:
solve({eq1,eq2},{t[2],t[3]});

But, MAPLE does not give me what I want.
I expect that the solution should be in
the following way:

t[2]=(1/w)*arccos((4*P^2-2*P-1)/(4*P^2));
t[3]=(1/w)*arccos((2*P^2-2*P-1)/(2*P^2+2*P));

where w and P are positive constants.
Could you help me to get the solution?

Thanks

invlaplace solution

Dear Sir:

Following is the inverse laplace of the given
equation.

restart;
with(inttrans):
X:=-k*(m[1]+m[2])/(s*(k*(m[1]+m[2])+m[1]*s^2*m[2]));
invlaplace(X,s,t);

The result is something like "1-cosh(a t)".
I expect that the result is similar to "1-cos(a t)".
How could I get what I want to get?

Thanks in advance

factor

Hello Sir;

I try to factor out the following equation:

eq1:=t[1]/2+t[2]/2+(1/2)*(1/alpha)*sqrt(2*alpha^2*t[1]^2+2*alpha^2*t[2]^2+alpha*x);

I want to get it like this form:

eq2:=(1/2)*(t[1]+t[2])+sqrt((1/2)*(t[1]^2+t[2]^2)+x/(4*alpha));

Is it possible to express eq1 to eq2? I do not know
how to factor each term individually.

Thanks

problem solving

Hello!

I upload my file which has a problem. I am not an expert
on MAPLE v10.05. The file name is "mapleprime-2".

I try to get a solution of four equations with the
symmetric assumption for time variables. Anyone could
change the assumption to get a result. Or, anyone could
add just two more time variables: t[6] with minus sign
amplitude and t[7] with plus sign amplitude.
So, the entire number of time variables are still
odd number which can not be changed. The current code is
following as:

restart:
eq1:=expand(sum((-1)^(i+1)*cos(w*t[i]),i=1..5)=0):
eq2:=expand(sum((-1)^(i+1)*sin(w*t[i]),i=1..5)=0):

solve a problem

hello?

I wrote the following equations to be solved.

restart;
eq1:=expand(sum((-1)^(i+1)*cos(omega*t[i]),i=1..5)=0):
eq2:=expand(sum((-1)^(i+1)*sin(omega*t[i]),i=1..5)=0):
eq3:=expand(sum((-1)^(i+1)*cos(r*omega*t[i]),i=1..5)=0):
eq4:=expand(sum((-1)^(i+1)*sin(r*omega*t[i]),i=1..5)=0):
t[1]=0;t[4]:=2*t[3]-t[2];t[5]:=2*t[3];
_EnvAllSolutions:=true:
_EnvExplicit:=true:
s1:=solve({eq1,eq2,eq3,eq4},{t[2],t[3],r});

Do I have to specify t[3]>t[2], t[2]>0 in the code?

where t[1] to t[5] are time variables starting from t[1]=0
and omega and r are constants.
How can I get the solutions for t[2] and t[3]?

solve

Is there any way to get an exact solution
rather than integration format.
I do not know "applyop" command.
Please help me for more understanding to
use MAPLE.

Thanks

restart;
u(t):=1+sum((-1)^(i)*Heaviside(t-T[i+1]),i=1..n-1)+sum((-1)^(i)*Heaviside(t-T[n+i]),i=1..n):
eq:=diff(x(t),t,t)=u(t)/M:
ic:=x(0)=0,D(x)(0)=0:
dsolve({eq,ic}) assuming T[n+i]>T[i+1];

yoon

Syndicate content
}