Exercise 6: State-space models (Solutions)

Similar documents
Matlab and Simulink. Matlab and Simulink for Control

Control and Simulation. in LabVIEW

MODELING FIRST AND SECOND ORDER SYSTEMS IN SIMULINK

Manufacturing Equipment Modeling

Orbital Mechanics. Angular Momentum

ME 3012 Systems Analysis & Control and Vibrational Responses. Learning Outcomes. Dr. Bob Williams

Dynamic Analysis of the Dortmund University Campus Sky Train

Sensor Performance Metrics

AC : MATHEMATICAL MODELING AND SIMULATION US- ING LABVIEW AND LABVIEW MATHSCRIPT

DAQ in MATLAB HANS-PETTER HALVORSEN,

Dynamic Process Modeling. Process Dynamics and Control

Lecture 07: Work and Kinetic Energy. Physics 2210 Fall Semester 2014

INTER-NOISE AUGUST 2007 ISTANBUL, TURKEY

LabVIEW MathScript HANS-PETTER HALVORSEN,

2.161 Signal Processing: Continuous and Discrete Fall 2008

CHAPTER 6 Frequency Response, Bode Plots, and Resonance

Exercise 10: Basic LabVIEW Programming

Modeling Mechanical Systems

3.1 State Space Models

Lecture 1: Introduction to Dynamical Systems

Numerical Solution of Differential Equations

Engineering Feasibility Study: Vehicle Shock Absorption System

G(s) = Y (s)/u(s) In this representation, the output is always the Transfer function times the input. Y (s) = G(s)U(s).

Appendix H: Control System Computational Aids

Rotation: Moment of Inertia and Torque

CORRECTION OF DYNAMIC WHEEL FORCES MEASURED ON ROAD SIMULATORS

EDUMECH Mechatronic Instructional Systems. Ball on Beam System

EXAMPLE 8: An Electrical System (Mechanical-Electrical Analogy)

Vector Spaces; the Space R n

LINEAR EQUATIONS IN TWO VARIABLES

is in plane V. However, it may be more convenient to introduce a plane coordinate system in V.


San José State University Department of Electrical Engineering EE 112, Linear Systems, Spring 2010

Understanding Poles and Zeros

! n. Problems and Solutions Section 1.5 (1.66 through 1.74)

DCMS DC MOTOR SYSTEM User Manual

Cooling and Euler's Method

System Modeling and Control for Mechanical Engineers

Experiment 9. The Pendulum

Vehicle-Bridge Interaction Dynamics

Computación I: intro to Matlab. Francesca Maria Marchetti

EASTERN ARIZONA COLLEGE Differential Equations

GINI-Coefficient and GOZINTO-Graph (Workshop) (Two economic applications of secondary school mathematics)

Geometric Constraints

Time domain modeling

State Newton's second law of motion for a particle, defining carefully each term used.

Math Practice exam 2 - solutions

POTENTIAL OF STATE-FEEDBACK CONTROL FOR MACHINE TOOLS DRIVES

Hardware-in-the-Loop Simulation

Comparison of the Response of a Simple Structure to Single Axis and Multiple Axis Random Vibration Inputs

Dispersion diagrams of a water-loaded cylindrical shell obtained from the structural and acoustic responses of the sensor array along the shell

Slide Basic system Models

PID Controller Design for Nonlinear Systems Using Discrete-Time Local Model Networks

Note on growth and growth accounting

Enhancing the SNR of the Fiber Optic Rotation Sensor using the LMS Algorithm

Chapter 3 Non-parametric Models for Magneto-Rheological Dampers

Introduction to Bode Plot

Physics 231 Lecture 15

CITY UNIVERSITY LONDON. BEng Degree in Computer Systems Engineering Part II BSc Degree in Computer Systems Engineering Part III PART 2 EXAMINATION

Applications of Second-Order Differential Equations

ANALYTICAL METHODS FOR ENGINEERS

EXPERIMENT 2 Measurement of g: Use of a simple pendulum

Modeling, Analysis, and Control of Dynamic Systems

