Linear System Theory

Similar documents
Linear System Theory

In the presence of viscous damping, a more generalized form of the Lagrange s equation of motion can be written as

!T = 2# T = 2! " The velocity and acceleration of the object are found by taking the first and second derivative of the position:

Relationship between POTENTIAL ENERGY and FORCE

MEM 255 Introduction to Control Systems: Modeling & analyzing systems

Introduction to System Dynamics

Mechanics of Structures (CE130N) Lab 3

Chapter 5 Gravitation Chapter 6 Work and Energy

Review: control, feedback, etc. Today s topic: state-space models of systems; linearization

POTENTIAL ENERGY AND ENERGY CONSERVATION

ET3-7: Modelling I(V) Introduction and Objectives. Electrical, Mechanical and Thermal Systems

MCE 366 System Dynamics, Spring Problem Set 2. Solutions to Set 2

EE Homework 3 Due Date: 03 / 30 / Spring 2015

Two Cars on a Curving Road

3.4 Application-Spring Mass Systems (Unforced and frictionless systems)

Chapter 6. Second order differential equations

Fundamental principles

Chapter 15 Oscillations

Chapter 5 Oscillatory Motion

Physics 111. Lecture 15 (Walker: 7.1-2) Work & Energy March 2, Wednesday - Midterm 1

Lecture 9: Eigenvalues and Eigenvectors in Classical Mechanics (See Section 3.12 in Boas)

Work and Energy continued

Potential energy functions used in Chapter 7

Dynamical Systems. Mechanical Systems

Lecture 11. Scott Pauls 1 4/20/07. Dartmouth College. Math 23, Spring Scott Pauls. Last class. Today s material. Next class

Quiz #8. Vector. 2) Given A( 1, 4, 3), and B( 3, 4, 1), calculate A B

Mechanics PhD Preliminary Spring 2017

CHAPTER 6 STATE SPACE: FREQUENCY RESPONSE, TIME DOMAIN

Lecture 6. Analytical Physics 123 Prof. Noronha-Hostler Prof. Montalvo. Oct 12 th, 2018

General Physics (PHY 2130)

Chapter 4. Forces and Newton s Laws of Motion. continued

Physics 1C. Lecture 12B

Chapter 5: Energy. Energy is one of the most important concepts in the world of science. Common forms of Energy

Physics 5A Final Review Solutions

BMEN 398: MATLAB Module: Higher Order Differential Equations; SIMULINK Fall 2005 Updated 8/21/2005 Hart

Rotational motion problems

Kinematics and Dynamics

To study applications of Newton s Laws as they. To study conditions that establish equilibrium. To consider contact forces and the effects of

Units are important anyway

Physics 1401V October 28, 2016 Prof. James Kakalios Quiz No. 2

Lab 1: Dynamic Simulation Using Simulink and Matlab

W = F x W = Fx cosθ W = Fx. Work

Phys 1401: General Physics I

Homework #5 Solutions

Physics 111. Tuesday, November 2, Rotational Dynamics Torque Angular Momentum Rotational Kinetic Energy

CHAPTER 12 OSCILLATORY MOTION

Physics 101 Discussion Week 12 Explanation (2011)

CE 206: Engineering Computation Sessional. System of Linear Equations

PLANAR KINETIC EQUATIONS OF MOTION (Section 17.2)

Physics A - PHY 2048C

ECEN 420 LINEAR CONTROL SYSTEMS. Lecture 6 Mathematical Representation of Physical Systems II 1/67

Description of the motion using vectorial quantities

Static Equilibrium, Gravitation, Periodic Motion

The Pendulum Plain and Puzzling

UNIVERSIDADE FEDERAL DO AMAZONAS (UFAM) MATERIAL DE AULA PRÁTICA 01 MODELAGEM E SIMULAÇÃO MATEMÁTICA DE SISTEMAS FÍSICOS

ET3-7: Modelling II(V) Electrical, Mechanical and Thermal Systems

