+ γ3 A = I + A 1 (1 + γ + γ2. = I + A 1 ( t H O M E W O R K # 4 Sebastian A. Nugroho October 5, 2017

Similar documents
Simulation-Solving Dynamic Models ABE 5646 Week 2, Spring 2010

MAE143A Signals & Systems - Homework 2, Winter 2014 due by the end of class Thursday January 23, 2014.

EE363 homework 1 solutions

t + t sin t t cos t sin t. t cos t sin t dt t 2 = exp 2 log t log(t cos t sin t) = Multiplying by this factor and then integrating, we conclude that

Chapter #1 EEE8013 EEE3001. Linear Controller Design and State Space Analysis

EE 301 Lab 2 Convolution

ME 452 Fourier Series and Fourier Transform

Chapter 3 Boundary Value Problem

Chapter 2. First Order Scalar Equations

Announcements: Warm-up Exercise:

Lectures 29 and 30 BIQUADRATICS AND STATE SPACE OP AMP REALIZATIONS. I. Introduction

to have roots with negative real parts, the necessary and sufficient conditions are that:

Matlab and Python programming: how to get started

Math Final Exam Solutions

Ordinary dierential equations

Continuous Time Linear Time Invariant (LTI) Systems. Dr. Ali Hussein Muqaibel. Introduction

Chapter #1 EEE8013 EEE3001. Linear Controller Design and State Space Analysis

Section 3.5 Nonhomogeneous Equations; Method of Undetermined Coefficients

Chapter 7: Solving Trig Equations

Solutions to Assignment 1

Ordinary Differential Equations

MATH 128A, SUMMER 2009, FINAL EXAM SOLUTION

Math 334 Fall 2011 Homework 11 Solutions

Lecture 20: Riccati Equations and Least Squares Feedback Control

Homework-8(1) P8.3-1, 3, 8, 10, 17, 21, 24, 28,29 P8.4-1, 2, 5

Math 4600: Homework 11 Solutions

Lecture 1 Overview. course mechanics. outline & topics. what is a linear dynamical system? why study linear systems? some examples

10. State Space Methods

6.003 Homework #8 Solutions

Chapter 8 The Complete Response of RL and RC Circuits

Chapter 6. Systems of First Order Linear Differential Equations

Some Basic Information about M-S-D Systems

t is a basis for the solution space to this system, then the matrix having these solutions as columns, t x 1 t, x 2 t,... x n t x 2 t...

KEY. Math 334 Midterm III Winter 2008 section 002 Instructor: Scott Glasgow

Challenge Problems. DIS 203 and 210. March 6, (e 2) k. k(k + 2). k=1. f(x) = k(k + 2) = 1 x k

EECE 301 Signals & Systems Prof. Mark Fowler

Unsteady Flow Problems

8. Basic RL and RC Circuits

( ) ( ) if t = t. It must satisfy the identity. So, bulkiness of the unit impulse (hyper)function is equal to 1. The defining characteristic is

Signals and Systems Profs. Byron Yu and Pulkit Grover Fall Midterm 1 Solutions

Solutions - Midterm Exam

Solutions of Sample Problems for Third In-Class Exam Math 246, Spring 2011, Professor David Levermore

EECE 301 Signals & Systems Prof. Mark Fowler

Review - Quiz # 1. 1 g(y) dy = f(x) dx. y x. = u, so that y = xu and dy. dx (Sometimes you may want to use the substitution x y

Ordinary differential equations. Phys 750 Lecture 7

Continuous Time. Time-Domain System Analysis. Impulse Response. Impulse Response. Impulse Response. Impulse Response. ( t) + b 0.

Laplace transfom: t-translation rule , Haynes Miller and Jeremy Orloff

SOLUTIONS TO ECE 3084

1 1 + x 2 dx. tan 1 (2) = ] ] x 3. Solution: Recall that the given integral is improper because. x 3. 1 x 3. dx = lim dx.

Homework 6 AERE331 Spring 2019 Due 4/24(W) Name Sec. 1 / 2

( ) ( ) ( ) () () Signals And Systems Exam#1. 1. Given x(t) and y(t) below: x(t) y(t) (A) Give the expression of x(t) in terms of step functions.

LAPLACE TRANSFORM AND TRANSFER FUNCTION

ODEs II, Lecture 1: Homogeneous Linear Systems - I. Mike Raugh 1. March 8, 2004