Boundary between CCM and DCM in DC/DC PWM Converters

Forces between charges

Structural Dynamics, Dynamic Force and Dynamic System

Credit Number Lecture Lab / Shop Clinic / Co-op Hours. MAC 224 Advanced CNC Milling MAC 229 CNC Programming

2.2 Scientific Notation: Writing Large and Small Numbers

Clackamas Community College Online Course/Outline Submission System

Controllability and Observability

System Identification for Acoustic Comms.:

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

MAT 242 Differential Equations Mathematics

MAS.836 HOW TO BIAS AN OP-AMP

SGN-1158 Introduction to Signal Processing Test. Solutions

FOREWORD. Executive Secretary

Using the HT46R46 I/O Ports to Implement Half-Duplex SPI Communication

4 SENSORS. Example. A force of 1 N is exerted on a PZT5A disc of diameter 10 mm and thickness 1 mm. The resulting mechanical stress is:

Weight The weight of an object is defined as the gravitational force acting on the object. Unit: Newton (N)

Controller Design in Frequency Domain

Lecture 5 Rational functions and partial fraction expansion

α = u v. In other words, Orthogonal Projection

FORCE ON A CURRENT IN A MAGNETIC FIELD

Introduction to LabVIEW for Control Design & Simulation Ricardo Dunia (NI), Eric Dean (NI), and Dr. Thomas Edgar (UT)

dspace DSP DS-1104 based State Observer Design for Position Control of DC Servo Motor

Incorporating Gyromass Lumped Parameter Models (GLPMs) in OpenSees

AP1 Oscillations. 1. Which of the following statements about a spring-block oscillator in simple harmonic motion about its equilibrium point is false?

ECE 3510 Final given: Spring 11

Oscillations. Vern Lindberg. June 10, 2010

Degree programme in Automation Engineering

Unit - 6 Vibrations of Two Degree of Freedom Systems

PREDICTION OF MACHINE TOOL SPINDLE S DYNAMICS BASED ON A THERMO-MECHANICAL MODEL

Algebra I Credit Recovery

Application of network analyzer in measuring the performance functions of power supply

ECE 516: System Control Engineering

Review of First- and Second-Order System Response 1

ME 7103: Theoretical Vibrations Course Notebook

LAB 12: ACTIVE FILTERS

volume-profit relationships

JUST THE MATHS UNIT NUMBER 8.5. VECTORS 5 (Vector equations of straight lines) A.J.Hobson

Transcription:

Exercise 6: State-space models (Solutions) A state-space model is a structured form or representation of a set of differential equations. Statespace models are very useful in Control theory and design. The differential equations are converted in matrices and vectors, which is the basic elements in MathScript. Assume we have the following differential equations: This gives on vector form: [ ] [ ] A general linear State-space model may be written on the following general form: MathScript has several functions for creating state-space models: Function Description Example ss Sys_order1 Constructs a model in state-space form. You also can use this function to convert transfer function models to state-space form. Constructs the components of a first-order system model based on a gain, time constant, and delay that you specify. You can use this function to create either a state-space model or a transfer function model, depending on the output parameters you specify. Sys_order2 Constructs the components of a second-order system model >dr = 0.5 >wn = 20 >A = [1 2; 3 4] >B = [0; 1] >C = B' >ssmodel = ss(a, B, C) >K = 1; >T = 1; >H = sys_order1(k, T) Faculty of Technology, Postboks 203, Kjølnes ring 56, N-3901 Porsgrunn, Norway. Tel: +47 35 57 50 00 Fax: +47 35 57 54 01