Solving systems of first order equations with ode Systems of first order differential equations.

Chapter 8. Centripetal Force and The Law of Gravity

PHYSICS 220. Lecture 15. Textbook Sections Lecture 15 Purdue University, Physics 220 1

MECH : a Primer for Matlab s ode suite of functions

Rotational Kinetic Energy

DEVIL PHYSICS THE BADDEST CLASS ON CAMPUS IB PHYSICS

Problem 1 Problem 2 Problem 3 Problem 4 Total

Chapter 6 Work & Energy

Today: Work, Kinetic Energy, Potential Energy. No Recitation Quiz this week

Lab Experiment 2: Performance of First order and second order systems

Physics 131- Fundamentals of Physics for Biologists I

Chapter 5 Work and Energy

Professor: Arpita Upadhyaya Physics 131

AP Physics. Harmonic Motion. Multiple Choice. Test E

Deriving 1 DOF Equations of Motion Worked-Out Examples. MCE371: Vibrations. Prof. Richter. Department of Mechanical Engineering. Handout 3 Fall 2017

Dynamics ( 동역학 ) Ch.3 Kinetic of Particles (3.1)

Modeling of a Mechanical System

Phys 102 Lecture 4 Electric potential energy & work

Friction and Motion. Prof. Paul Eugenio 13 Sep Friction (cont.) Motion: kinetics and dynamics Vertical jump Energy conservation

11. Some applications of second order differential

Physics 8 Friday, November 8, 2013

After the spring losses contact with both masses, the speed of m is the speed of 3m.

Find the value of λ. (Total 9 marks)

Course roadmap. ME451: Control Systems. Example of Laplace transform. Lecture 2 Laplace transform. Laplace transform

Kinematics (special case) Dynamics gravity, tension, elastic, normal, friction. Energy: kinetic, potential gravity, spring + work (friction)

3.3. SYSTEMS OF ODES 1. y 0 " 2y" y 0 + 2y = x1. x2 x3. x = y(t) = c 1 e t + c 2 e t + c 3 e 2t. _x = A x + f; x(0) = x 0.

Answers to exam-style questions

(t)dt I. p i. (impulse) F ext. Δ p = p f. Review: Linear Momentum and Momentum Conservation q Linear Momentum. Physics 201, Lecture 15

Stability of Nonlinear Systems An Introduction

Note: Referred equations are from your textbook.

Physics 131- Fundamentals of Physics for Biologists I

Physics 7A Lecture 2 Fall 2014 Final Solutions. December 22, 2014

Forces of Rolling. 1) Ifobjectisrollingwith a com =0 (i.e.no netforces), then v com =ωr = constant (smooth roll)

Chapter 7 Energy of a System

Oscillations. Phys101 Lectures 28, 29. Key points: Simple Harmonic Motion (SHM) SHM Related to Uniform Circular Motion The Simple Pendulum

Chapter 15 Periodic Motion

University of Alberta ENGM 541: Modeling and Simulation of Engineering Systems Laboratory #5

Physics 101 Lecture 7 Kinetic Energy and Work

Topic 1: Newtonian Mechanics Energy & Momentum

Modeling and Experimentation: Mass-Spring-Damper System Dynamics

Dynamics Final Report

Chapter 6: Work, Energy and Power Tuesday February 10 th

Modeling and Experimentation: Compound Pendulum

The Spring Pendulum. Nick Whitman. May 16, 2000

Transcription:

Linear System Theory - MATLAB Exercise Prof. Robert X. Gao Electromechanical Systems Laboratory Department of Mechanical Engineering

Outline Review System Modeling Procedure Example Simple Problem Example Translational Problem Example 3 Rotational Problem Summary / 37

