12.07.2015 Views

Cart-Pendulum System 피드백 제어기 설계 - 한국항공대학교

Cart-Pendulum System 피드백 제어기 설계 - 한국항공대학교

Cart-Pendulum System 피드백 제어기 설계 - 한국항공대학교

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

(참고) MatLab Code 例 (function m-file)% === Example of RK4 Integration algorithm% It requires m-files with subfunctions rk4.m & dyn_eqn.m%========================================% 화일명: rk4_main.m or 임의명.mfunction rk4_main()%각 subfunction을 독립적인 m-file로 저장하면 main 함수 이름 생략 가능%------- 2nd order ODE ----------------------% y_ddot + a*y_dot + b*y = u(t) with (I.C.) y(0), y_dot(0)clear;%---------- <strong>System</strong> Parameters --------------%global a b h;a = 3.; % c/mb = 100.; % k/mh = 0.01; % Integration time interval% (I.C.)x(1,:) = [3.0 0.0]; %x1(1) = 3.0; x2(1) = 0.0;tf = 3.0; % Final timet = [ 0: h: tf]';% Subfunction 1% rk4.mfunction x = rk4( x, u, a, b, h )% Slopes k1, k2, k3, k4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!