Sie sind auf Seite 1von 22

ML

4 r AoOO N f^.

Hu/2

Tf
tv .
A

4f o

/ J

JL
- X,

4
7-

/VA

F
^

('--^ffcM^

J-

" -

/}

'

JL

yO

lei'

MEZZ

\
O

n
(

d
I

a z j^-

c
-

[..r.(..,rr-

1
1

K ^ t ^ - " : ^ * ^.<./^(c^.x../yy
.-.^
_ J

i/.

i/z

aje

1-^

(GO

C, -
*

^
c

*^

^ P/ X '^'^ 2y'i

. /

-ItoA

lor? A

^ rr>^/7 , -7) '


/

-.chR

QA

-f -

. f /^.--t ytftfl

ioo

. . i

131

y.

-x(i]

^ - P 01

'^'

li/ ^

) 2.

Ce/

i^i^^

^^^^^Bfl^^^^

1J

^ C
f-^;^

>

' '

(J'. / "7 ( 5 , ^

1
i

\^

'

^-^1

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%
%%
%%
%%
%%

Solve a d i f f e r e n t i a l e q u a t i o n n u m e r i c a l l y
(Opgave 3.105)
Gemaakt door: B a s t i a a n Bom
Studienummer: 4156765
Datum:
10-05-2012

%%
%%
%%
%%
%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% uses difeqn.m
c l e a r a l l ; close a l l ; c l c ;
%% i n p u t
% initial
xO = 1;
xdO = 0;
t o = 0;

values

tend = 3 ;
tspan = to:0.01:tend;

% [s] end o f s i m u l a t i o n
% [s] t i m e g r i d

%% s i m u l a t i o n
% solve d i f f e r e n t i a l equation
% use difeqn.m
yO = [xO;xdO];
[T, Y] = o d e 4 5 ( ' d i f e q n ' , t s p a n , y O ) ;
%% p l o t
figure
p l o t ( T , Y ( : ,1) ) ;
x l a b e l ( ' t [s] ' ) ;
ylabel{'x');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%
%%
%%
%%
%%

D i f f e r e n t i a l e q u a t i o n , b e l o n g i n g t o run.m
(Opgave 3 . 105)
Gemaakt door: B a s t i a a n Bom
Studienummer: 4156765
Datum:
10-05-2012

%%
%%
%%
%%
%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% t h i s f u n c t i o n belongs t o run.m
f u n c t i o n dy = d i f e g n ( t , y)
g,
m = 10 0;
"o
k = 4e4;
^ 'o
z e t a = .25;
/ ^y"*"^
o.
Y = .05 ;
Q,
omega = 10;
"o
c = 2 * zeta * s q r t ( k * m ) ;

,[kg] mass
[N/m] s p r i n g c o n s t a n t
[-] r e l a t i v e dampening
[m] a m p l i t u d e o f e x c i t a t i o n
[Rad/s] frequency
dampening c o n s t a n t

% d i f f e r e n t i a l equation
d y ( l ) = y(2) ;
dy(2) = k*Y*sin(omega*t)/m + c*omega*Y*cos(omega*t)/m - c*y(2)/m k*y(l)/m;
dy = dy'; % transpose t o make column v e c t o r
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%

%%
{Opgave 3.110)
%% Gemaakt door: B a s t i a a n Bom
%% Studienummer: 4156765
%% Datum:
10-05-2012
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear a l l ; c l c ; close a l l ;
rmax = 3;
z e t a s t e p = 0.2;
% c r e a t e m a t r i c e s f o r r and z e t a
r = repmat(O:O.01:rmax,1/zetastep+l,1);
zeta = r e p m a t ( O : z e t a s t e p : 1 , l e n g t h ( r ) , 1 ) ' ;
% c a l c u l a t e X/Y and p h i
XY = s g r t ( (1 + ( 2 . * z e t a . * r ) . " 2 ) . / { ( 1 - r . ^ 2 ) . ^ 2 + ( 2 . * z e t a . * r ) . ^ 2 ) ) ;
phi = atand( ( 2 . * z e t a . * r . ^ 3 ) . / { 1 + ( 4 . * z e t a . ^ 2 - 1 ) . * r . ^ 2 ) ) ;
% s h i f t a l l n e g a t i v e v a l u e s o f p h i by 180 degrees
p h i = p h i + (phi<0)*18 0;

%% p l o t
figure;
h o l d on;
a x i s ( [ 0 max{r(1,:)) 0 5 ] ) ;
i t = length(zeta(:,1));
cc = h s v ( i t ) ;
for
i=l:it
p l o t ( r ( i , :) , X Y ( i , :) , ' c o l o r ' , G c ( i , :) ) ;
l e g e n d s t r { i } = ['\zeta = ' n u m 2 s t r ( z e t a ( i , 1 ) ) ] ;
end
t i t l e ( ' r a g a i n s t X/Y');
legend(legendstr{:});
xlabel{'r');
ylabel('X/Y');
figure;
h o l d on;
cc = h s v ( i t ) ;
for
i=l:it
plot(r(i,:),phi(i,:),'color',cc(i,:));
l e g e n d s t r { i } = [ '\zeta = ' n u m 2 s t r ( z e t a ( i , 1 ) ) ] ;
end
t i t l e ( ' r against \ p h i ' ) ;
legend(legendstr{:},'Location','Northwest');
xlabel('r');
ylabel('\phi [deg]');

r against <^

I
0.5

1.5
r

r against X/Y

Das könnte Ihnen auch gefallen