Review MATLAB Operations User Interface Define a Variable Matrix Operations Graphics Help System Modeling Function Command Define a Matrix A A=[ 3; 4 5 6; 7 8 9] Find Dimension of A size(a) Find Transpose of A A' Matrix Addition A+B (where B is a same dimension matrix) Matrix Multiplication A*B (where B is a compatible dimension matrix) Element Multiplication A.*B(where B is the same dimension matrix) Find Inverse of A inv(a) D Line Plot plot(x,y) 0.5 0-0.5-0 3 4 5 6 3 / 37

Use Help Whenever encounters a problem use the built in Help Menu \ Help \ Product Help (F) Type in keyword and search for answer Demos: an easy way to learn 4 / 37

System Modeling Procedure Analyze the problem Free-body Diagrams Equilibrium Equations State Variables Rewrite State Variables in the form of Matrices Realization in MATLAB 5 / 37

Example. Given: M = 0 kg, friction can be ignored. When t = 0, x = 0, v = 0. Input: F a (t) = 0 N Output: Displacement of M when t = 0 seconds. 6 / 37

Analysis Free body Diagram Equilibrium Equation : F a (t) = Mx State Variables: x,v x v v F / M Displacement x is a state variable, so there is no need to write a separate output equation. Classic Method: Since acceleration is a constant, x = ½ * at where a = F/M = m/s x = ½ * *0 = 50 meters 7 / 37

Modeling in State Space Rewrite state-variable equations to include all variables x (0) x() v (0) F v (0) x(0) v(/ M) F Rewrite state-variable in the form of matrices x 0 x 0 F v 0 0 v / M Making the following substitutions x x y, and y v v State variable equation becomes 0 0 y y F 0 0 / M 8 / 37

Define the System Equation % System Equation Definition function dy = sys_0_a(t,y) %-----------Constants-------------------- m = 0; %---- Initialization and State Space Equation ----- dy =zeros(,); f = 0; System Input dy = [0,;0,0]*y + [0; /m]*f; State Space Equations 9 / 37

Launch the ODE Solver % ODE Solver T=0; %----Initial Conditions---------- IC0=[0 0]; %-----------Solver Input-------- timeperiod=[0:t/00:t]; options = odeset('reltol',e-,'abstol',e-); %-----------ODE Solver----------- Set Initial Conditions and Solving Range Set Solver [T,Y] = ode45(@sys_0_a,timeperiod,ic0,options); %----------Plot Output---------- figure; plot(t,y(:,),'linewidth',3); grid on; xlabel('time (seconds)','fontsize',34); ylabel('displacement (meters)','fontsize',34); set(gca,'fontsize',4); axis tight; fprintf('\nfinal Displacement:%f\n',Y(length(Y),)); Invoke ODE Solver Present Result 0 / 37

Result Displacement (meters) 50 40 30 0 0 When t = 0 seconds, Final Displacement:50.000000 0 0 4 6 8 0 Time (seconds) / 37

Example. Given: M = 0 kg, friction can be ignored. When t = 0, x = 0, v = 0. Input: F a (t) = 30t a = 3t. same as Problem in the Preliminary Quiz Output: Displacement of M when t = 5 seconds. / 37

Solution Free body Diagram Equilibrium Equation : F a (t) = Mx State Variables: x,v x v v F / M Rewrite State Variable Equations to Include All Variables x (0) x() v (0) F x x y, and y v (0) x(0) v(/ M) F v v Re formed State Variable Equation 0 0 y y F 0 0 / M Everything here remains the same as the Ex.. 3 / 37

Modeling in State Space Rewrite state-variable equations to include all variables x (0) x() v (0) F v (0) x(0) v(/ M) F Rewrite state-variable in the form of matrices x 0 x 0 F v 0 0 v / M Making the following substitutions x x y, and y v v State variable equation becomes 0 0 y y F 0 0 / M 4 / 37

Define the System Equation % System Equation Definition function dy = sys a(t,y) %-----------Constants-------------------- m = 0; %---- Initialization and State Space Equation ----- dy =zeros(,); f = 30*t; System Input dy = [0,;0,0]*y + [0; /m]*f; State Space Equations 5 / 37