2 step lsim Example: based on a damping ratio and natural frequency you specify. You can use this function to create either a state-space model or a transfer function model, depending on the output parameters you specify. Creates a step response plot of the system model. You also can use this function to return the step response of the model outputs. If the model is in state-space form, you also can use this function to return the step response of the model states. This function assumes the initial model states are zero. If you do not specify an output, this function creates a plot. Creates the linear simulation plot of a system model. This function calculates the output of a system model when a set of inputs excite the model, using discrete simulation. If you do not specify an output, this function creates a plot. >[A, B, C, D] = sys_order2(wn, dr) >ssmodel = ss(a, B, C, D) >num=[1,1]; >den=[1,-1,3]; >H=tf(num,den); >t=[0:0.01:10]; >step(h,t); >t = [0:0.1:10] >u = sin(0.1*pi*t)' >lsim(sysin, u, t) Given the following state-space model: [ ] [ ] The MathScript code for implementing the model is: % Creates a state-space model A = [1 2; 3 4]; B = [0; 1]; C = [1, 0]; D = [0]; model = ss(a, B, C, D) Task 1: State-space models Task 1.1 Given the following system: Set the system on the following state-space form: Solutions: State-space model:

3 [ ] [ ] [ ] [ ] [ ] Task 1.2 Given the following system: Set the system on the following state-space form: The state-space model becomes: [ ] [ ] [ ] Task 1.3 Given the following system: Set the system on the following state-space form:

4 Solutions: State-space model: [ ] [ ] [ ] [ ] [ ] Task 2: Mass-spring-damper system Given a mass-spring-damper system: Using Newtons 2. law: The model of the system can be described as: ( ) Where position, speed/velocity, acceleration - damping constant, - mass, - spring constant, force Task 2.1 Set the system on the following state-space form:

5 Assuming the control signal is equal to the force and that we only measure the position. We set: Finally: Where the control signal is equal to the force We only measure the position, i.e.: The state-space model for the system then becomes: [ ] [ ] i.e.: [ ] [ ] Task 2.2 [ ] Define the state-space model above using the ss function in MathScript. Apply a step in u and use the step function in MathScript to simulate the result.

6 Start with,,, then explore with other values. MathScript Code: clear clc % Define Parameters in State-space model c = 1; k = 1; m = 1; % Define State-space model A = [0, 1; -(k/m), -(c/m)]; B = [0; 1/m]; C = [1, 0]; D = [0]; ss_model = ss(a,b,c,d) step(ss_model) Task 2.3 Convert the state-space model defined in the previous task to a transfer function MathScript code. using

7 Use,,. Do the same using pen and paper and Laplace. Do you get the same answer? MathScript: In MathScript we can simple use the tf function in order to convert the state-space model to a transfer function. H = tf(ss_model) Pen and paper : We have the equations: We set,, : Laplace gives: Further (setting eq. 1 into eq. 2): or:

8 Which gives: and gives: Alternative metod: The state-space model with,, : [ ] Given the state-space model on the form: We can use the following formula to find the transfer functions: where: [ ] () [ ] Where: [ ] [ ]

9 [ ] This means:, which is the same answer. Task 3: Block Diagram Given the following system: Task 3.1 Find the state-space model from the block diagram. Note! and. We get the following state-space model from the block diagram:

10 [ ] [ ] [ ] [ ] Task 3.2 Implement the state-space model in MathScript and simulate the system using the step function in MathScript. Set And, Task 4: State-space model to Transfer functions Given the following system:

11 Task 4.1 Find the state-space model on the form (pen and paper): First we do: [ ] [ ] [ ] [ ] [ ] Task 4.2 Define the state-space model in MathScript and find the step response for the system. Discuss the results. MathScript code: clear,clc A = [0 1; -1-3]; B = [0 0; 2 4]; C = [5 6]; D = [7 0]; ssmodel = ss(a,b,c,d) step(ssmodel) Step response:

12 As you see we get 2 transfer functions because this is a so-called MISO system (Multiple Input, Single Output). Task 4.3 Find the following transfer functions: In MathScript we can simple do as follows: H = tf(ssmodel) This gives the following): Transfer Function Input:1 Output:1 7,000s^2+33,000s+17,000 -----------------------

13 1,000s^2+3,000s+1,000 Input:2 Output:1 24,000s+20,000 --------------------- 1,000s^2+3,000s+1,000 As you see we get 2 transfer functions because this is a so-called MISO system (Multiple Input, Single Output): Additional Resources http://home.hit.no/~hansha/?lab=mathscript Here you will find tutorials, additional exercises, etc.