Let us start with a two dimensional case. We consider a vector ( x,

THE 2-BODY PROBLEM. FIGURE 1. A pair of ellipses sharing a common focus. (c,b) c+a ROBERT J. VANDERBEI

Convolution. Lecture #6 2CT.3 8. BME 333 Biomedical Signals and Systems - J.Schesser

15. Vector Valued Functions

Lecture 13 RC/RL Circuits, Time Dependent Op Amp Circuits

EE 313 Linear Signals & Systems (Fall 2018) Solution Set for Homework #8 on Continuous-Time Signals & Systems

INDEX. Transient analysis 1 Initial Conditions 1

RC, RL and RLC circuits

Signals and Systems Linear Time-Invariant (LTI) Systems

e 2t u(t) e 2t u(t) =?

Notes on Kalman Filtering

MATH 31B: MIDTERM 2 REVIEW. x 2 e x2 2x dx = 1. ue u du 2. x 2 e x2 e x2] + C 2. dx = x ln(x) 2 2. ln x dx = x ln x x + C. 2, or dx = 2u du.

6.003 Homework #9 Solutions

MATH 5720: Gradient Methods Hung Phan, UMass Lowell October 4, 2018

Math 116 Second Midterm March 21, 2016

ENGI 9420 Engineering Analysis Assignment 2 Solutions

6.003 Homework #9 Solutions

An introduction to the theory of SDDP algorithm

Most Probable Phase Portraits of Stochastic Differential Equations and Its Numerical Simulation

HOMEWORK # 2: MATH 211, SPRING Note: This is the last solution set where I will describe the MATLAB I used to make my pictures.

EE 315 Notes. Gürdal Arslan CLASS 1. (Sections ) What is a signal?

EXERCISES FOR SECTION 1.5

Linear Time-invariant systems, Convolution, and Cross-correlation

SMT 2014 Calculus Test Solutions February 15, 2014 = 3 5 = 15.

d 1 = c 1 b 2 - b 1 c 2 d 2 = c 1 b 3 - b 1 c 3

Modeling Economic Time Series with Stochastic Linear Difference Equations

MA 214 Calculus IV (Spring 2016) Section 2. Homework Assignment 1 Solutions

Predator - Prey Model Trajectories and the nonlinear conservation law

Physics 235 Chapter 2. Chapter 2 Newtonian Mechanics Single Particle

h[n] is the impulse response of the discrete-time system:

Math Week 14 April 16-20: sections first order systems of linear differential equations; 7.4 mass-spring systems.

Differential Equations

!!"#"$%&#'()!"#&'(*%)+,&',-)./0)1-*23)

Lecture 1: Contents of the course. Advanced Digital Control. IT tools CCSDEMO

Two Coupled Oscillators / Normal Modes

dt = C exp (3 ln t 4 ). t 4 W = C exp ( ln(4 t) 3) = C(4 t) 3.

Signal and System (Chapter 3. Continuous-Time Systems)

Four Generations of Higher Order Sliding Mode Controllers. L. Fridman Universidad Nacional Autonoma de Mexico Aussois, June, 10th, 2015

Undetermined coefficients for local fractional differential equations

Week #13 - Integration by Parts & Numerical Integration Section 7.2

System of Linear Differential Equations

Notes 04 largely plagiarized by %khc

Linear Response Theory: The connection between QFT and experiments

Comparison between the Discrete and Continuous Time Models

B Signals and Systems I Solutions to Midterm Test 2. xt ()

Economics 8105 Macroeconomic Theory Recitation 6

EE 224 Signals and Systems I Complex numbers sinusodal signals Complex exponentials e jωt phasor addition

Transcription:

THE UNIVERSITY OF TEXAS AT SAN ANTONIO EE 543 LINEAR SYSTEMS AND CONTROL H O M E W O R K # 4 Sebasian A. Nugroho Ocober 5, 27 The objecive of his homework is o es your undersanding of he conen of Module 4. Due dae of he homework is: Thursday, Ocober 5h @ :59pm.. Consider he following ime-varying sysem: (a) Find he sae ransiion marix. ẋ() + + x(). (b) Now assume ha he sysem sars from an unknown x() Also, assume ha x 2 ( 4). Given his, find x 2 (). x (), where x x 2 () (). (c) Afer obaining x 2 () and given x (), find a general from of x() saring x() as iniial condiions. (d) Wha happens o x () and x 2 () as? Answer: (a) Realize ha where A() + + + A 2 A A β ()A,, hence, A is idempoen. Now, we need o evaluae he following inegral β (τ) dτ + dτ ( + dτ ln + ). + The sae ransiion marix now can be formulaed as where γ ln ( + + β Φ(, ) e (τ)a dτ ln e ) and Φ(, ) e γa (γa ) i i! i I + γa + γ2 A 2! ( + + I + γa + γ2 A 2 2! + γ3 A 3! ) A e γa, +... + γ3 A 3 3! I + A ( + γ + γ2 2! + γ3 3! +... ) I + A (e γ ) I + A ( + + ) ( + ) + + + + + +. +...