Launch the ODE Solver % ODE Solver T=5; %----Initial Conditions---------- IC0=[0 0]; %-----------Solver Input-------- timeperiod=[0:t/00:t]; options = odeset('reltol',e-,'abstol',e-); %-----------ODE Solver----------- Set Initial Conditions and Solving Range Set Solver [T,Y] = ode45(@sys a,timeperiod,ic0,options); %----------Plot Output---------- figure; plot(t,y(:,),'linewidth',3); grid on; xlabel('time (seconds)','fontsize',34); ylabel('displacement (meters)','fontsize',34); set(gca,'fontsize',4); axis tight; fprintf('\nfinal Displacement:%f\n',Y(length(Y),)); Invoke ODE Solver Present Result 6 / 37

Result Displacement (meters) 60 50 40 30 0 0 When t = 5, Final Displacement:6.500000 0 0 0.5.5.5 3 3.5 4 4.5 5 Time (seconds) 7 / 37

Example Problem 3.0 PART I Find the state variable model Output: Energy stored in each spring PART II Given: M = 0 kg, M =0 kg K = 5 N/m, K = 00 N/m, K 3 = 50 N/m B= 45 N.s/m, g= 9.8 m/s Suppose x = 0, x = m, v = 0, v = 0, Find the energy stored in spring K when t = seconds 8 / 37

Free body Diagrams 9 / 37

Equilibrium Equations Equilibrium Equations Mx K( xx) KxMg0 Mx KxBx K( xx) Mg0 3 Re organize Mx ( K K) xkx Mg0 KxMx Bx ( K K) x Mg0 3 Identify State Variables x, v, x, v 0 / 37

Modeling in State Space - State Variable Equations x v v ( K K ) x K x M g x M v v K x ( K K ) x Bv M g 3 M Re write to Include All Variables Output Equations Ek K( xx) x [0] x [] v [0] x [0] v [0] g K K K v [ ] x [0] v [ ] x [0] v [] g M M x [0] x [0] v [0] x [] v [0] g K K K B v [ ] x [0] v [ ] x [ ] v [ ] g 3 M M M / 37

Modeling in State Space - Collect terms to express as product of matrices 0 0 0 x x K K K 0 0 0 v M v M g x 0 0 0 x 0 v K K K3 B 0 v M M M Output Equation x v Ek K( xx) KN, where N 0 0 x v / 37

Modeling in State Space 3 Make the Following Substitutions x x v v q thus q x x v v The State Variable equations become 0 0 0 K K K 0 0 0 M M q q g 0 0 0 0 K K K3 B 0 M M M Ek KN wheren q, 0 0 3 / 37

Define the System Equation % System Equation Definition function [dy,e] = sys_(t,y) %------Constants-------------------- m = 0; m = 0; k = 5; k = 00; k3 = 50; b = 45; g = 9.8; % kg % N/m % N/(m/s) % m/s^ % - Initialization - dy =zeros(4,); % - State Space Equation dy = [0,, 0, 0; -(k+k)/m, 0, k/m, 0; 0, 0, 0, ; k/m, 0, -(k+k3)/m, -b/m]*y + [0,,0,-]'*g; State Space Equations 4 / 37

