You are on page 1of 6

Comparison of analytical and numerical approaches to the solution of t...

1 of 6

http://fsinet.fsid.cvut.cz/en/U2052/node124.html

Next: Systems with n DOF Up: Systems with 2 DOF Previous: Undamped free and forced Contents

Comparison of analytical and numerical approaches to the


solution of the transient response of a two-degrees-of-freedom
linear system
At first, let's determine the unknown constants appearing in expression (5.187) for the time distribution of
displacements for both particles as a function of initial conditions. To facilitate the task it is expedient to
rewrite the equations into an equivalent form, namely

Time derivatives of these equations are

Substituting a particular set of initial conditions, t = 0:

x0

into previous four equations we get the system of algebraic equations

allowing us to express the constants A, B, C, D. A simple Matlab program, where we denoted ki =


kj

and om1 =

, om2 =

(5.192)

, will solve the task.

clear format compact x1 = ... sym('a*sin(om1*t)+b*cos(om1*t)+c*sin(om2*t)+d*cos(om2*t)'); x2 = sym(...


'a*ki*sin(om1*t)+b*ki*cos(om1*t)+c*kj*sin(om2*t)+d*kj*cos(om2*t)'); v1=diff(x1,'t'); v2=diff(x2,'t'); x10=subs(x1,'0','t')
x20=subs(x2,'0','t') v10=subs(v1,'0','t') v20=subs(v2,'0','t') s=sym('[0,1,0,1; 0,k1,0,k2; o1,0,o2,0; k1*o1,0,k2*o2,0]');
rhs=sym('[x10;x20;v10;v20]'); disp('constants derived by Matlab') x=linsolve(s,rhs) x10=1; x20=2; v10=3; v20=4; o1=7; o2=8;
k1=5; k2=6;

14.10.2016 09:51

Comparison of analytical and numerical approaches to the solution of t...

2 of 6

http://fsinet.fsid.cvut.cz/en/U2052/node124.html