(b) We know ha he soluion is given as x() Φ(, )x( ). Now, for 4 and wih x () and x 2 (4), we have x x (4) 4+ () x 2 (4) 4+ x 2 () x (4) 5 4 5 x 2 () x (4) 5 4 5 + x. 2() We finally ge x 2 () 5. (c) The general form of x() is (d) As, we ge lim x x () + x 2 () + 5 x () x 2 () x () x 2 () + + 6 5 lim x + lim x ( + 6 5 2. The STM of ẋ() A()x() is given as follows: ( ) + φ(, ) e 2 2 ln +. ) 5 6. (a) Given any STM, how can you obain A() back? Prove ha A() φ(, ) for any LTV sysem. (b) For he STM given in his problem, obain A(). (c) Find φ (, ) Answer: (a) Proof: Φ(, ) d d Φ(, ) d d e A(τ) dτ ( d I + A(τ) dτ + ( ) 2 A(τ) dτ + ( ) 3 A(τ) dτ +...) d 2! 3! d ( ) d A(τ) dτ + A(τ) dτ A(τ) dτ + ( ) 2 d A(τ) dτ A(τ) dτ +... d d 2! d ( ) A() + A(τ) dτ A() + ( ) 2 A(τ) dτ A() + ( ) 3 A(τ) dτ A() +..., 2! 3! since A() commues wih is inegral, hen ( ) Φ(, ) A() + A() A(τ) dτ + ( ) 2 2! A() A(τ) dτ + ( ) 3 3! A() A(τ) dτ +... ( A() I + A(τ) dτ + ( ) 2 A(τ) dτ + ( ) 3 A(τ) dτ +...) 2! 3! A(τ) dτ A()e A()Φ(, ), 2

seing, and knowing he fac ha Φ(, ) I, we ge Φ(, ) A()Φ(, ) A() (b) Since ( ) + φ(, ) e 2 2 ln +, hen he derivaive of φ(, ) is ( ) + φ(, ) d d Φ(, ) 2e 2 2 ln + ( ) + 2e2 2 2e 2 2 ln + e2 2 + +. 2e 2 2 + e 2 2 + Seing yields which implies φ(, ) 2 +, 2 A() 2 +. 2 (c) φ (, ) can be compued as 3. The following sysem φ (, ) φ(, ) ( ) e 2 2 ln + + ( ) e2 2 e 2 2 + ln +. e 2 2 ẋ() A()x() + e α2 () π u(). The STM for his sysem is given by: φ(, ) e α2 ( ) α 2 (). cos(π) cos(π ) (a) Compue A(). (b) Deermine he inverse of he STM. (c) Find x() if x( ) and u(). Answer: 3

(a) The derivaive of φ(, ) can be compued as Φ(, ) d d φ(, ) 2α() α()e α2 ( ) α 2 () 2α() α()e α2 ( ) α 2 () (cos(π) cos(π )) + e α2 ( ) α 2 () (π sin(π)) 2α() α()e α2 ( ) α 2, () seing, hen we ge 2α() α() A() Φ(, ). π sin(π) 2α() α() (b) φ (, ) φ(, ) e α2 () α 2 ( ) cos(π ) cos(π) e α2 () α 2 ( ) e α2 () α 2 ( ) (cos(π ) cos(π)) e α2 () α 2. ( ) (c) The soluion is given as x() Φ(, )x( ) + Φ(, τ)b(τ)u(τ) dτ, for and x(), hen e x() α2 (τ) α 2 () e α2 (τ) α 2 () (cos(π) cos(πτ)) πe α2 () πe α2 () dτ (cos(π) cos(πτ)) πτe α2 () πτe α2 () cos(π) e α2 () sin(πτ)) πe α2 () πe α2 () cos(π) e α2 () sin(π) πe α2 () e α2 (). (π cos(π) sin(π)) e α2 (τ) α 2 () πe α 2 (τ) () dτ 4. Find he STM associaed wih sin() cos() β A() sin() cos(). sin() Answer: sin() cos() β A() sin() cos() sin() + cos() + β. sin() Now, he followings mus be compued sin(τ) dτ cos() + cos( ) cos(τ) dτ sin() sin( ) 4