Launch the ODE Solver % ODE Solver T=0; % ---Initial Conditions---------- IC0=[0 0 0]; %-----------Solver Input-------- timeperiod=[0:t/000:t]; options = odeset('reltol',e-,'abstol',e-); %-----------ODE Solver----------- Set Initial Conditions and Solving Range Set Solver [T,Y,E] = ode45(@sys_,timeperiod,ic0',options); %----------Plot Output---------- figure; k = 00; E = /*k*(y(:,)-y(:,3)).^; plot(t,e,'linewidth',3) grid on; xlabel('time (seconds)','fontsize',34); ylabel('energy (Joules)','FontSize',34); set(gca,'fontsize',4); axis tight; fprintf('\n Energy in Spring K when T = :%f\n',e(0)); Invoke ODE Solver Present Result 5 / 37

Plot the Results OUTPUT : Energy Stored in Spring K 500 450 400 When T =, Energy Stored in K = 43.3687 J. Energy (Joules) 350 300 50 00 50 00 50 0 4 6 8 0 Time (seconds) 6 / 37

Example 3 Problem 5.5 PART I Find the state variable model Output: Spring Force (Positive when spring is in tension ) PART II Given: M = 0 kg K = 5 N/m L = meter Suppose θ =, θ = 0, ω = 0, ω = 0, Find the spring force when t = 0 ~ 0 seconds 7 / 37

Free body Diagrams Assuming θ and θ to be sufficiently small so that the following approximation is allowed sinθ θ cosθ Therefore, K(sinθ L/-sinθ L/) = ½KL(θ -θ ) Centrifugal Force F = MωR 8 / 37

Equilibrium Equations Moment Moment Equilibrium Equations KL KL ML MgLsin ( )cos 0 KL KL ML MgLsin ( )cos 0 Re organize and Simplify KL KL ML ( MgL ) 0 4 4 KL KL ML ( MgL ) 0 4 4 Identify State Variables,,, sinθ θ cosθ 9 / 37

Modeling in State Space - State Variable Equations Output Equations g K K L 4M 4M K g K 4M L 4M Re write to Include All Variables [0] [] [0] [0] g K K [ ( )] [0] [ ] [0] L 4M 4M [0] [0] [0] [] K g K [ ] [0] [ ( )] [0] 4M L 4M KL Fk ( ) 30 / 37

Modeling in State Space - Collect terms to express as product of matrices 0 0 0 g K K ( ) 0 0 L 4M 4M 0 0 0 K g K 0 ( ) 0 4M L 4M Output Equation KL KL KL Fk ( ) 0 0 3 / 37

Modeling in State Space 3 Make the Following Substitutions q thus q The State Variable equations become 0 0 0 g K K ( ) 0 0 q L 4M 4M q 0 0 0 K g K 0 ( ) 0 4M L 4M F k KL KL 0 0 q 3 / 37

Define the System Equation % System Equation Definition function dy = sys_3(t,y) %------Constants-------------------- m = 0; % Mass 0 kg k = 5; % Spring 5 N/m L = ; % Length meter g = 9.8; % g 9.8 m/s^ % - Initialization - dy =zeros(4,); % - State Space Equation - dy = [0,, 0, 0;... -(g/l+k/4/m), 0, k/4/m, 0;... 0, 0, 0, ;... k/4/m, 0, -(g/l+k/4/m), 0]*y; State Space Equations 33 / 37

Launch the ODE Solver % ODE Solver T=0; % ---Initial Conditions---------- IC0=[ 0 0 0]; %-----------Solver Input-------- timeperiod=[0:t/000:t]; options = odeset('reltol',e-,'abstol',e-); %-----------ODE Solver----------- [T,Y,E] = ode45(@sys_3,timeperiod,ic0',options); %----------Plot Output---------- figure; F = /*5*(Y(:,3)-Y(:,)); plot(t,f,'linewidth',3) grid on; xlabel('time (seconds)','fontsize',34); ylabel('spring Tension Force (Newton)','FontSize',34); set(gca,'fontsize',4); axis tight; Set Initial Conditions and Solving Range Set Solver Invoke ODE Solver Present Result 34 / 37

Plot the Result OUTPUT : Tension Force in Spring K Spring Tension Force (Newton) 0 5 0 5 0-5 -0-5 -0-5 0 4 6 8 0 Time (seconds) 35 / 37

Discussion Manipulation of the output vectors Compare the output of Problem and Problem 3, discuss the difference Importance of finding the right the state variable equations 36 / 37

Summary Reviewed basic MATLAB operations Demonstrated the sequence of modeling a dynamic system Demonstrated finding the numerical solution with MATLAB 37 / 37