Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
0 of .
Results for:
P. 1
Function Pendulum; % Nonlinear Dynamics of A

# Function Pendulum; % Nonlinear Dynamics of A

Ratings: (0)|Views: 72|Likes:

Published by: dontknowhow on Feb 11, 2010

### Availability:

Read on Scribd mobile: iPhone, iPad and Android.
See more
See less

11/19/2012

pdf

text

original

functionpendulum;% Nonlinear dynamics of a double pendulum representing a child on a swingticA.M = 30;% kg, child's massA.m = 3;% kg, swinging shin massA.L = 3;% m, swing lengthA.l = 0.3;% m, shin lengthA.g = 9.8;% m s-2, gMETHODs = [1 1 1 1];aaa = [0.1, 1.5];%rad% shin swinging magnitudeiA = 1;% computation counter -resetiF = 1;% figure counter -resetA(iA).WW = sort(unique([0.1:0.05:5,...0.45:0.01:0.55,...0.9:0.01:1.1,...1.9:0.01:2.1]));% reduced (w/w0) swinging frequency rangeA(iA).tt0 = [0:0.1:200];% reduced (t/T) time arrayifiA>1, A(iA) = A;endforia = 1:length(aaa), ia,w0 = sqrt(A(iA).g/A(iA).L);% swing's small oscillation frequencyA(iA).a = aaa(ia);% rad, forcing magnitudeT0 = 2*pi/w0;A(iA).c = 5;% 0.01 * (2*w0*(A(1).M+A(1).m)*A(1).L^2) %damping termifMETHODs(1),YY = [];% swing's state storage array -resetTT = [];% integration time array -reset% LINEAR COMPUTATION ( y'(t) = odefun1(t,y) )A(iA).title ='L_{12} = m l L \theta'' \vartheta''';forw = A(iA).WW*w0;%disp(num2str(w));A(iA).w = w;T = 2*pi/w;[T,Y] = ode45(@odefun1, A(iA).tt0*T, [0; 0.01], [], A(iA));YY = [YY Y(:,1)];TT = [TT T*w];% normalized time arrayend;% results storageA(iA).TT = TT;A(iA).YY = YY;% results plotiF = res_plot(A(iA),iF,iA);tociA = iA+1; A(iA) = A(iA-1);end;
1

ifMETHODs(2),YY = [];TT = [];% NONLINEAR COMPUTATION ( y'(t) = odefun2(t,y) )A(iA).title ='L_{12} = m l L \theta'' \vartheta'' cos(\theta-\vartheta )';forw = A(iA).WW*w0;%disp(num2str(w));A(iA).w = w;T = 2*pi/w;[T,Y] = ode45(@odefun2, A(iA).tt0*T, [0; 0.01], [], A(iA));YY = [YY Y(:,1)];TT = [TT T*w];end;% results storageA(iA).TT = TT;A(iA).YY = YY;% results plotiF = res_plot(A(iA),iF,iA);tociA = iA+1; A(iA) = A(iA-1);end;ifMETHODs(3);YY = [];TT = [];% PARAMETRIC EXCITATION WITHOUT DIRECT KINEMATIC EXCITATION% ( y'(t) = odefun3(t,y) )A(iA).title ='linear pendulum, variable length';forw = A(iA).WW*w0;%disp(num2str(w));A(iA).w = w;T = 2*pi/w;[T,Y] = ode45(@odefun3, A(iA).tt0*T, [0; 0.01], [], A(iA));YY = [YY Y(:,1)];TT = [TT T*w];end;% results storageA(iA).TT = TT;A(iA).YY = YY;% results plotiF = res_plot(A(iA),iF,iA);tociA = iA+1; A(iA) = A(iA-1);end;ifMETHODs(4);YY = [];TT = [];
2

% PARAMETRIC EXCITATION OF NONLINEAR SYSTEM WITHOUT DIRECT KINEMATIC EXCITATIO% ( y'(t) = odefun4(t,y) )A(iA).title ='nonlinear pendulum, variable length';forw = A(iA).WW*w0;%disp(num2str(w));A(iA).w = w;T = 2*pi/w;[T,Y] = ode45(@odefun4, A(iA).tt0*T, [0; 0.01], [], A(iA));YY = [YY Y(:,1)];TT = [TT T*w];end;% results storageA(iA).TT = TT;A(iA).YY = YY;% results plotiF = res_plot(A(iA),iF,iA);tociA = iA+1; A(iA) = A(iA-1);end;save(mfilename);end;functionff = odefun1(t,y,A);% linear double penulum% y = [x; x'], A y' + B y + f = 0M = A.M; m = A.m; L = A.L; l = A.l; g = A.g;c = A.c*(1+exp(-t/(A.tt0(end)*2*pi/A.w)*10));% swinging waveform and derivativesa = A.a; w = A.w;th0 = a*sin(w*t);% \varthetath1 = a*w*cos(w*t);% \dot{\vartheta}th2 = -a*w^2*sin(w*t);% \ddot{\vartheta}AA = (M+m)*L^2*[1, 0; 0 1];BB = [0, -(M+m)*L^2; (M+m)*L*g, c];f = [0; m*l*L*th2];ff = AA\(-BB*y - f);functionff = odefun2(t,y,A);% nonlinear double pendulum% y = [x; x'], A y' + B y + f = 0M = A.M; m = A.m; L = A.L; l = A.l; g = A.g;c = A.c*(1+exp(-t/(A.tt0(end)*2*pi/A.w)*10));% swinging waveform and derivativesa = A.a; w = A.w;th0 = a*sin(w*t);% \varthetath1 = a*w*cos(w*t);% \dot{\vartheta}th2 = -a*w^2*sin(w*t);% \ddot{\vartheta}AA = (M+m)*L^2*[1, 0; 0 1];BB = [0, -(M+m)*L^2; 0, c];f = [0; m*l*L*(th2*cos(y(1)-th0) + th1^2*sin(y(1)-th0))...+ g*((M+m)*L*sin(y(1)))];
3

## Activity (2)

You've already reviewed this. Edit your review.