β dτ β( ) and he exponenial marices Since A is ideniy, hen e cos()+cos( ) sin(τ)a e dτ e cos()+cos( ) I e cos()+cos(). e cos()+cos() Noice ha A 2 is nilpoen for k 3, hus cos(τ)a e 2 dτ I + A2 (sin() sin( )) + 2! A2 2 (sin() sin()) 2 + (sin() sin( )) + (sin() sin( )) 2 2! sin() sin( ) 2 (sin() sin( )) 2 sin() sin( ). Noice ha A 3 is nilpoen for k 2, hus e Because A, A 2, and A 3 commue, hen A(τ) dτ Φ(, ) e e βa 3 dτ I + A3 β( ) + β( ) β( ). sin(τ)a dτ e cos(τ)a 2 dτ e e cos()+cos() βa 3 dτ sin() sin( ) 2 (sin() sin( )) 2 sin() sin( ) β( ). 5. Consider he following dynamical sysem: A () A ẋ() 2 () x(). A 22 () (a) Derive his srucure for he STM: φ(, ) φ (, ) φ 2 (, ). φ 22 (, ) You should basically show ha φ ii (, ) A ii ()φ ii (, ), and hen show a explici form for φ 2 (, ). Hin: Remember ha φ(, ) A()φ(, ) and φ(, ) I. You should use ha o prove he following resul: φ 2 (, ) φ (, τ)a 2 (τ)φ 22 (τ, )dτ. 5

(b) Assume ha he dynamics for a sysem are given by: 2 ẋ() x() + u(). 2 Answer: Use he resuls you developed in par (a) o deermine x() giving ha he iniial condiions for he sysem are zero, and u(), wihou evaluaing his inegral φ(, τ)b(τ)u(τ)dτ. (a) Since φ(, ) A()φ(, ), hen φ (, ) φ 2 (, ) φ 22 (, ) φ(, ) A()φ(, ) A () A φ(, ) 2 () φ (, ) φ 2 (, ) A 22 () φ 22 (, ) A ()φ (, ) A ()φ 2 (, ) + A 2 ()φ 22 (, ) A 22 ()φ 22 (, ) From he above, i is apparen ha φ ii (, ) A ii ()φ ii (, ). Now, we need o show he explici form of φ 2 (, ). From he above, we also have Pre-muliply wih φ (, ) yields φ 2 (, ) A ()φ 2 (, ) + A 2 ()φ 22 (, ). φ (, ) φ 2 (, ) φ (, )A ()φ 2 (, ) φ (, )A 2 ()φ 22 (, ). Realize ha φ (, ) is equal o φ (, ) d d e ( d d A (τ) dτ I + A (τ) dτ + ( 2! ( d A d (τ) dτ + + ( ) 2 d A 2! (τ) dτ d ( A () A (τ) dτ 3! ( Hence, we have A (τ) dτ ( 3 A (τ) dτ) A ()... I + A (τ) dτ + 2! φ (, )A (). ) 2 A (τ) dτ + 3! ) d d A (τ) dτ +... A (τ) dτ. ( ) 3 A (τ) dτ) +... ) A () ( 2 A 2! (τ) dτ) A () ( ) 2 A (τ) dτ + ( ) 3 A 3! (τ) dτ) +... φ (, ) φ 2 (, ) + φ (, )φ 2 (, ) φ (, )A 2 ()φ 22 (, ) d d (φ (, )φ 2 (, )) φ (, )A 2 ()φ 22 (, ) d (φ (, τ)φ 2 (τ, )) φ (, )φ 2 (, ) I 6 φ (, τ)a 2 (τ)φ 22 (τ, ) dτ φ (, τ)a 2 (τ)φ 22 (τ, ) dτ. A ()