a=eval(sym(x,1,1)); b=eval(sym(x,2,1)); c=eval(sym(x,3,1)); d=eval(sym(x,4,1)); disp('numerically evaluated formulas derived by


Matlab') [a b c d]
disp('a check it numerically by "hand" ') snum=[0,1,0,1; 0,k1,0,k2; o1,0,o2,0; k1*o1,0,k2*o2,0]; rhsn=[x10;x20;v10;v20];
xnum=snum; xnum'

The output of the program is


V2Cinicon1 x10 = a*sin(om1*0)+b*cos(om1*0)+c*sin(om2*0)+d*cos(om2*0) x20 =
a*ki*sin(om1*0)+b*ki*cos(om1*0)+c*kj*sin(om2*0)+d*kj*cos(om2*0) v10 = a*cos(om1*0)*om1b*sin(om1*0)*om1+c*cos(om2*0)*om2- d*sin(om2*0)*om2 v20 = a*ki*cos(om1*0)*om1b*ki*sin(om1*0)*om1+c*kj*cos(om2*0)*om2- d*kj*sin(om2*0)*om2 constants derived by Matlab x = [ -(-v20+k2*v10)/o1
/(k1-k2)] [ -(-x20+x10*k2)/(k1-k2)] [ (-v20+v10*k1)/o2/(k1-k2)] [ (k1*x10-x20)/(k1-k2)] numerically evaluated formulas derived
by Matlab ans = 2.0000 4.0000 -1.3750 -3.0000 a check it numerically by "hand" ans = 2.0000 4.0000 -1.3750 -3.0000

The derived constants were pasted into the program V2Ctwodof5c.m and used for the evaluation of eqs.
(5.193) describing the time distributions of both particle displacements. The results are compared with
those obtained by numerical solutions of equations of motion (5.167). The program V2Ctwodof5c.m uses the
Newmark method (see the function VTRnewmd.m) and the method of central differences (see the function
VTRcedif.m).
The comparison of results is presented on the following pages. There are several identifiers
accompanying the figures, namely
gamma

is the Newmark 'damping' parameter,

is the integration step,

om1

is the first frequency

om2

is the second frequency

tmin

is the period of the maximum frequency,


i.e. Tminmode = 2 /

hmts

is the critical time step for central difference


method,
i.e. tmin = 2/

tminmode

is the variable showing How Many Time Steps


are carried out within the period of the
maximum frequency.

14.10.2016 09:51

Comparison of analytical and numerical approaches to the solution of t...

3 of 6

http://fsinet.fsid.cvut.cz/en/U2052/node124.html

Figure 5.35: Transient response of a 2 dof's system - the step of integration is too big
The Fig. 5.35 shows the data obtained with time step h = 0.1 which is clearly unreasonable. The results
are shown here to 'prove' that the Newmark method with gamma = 0.5, as a representative of
unconditionally stable implicit methods, does not fail using too big time steps; it gives the results,
however, in which the contents of high frequency components are evidently filtered-out. But what else
could we expect when marching in time in steps that are twice as big as the period of the fastest
harmonics. See the value of hmts parameter which is of the order of 0.5. It should be emphasized that the
notion of unconditional stability has no relation to the precision of results. The method of central
differences - as a representative of conditionally explicit methods - fails. It simply numerically explodes since the used time step is substantially greater than the critical time step tmin.
Figure 5.36 shows the data obtained with time step h = 0.01. The errors of numerical solutions are
smaller, but there is still visible a phase shift error of opposite signs for both numerical integration
methods as before.

14.10.2016 09:51

Comparison of analytical and numerical approaches to the solution of t...

4 of 6

http://fsinet.fsid.cvut.cz/en/U2052/node124.html

Figure 5.36: Response of a 2 dof's system - a time step showing the amplitude and time shift
errrors
Finally, Fig. 5.37 presents the results calculated with time step h = 0.001. This time, of about 50 time steps
are carried out within the period of the fastest harmonics.

14.10.2016 09:51

Comparison of analytical and numerical approaches to the solution of t...

5 of 6

http://fsinet.fsid.cvut.cz/en/U2052/node124.html

Figure 5.37: Transient response of a 2 dof's system - extremely small step


If we make the time step smaller and smaller, the errors of numerical integration could be made almost
infinitely negligeable. There are two practical limits, however. One is a unit round-off error, the other
consists of economic considerations.
Notice that both methods of integration give reasonably accurate results if the time step is correctly set,
that is, if it is substantially smaller than the period of the maximum frequency. From this point of view
there is no way to proclaim that either of two method is better or worse.
Program V2Ctwodof5c.m is as follows
clear
m1=400; m2=3; k1=60000; k2=50000;
tmax=0.6; h = 0.1; hanal=0.0001; tta=0:hanal:tmax; tt=0:h:tmax; xm=[m1 0; 0 m2]; xk=[k1+k2 -k2; -k2 k2];
l=sqrt(eig(xk,xm)); om1=l(1); om2=l(2);
tmin=2/max(l) tminmode=2*pi/max(l) hmts = tminmode/h
gama=0.5; beta=0.25*(0.5+gama)^2; a1=1/(beta*h*h); a1d=gama/(beta*h);
a0c=1/(h*h); a1c=1/(2*h); a2c=2*a0c; a3c=1/a2c;
ck=0; cm=0; xd=ck*xk+cm*xm; p=[0 0]';
xke=xk + a1*xm + a1d*xd;xme=a0c*xm + a1c*xd;
acc=xm; accc=xm;

14.10.2016 09:51

Comparison of analytical and numerical approaches to the solution of t...

6 of 6

http://fsinet.fsid.cvut.cz/en/U2052/node124.html

x10=0.1; x20=0.2; dis=[x10; x20]; disc=[x10; x20];


v10=0.8; v20=0.2; vel=[v10; v20]; velc=[v10; v20]; dissc = disc - h*velc + a3c*accc;
t=0; kk=0; kmax=round(tmax/h);
dis1=zeros(kmax,1); dis2=zeros(kmax,1); dis1c=zeros(kmax,1); dis2c=zeros(kmax,1);
while t<=tmax, [disn,veln,accn] = ... VTRnewmd(beta,gama,dis,vel,acc,xm,xd,xke,p,h); [disnc,velnc,accnc] = ...
VTRcedif(disc,dissc,velc,accc,xm,xme,xk,xd,p,h); kk=kk+1; t=t+h; dis1(kk) =dis(1); dis2(kk)=dis(2); dis1c(kk)=disc(1);
dis2c(kk)=disc(2); dis=disn; vel=veln; acc=accn; dissc=disc; disc=disnc; velc=velnc; accc=accnc; end;
ki=(-m1*om1^2+k1+k2)/k2; kj=k2/(-m2*om2^2+k2);
a=-(-v20+v10*kj)/om1/(ki-kj); b= -(-x20+x10*kj)/(ki-kj); c= (-v20+ki*v10)/om2/(ki-kj); d= (ki*x10-x20)/(ki-kj);
x1=a*sin(om1*tta)+ b*cos(om1*tta)+ ... c*sin(om2*tta)+ d*cos(om2*tta); x2=a*ki*sin(om1*tta)+b*ki*cos(om1*tta)+ ...
c*kj*sin(om2*tta)+d*kj*cos(om2*tta);
dis1t=dis1'; dis2t=dis2'; dis1tc=dis1c'; dis2tc=dis2c'; figure(1) vv = [0 0.51 -0.25 0.25]; subplot(2,1,1);
plot(tt(1:kmax),dis1t(1:kmax),'g', tta,x1,'k', ... tt(1:kmax),dis1tc(1:kmax),'r','linewidth',2); axis(vv); l1 = 'displacements vs. time analytical (black),'; l2 = ' Newmark (green), central differences (red)'; lab0 = [l1 l2]; title(lab0); ylabel('particle 1')
subplot(2,1,2); plot(tt(1:kmax),dis2t(1:kmax),'g', tta,x2,'k', ... tt(1:kmax),dis2tc(1:kmax),'r','linewidth', 2); axis(vv); lab=['gamma
= ' num2str(gama) ', h = ' num2str(h) ... ', om1 = ' num2str(om1) ', om2 = ' num2str(om2)]; lab1=['tmin = ' num2str(tmin) '
tminmode = ' ... num2str(tminmode) ' hmts = ' num2str(hmts)]; title(lab); xlabel(lab1); ylabel('particle 2')
str_h = num2str(1000*h); file_name = ['V2Ctwodof5c' str_h]; print ('-dmeta', file_name); print('-deps', file_name);

Next: Systems with n DOF Up: Systems with 2 DOF Previous: Undamped free and forced Contents
marcel 2001-08-14

14.10.2016 09:51

You might also like