Pre-muliply wih φ (, ) yields φ 2 (, ) φ (, ) + φ (, τ)a 2 (τ)φ 22 (τ, ) dτ. This resul is slighly differen han he one in he problem. I will be equivalen if we have φ (, ). (b) The sae ransiion marix is φ 2 (, ) φ (, τ)a 2 (τ)φ 22 (τ, ) dτ 2τ dτ 2 2. Then for a sysem wih zero iniial condiion, x() 2 τ 2 dτ 2τ 2 2 τ 2τ 3 dτ 2τ 2 τ 2 2 τ4 τ 2 2 4 2 2 + 2 4 2 2. 6. Building on he heoreical resuls from Problem 5, find he STM for A() 2 2 2. 2 You should use he resul you proved in Problem 5: Answer: φ 2 (, ) φ (, τ)a 2 (τ)φ 22 (τ, )dτ. φ 2 (, ) φ (, τ)a 2 (τ)φ 22 (τ, )dτ 2 τ 2τ 2 dτ 2 2τ 2 τ 2 τ 2 2τ τ 2τ 2( ) 2 ( 2 2 ) 2 2 2( ). 2( ) 7. You are given he following sysem: a() b() c() ẋ() λ()i + a() b() c() x() + u(), a() b() c() where M() denoes he derivaive of he marix, i.e., derivaive of he individual enries of he marix. 7

(a) Assume ha a() + b() + c() for all. Find a simple expression for φ(, ). (b) Given ha he conrol inpu is u() 2e λ(), and ha x(2) Answer:, obain x(). (a) Realize ha a() b() c() A() λ()i + a() b() c() a() b() c() A () + A 2 (), where A () and A 2 () commue. To compue is sae ransiion marix, we need o evaluae he following exponenial marices and e λ() λ( ) A e (τ) dτ e λ() dτ I e λ() λ(), e λ() λ() A e 2 (τ) dτ I + A 2 (τ) dτ + ( ) 2 A 2 (τ) dτ + ( ) 3 A 2 (τ) dτ +.... 2! 3! For he laer, firs we need o compue a() A 2 (τ) dτ a( ) b() b( ) c() c( ) a() a( ) b() b( ) c() c( ). a() a( ) b() b( ) c() c( ) Since a() + b() + c(), hen a() A 2 (τ) dτ a( ) b() b( ) a() b() + a( ) + b( ) a() a( ) b() b( ) a() b() + a( ) + b( ). a() a( ) b() b( ) a() b() + a( ) + b( ) We know ha he above marix is nilpoen for k 2, hus A e 2 (τ) dτ I + A 2 (τ) dτ + a() a( ) b() b( ) a() b() + a( ) + b( ) a() a( ) + b() b( ) a() b() + a( ) + b( ). a() a( ) b() b( ) a() b() + a( ) + b( ) The sae ransiion marix can now be formulaed as A Φ(, ) e (τ) dτ e A 2 (τ) dτ e λ() λ() + a() a( ) b() b( ) a() b() + a( ) + b( ) a() a( ) + b() b( ) a() b() + a( ) + b( ). a() a( ) b() b( ) a() b() + a( ) + b( ) 8

(b) The soluion of he above sysem is compued as follows x() Φ(, )x() + Φ(, τ)b(τ)u(τ) dτ + a() a() b() b() a() b() + a() + b() e λ() λ() a() a() + b() b() a() b() + a() + b() x() a() a() b() b() a() b() + a() + b() + a() a(τ) b() b(τ) a() b() + a(τ) + b(τ) + e λ() λ(τ) a() a(τ) + b() b(τ) a() b() + a(τ) + b(τ) a() a(τ) b() b(τ) a() b() + a(τ) + b(τ) (2e λ(τ) ) dτ + a() a() b() b() a() b() + a() + b() e λ() λ() a() a() + b() b() a() b() + a() + b() x() a() a() b() b() a() b() + a() + b() + 2e λ() 2e λ() 2e λ() dτ + a() a() b() b() a() b() + a() + b() e λ() λ() a() a() + b() b() a() b() + a() + b() x() a() a() b() b() a() b() + a() + b() 2τe λ() + 2τe λ() 2τe λ() + a() a() b() b() a() b() + a() + b() e λ() λ() a() a() + b() b() a() b() + a() + b() x() a() a() b() b() a() b() + a() + b() 2e λ() + 2e λ(). 2e λ() Subsiuing 2 and x(2) yields + a(2) a() b(2) b() a(2) b(2) + a() + b() e λ(2) λ() a(2) a() + b(2) b() a(2) b(2) + a() + b() x () 4e λ(2) x 2 () + 4e λ(2) a(2) a() b(2) b() a(2) b(2) + a() + b() x 3 () 4e λ(2) ( + a(2) a())x () + (b(2) b())x 2 () + ( a(2) b(2) + a() + b())x 3 () + 4e λ() e λ(2) λ() (a(2) a())x () + ( + b(2) b())x 2 () + ( a(2) b(2) + a() + b())x 3 () + 4e λ() (a(2) a())x () + (b(2) b())x 2 () + ( a(2) b(2) + a() + b())x 3 () + 4e λ() From he above equaion, one can obain x() where such ha x () x 2 () x 3 () 4eλ() e λ(2) λ(), x() x () x 2 () x 3 () 4e λ() e λ(2) λ() 4e λ() e λ(2) λ() 4e λ() e λ(2) λ(). 9

8. Using MATLAB, generae a random LTI dynamical sysem of saes, 5 conrol inpus, and 3 oupus. Simulae he sysem given ha he inpus are square(), sin(), cos() and he iniial condiions for he sysem are idenically zero. Firs, simulae he sysem using he ode45 solver. Then, apply he wo discreizaion mehods we discussed in class wih variable sampling periods. For example rying sampling periods of T.,., and 5 seconds. Discuss he oucome ha you ge beween he accurae ODE solver and wo discreizaion mehods. Is he discreizaion always accurae? When does i fail (if i does)? Include your code, plos, and a horough analysis of he resuls. Answer: Here, a randomly-generaed sable sysem is used. The inpu is a combinaion of sine, cosine, and square waves. The oupu of he LTI sysem is depiced in Fig.. The firs DTI is obained by applying he forward Euler discreizaion mehod. Here, several sampling periods are sudied. The oupu of his DTI sysem is given in Fig. 2. The second DTI is derived using he exac discreizaion mehod. I s oupu is given in Fig. 3. From hese figures, i is apparen ha for all DTI sysems, he ones wih smalles sampling period, which is Ts. s, have oupus ha are similar o ha of he LTI sysem. As he sampling period increases, he DTI sysems fail o give he same oupus as he LTI sysem. This happens because he approximaion of he LTI sysem in discree-ime is worse. A Ts.5 s, he firs DTI sysem compleely fails, hence i gives unsable oupu rajecory, whereas he second DTI sysem sill gives sable oupu rajecory, even if he oupu is much differen compared o he LTI sysem. This shows he superioriy of he exac discreizaion mehod over he simpler Euler discreizaion mehod. The MATLAB code is given below. 8 6 4 2-2 -4-6 -8 2 4 6 8 2 4 6 8 2 Figure : Oupu rajecory of he LTI sysem. %% Sysem Iniializaion clear all close all %Figure index

2.7373 38 8 5 6 4 5 2.33-2 -5-4 - -6-5 -8 5 5 2-2 5 5 2 -.6766 2 3 4 Figure 2: Oupu rajecory of he DTI sysem discreized by forward Euler mehod. figidx ; %Size sys.n ; sys.m 5; sys.p 3; %Random number inerval l -4; u 4; %Creae random marix sys.a l + (u-l)*rand(sys.n,sys.n); sys.b l + (u-l)*rand(sys.n,sys.m); sys.c l + (u-l)*rand(sys.p,sys.n); %Ge a sable A for i :sys.n sys.a(i,i) -5 + (--(-5))*rand(,); %Save sysem save( sysem_daa.ma, sys ) %Iniial condiion x zeros(sys.n,); %% LTI Sysem

2 2 8 5 5 6 4 2-2 -4 5-5 - 5-5 - -6-5 -5-8 5 5 2-2 5 5 2-2 5 5 2 Figure 3: Oupu rajecory of he DTI sysem discreized by exac discreizaion mehod. %Inerval ff 2; period.; span :period:ff; %ODE, x ode45(@model, span, x,, sys); %Generae y y zeros(lengh(),sys.p); for i:lengh() x x(i,:) ; y(i,:) sys.c*x; figure(figidx); figidx figidx + ; fs 6; se(gcf, numberile, off, name, Norm ) plo(,y(:,), r,,y(:,2), g,,y(:,3), b,... LineWidh,3); ile( LTI Sysem, Inerpreer, laex ) grid on xlabel( $\exrm{time\,(seconds)}$, inerpreer, laex, FonName, Times New Roman, FonSize,f ylabel( $y()$, inerpreer, laex, FonName, Times New Roman, FonSize,fs); se(gca, FonName, Times New Roman, fonsize,fs); h leg( $y_()$, $y_2()$, $y_3()$, Locaion, norheas ); se(h, Inerpreer, laex ) se(h, Fonsize,fs) 2

se(gcf, color, w ); %% DTI Based On Forward Euler Discreizaion Mehod, Ts. s %Time sampling Ts.; %Discreize Ad eye(sys.n)+sys.a*ts; Bd sys.b*ts; Cd sys.c; %Inerval ff 2; period.; span :period:ff; %Conrol inpu u ; for i:lengh(span) u sin(span(:,i)); cos(span(:,i)); square(span(:,i)); cos(span(:,i)); sin(span(:,i)); u u; u ; %sar simulaion x ; y ; xk x; for i:lengh(span) xkk Ad*xk + Bd*u(i,:) ; yk Cd*xk; x x; xkk ; y y; yk ; xk xkk; figure(figidx); %figidx figidx+; fs 6; se(gcf, numberile, off, name, Norm ) subplo(,3,); plo(span,y(:,), r,span,y(:,2), g,span,y(:,3), b,... LineWidh,3); ile({ DTI Sysem wih Euler Discreizaion Mehod, Ts. s }, Inerpreer, laex ) grid on xlabel( $\exrm{time\,(seconds)}$, inerpreer, laex, FonName, Times New Roman, FonSize,f ylabel( $y(k)$, inerpreer, laex, FonName, Times New Roman, FonSize,fs); se(gca, FonName, Times New Roman, fonsize,fs); h leg( $y_(k)$, $y_2(k)$, $y_3(k)$, Locaion, norheas ); se(h, Inerpreer, laex ) se(h, Fonsize,fs) se(gcf, color, w ); %% DTI Based On Forward Euler Discreizaion Mehod, Ts. s %Time sampling 3

Ts.; %Discreize Ad eye(sys.n)+sys.a*ts; Bd sys.b*ts; Cd sys.c; %Inerval ff 2; period.; span :period:ff; %Conrol inpu u ; for i:lengh(span) u sin(span(:,i)); cos(span(:,i)); square(span(:,i)); cos(span(:,i)); sin(span(:,i)); u u; u ; %sar simulaion x ; y ; xk x; for i:lengh(span) xkk Ad*xk + Bd*u(i,:) ; yk Cd*xk; x x; xkk ; y y; yk ; xk xkk; figure(figidx); %figidx figidx + ; fs 6; se(gcf, numberile, off, name, Norm ) subplo(,3,2); plo(span,y(:,), r,span,y(:,2), g,span,y(:,3), b,... LineWidh,3); ile({ Ts. s }, Inerpreer, laex ) grid on xlabel( $\exrm{time\,(seconds)}$, inerpreer, laex, FonName, Times New Roman, FonSize,f ylabel( $y(k)$, inerpreer, laex, FonName, Times New Roman, FonSize,fs); se(gca, FonName, Times New Roman, fonsize,fs); h leg( $y_(k)$, $y_2(k)$, $y_3(k)$, Locaion, norheas ); se(h, Inerpreer, laex ) se(h, Fonsize,fs) se(gcf, color, w ); %% DTI Based On Forward Euler Discreizaion Mehod, Ts.5 s %Time sampling Ts.5; %Discreize Ad eye(sys.n)+sys.a*ts; 4

Bd sys.b*ts; Cd sys.c; %Inerval ff 2; period.; span :period:ff; %Conrol inpu u ; for i:lengh(span) u sin(span(:,i)); cos(span(:,i)); square(span(:,i)); cos(span(:,i)); sin(span(:,i)); u u; u ; %sar simulaion x ; y ; xk x; for i:lengh(span) xkk Ad*xk + Bd*u(i,:) ; yk Cd*xk; x x; xkk ; y y; yk ; xk xkk; figure(figidx); figidx figidx + ; fs 6; se(gcf, numberile, off, name, Norm ) subplo(,3,3); plo(span,y(:,), r,span,y(:,2), g,span,y(:,3), b,... LineWidh,3); ile({ Ts.5 s }, Inerpreer, laex ) grid on xlabel( $\exrm{time\,(seconds)}$, inerpreer, laex, FonName, Times New Roman, FonSize,f ylabel( $y(k)$, inerpreer, laex, FonName, Times New Roman, FonSize,fs); se(gca, FonName, Times New Roman, fonsize,fs); h leg( $y_(k)$, $y_2(k)$, $y_3(k)$, Locaion, norheas ); se(h, Inerpreer, laex ) se(h, Fonsize,fs) se(gcf, color, w ); %% DTI Based On Exac Discreizaion Mehod, Ts. s %Time sampling Ts.; %Discreize Ad expm(sys.a*ts); Bd inv(sys.a)*(ad-eye(sys.n))*sys.b; Cd sys.c; %Inerval ff 2; 5

period.; span :period:ff; %Conrol inpu u ; for i:lengh(span) u sin(span(:,i)); cos(span(:,i)); square(span(:,i)); cos(span(:,i)); sin(span(:,i)); u u; u ; %sar simulaion x ; y ; xk x; for i:lengh(span) xkk Ad*xk + Bd*u(i,:) ; yk Cd*xk; x x; xkk ; y y; yk ; xk xkk; figure(figidx); %figidx figidx + ; fs 6; se(gcf, numberile, off, name, Norm ) subplo(,3,); plo(span,y(:,), r,span,y(:,2), g,span,y(:,3), b,... LineWidh,3); ile({ DTI Sysem wih Exac Discreizaion Mehod, Ts. s }, Inerpreer, laex ) grid on xlabel( $\exrm{time\,(seconds)}$, inerpreer, laex, FonName, Times New Roman, FonSize,f ylabel( $y(k)$, inerpreer, laex, FonName, Times New Roman, FonSize,fs); se(gca, FonName, Times New Roman, fonsize,fs); h leg( $y_(k)$, $y_2(k)$, $y_3(k)$, Locaion, norheas ); se(h, Inerpreer, laex ) se(h, Fonsize,fs) se(gcf, color, w ); %% DTI Based On Exac Discreizaion Mehod, Ts. s %Time sampling Ts.; %Discreize Ad expm(sys.a*ts); Bd inv(sys.a)*(ad-eye(sys.n))*sys.b; Cd sys.c; %Inerval ff 2; period.; span :period:ff; %Conrol inpu u ; 6

for i:lengh(span) u sin(span(:,i)); cos(span(:,i)); square(span(:,i)); cos(span(:,i)); sin(span(:,i)); u u; u ; %sar simulaion x ; y ; xk x; for i:lengh(span) xkk Ad*xk + Bd*u(i,:) ; yk Cd*xk; x x; xkk ; y y; yk ; xk xkk; figure(figidx); %figidx figidx + ; fs 6; se(gcf, numberile, off, name, Norm ) subplo(,3,2); plo(span,y(:,), r,span,y(:,2), g,span,y(:,3), b,... LineWidh,3); ile({ Ts. s }, Inerpreer, laex ) grid on xlabel( $\exrm{time\,(seconds)}$, inerpreer, laex, FonName, Times New Roman, FonSize,f ylabel( $y(k)$, inerpreer, laex, FonName, Times New Roman, FonSize,fs); se(gca, FonName, Times New Roman, fonsize,fs); h leg( $y_(k)$, $y_2(k)$, $y_3(k)$, Locaion, norheas ); se(h, Inerpreer, laex ) se(h, Fonsize,fs) se(gcf, color, w ); %% DTI Based On Exac Discreizaion Mehod, Ts.5 s %Time sampling Ts.5; %Discreize Ad expm(sys.a*ts); Bd inv(sys.a)*(ad-eye(sys.n))*sys.b; Cd sys.c; %Inerval ff 2; period.; span :period:ff; %Conrol inpu u ; for i:lengh(span) u sin(span(:,i)); cos(span(:,i)); square(span(:,i)); cos(span(:,i)); sin(span(:,i)); u u; u ; 7

%sar simulaion x ; y ; xk x; for i:lengh(span) xkk Ad*xk + Bd*u(i,:) ; yk Cd*xk; x x; xkk ; y y; yk ; xk xkk; figure(figidx); figidx figidx + ; fs 6; se(gcf, numberile, off, name, Norm ) subplo(,3,3); plo(span,y(:,), r,span,y(:,2), g,span,y(:,3), b,... LineWidh,3); ile({ Ts.5 s }, Inerpreer, laex ) grid on xlabel( $\exrm{time\,(seconds)}$, inerpreer, laex, FonName, Times New Roman, FonSize,f ylabel( $y(k)$, inerpreer, laex, FonName, Times New Roman, FonSize,fs); se(gca, FonName, Times New Roman, fonsize,fs); h leg( $y_(k)$, $y_2(k)$, $y_3(k)$, Locaion, norheas ); se(h, Inerpreer, laex ) se(h, Fonsize,fs) se(gcf, color, w ); %% LTI Sysem Model %Sysem model funcion xdo model(, x, sys) %% % Conrol inpu u sin(); cos(); square(); cos(); sin(); % Sysem xdo sys.a*x + sys.b*u; 8