Question

In: Electrical Engineering

Need to use math lab for the Isim function for calculating the output and state response....

Need to use math lab for the Isim function for calculating the output and state response.

Of the Transfer Function s + 2 / s^2 + 2 s + 2. I been using the following code and it doesn’t work

sys = tf([1 2],[1 2 2])

t = [0:0.01:];

u=0*t;

[y,T,x] = lsim(sys,u,t)

subplot(121), plot(T,x(:,1))

xlabel('Time(s)'),ylabel('x_1')

subplot(122),plot(T,x(:,2))

xlabel('Time(s)'),ylabel('x_2')

Solutions

Expert Solution

lsim fuction is used for time respose of any input it has different format for different system representation for example

[y,T] = lsim(s,u,t) this format used for transfer functions

[y,T,x] = lsim(s,u,t,x0) this format used for state spae-type system respose

so for state-space response system will be in state form for this use "ss" command to convet from transfer function to state-space model of any given system

the missing part of your code is as follow

1) time 't' expression should be complete

2) input 'u' should be spacified not zero other wise response should be zero for zero initial state x0

3) sys should be in state-space form

all other part of code is correct

the matlab code and result is given as follow

%system transfer function
sys=tf([1,2],[1,2,2]);
%time vector
t=[0:0.01:5];%0 to 5 sec with 0.01 sec step
%input vector

u1=ones(1,length(t));%for unit step input

u2=[1,zeros(1,(length(t)-1))] %for impulse input
%for state responce system system should be in state-space form transfer function to state-space conversion
sys= ss(sys);
[y,T,x] = lsim(sys,u1,t);%for step response
subplot(221), plot(T,x(:,1));%for first state x1 plot
xlabel('Time(s)');ylabel('x_1');
subplot(222);plot(T,x(:,2));%for second state x2 plot
xlabel('Time(s)');ylabel('x_2');
subplot(223), plot(T,y);%for output y plot
xlabel('Time(s)');ylabel('y');

result of unit step input state response of given system

use u2 for impulse response

%system transfer function
sys=tf([1,2],[1,2,2]);
%time vector
t=[0:0.01:5];%0 to 5 sec with 0.01 sec step
%input vector

u1=ones(1,length(t));%for unit step input

u2=[1,zeros(1,(length(t)-1))]; %for impulse input
%for state responce system system should be in state-space form transfer function to state-space conversion
sys= ss(sys);
[y,T,x] = lsim(sys,u2,t);%for impulse response
subplot(221), plot(T,x(:,1));%for first state x1 plot
xlabel('Time(s)');ylabel('x_1');
subplot(222);plot(T,x(:,2));%for second state x2 plot
xlabel('Time(s)');ylabel('x_2');
subplot(223), plot(T,y);%for output y plot
xlabel('Time(s)');ylabel('y');

result of unit impulse state response of given system


Related Solutions

In this lab assignment, students will demonstrate the abilities to: - Use functions in math module...
In this lab assignment, students will demonstrate the abilities to: - Use functions in math module - Generate random floating numbers - Select a random element from a sequence of elements - Select a random sample from a sequence of elements (Python Programming) NO BREAK STATEMENTS AND IF TRUE STATEMENTS PLEASE Help with the (create) of a program to play Blackjack. In this program, the user plays against the dealer. Please do the following. (a) Give the user two cards....
In this lab you will learn how to use methods from the Math class in order...
In this lab you will learn how to use methods from the Math class in order to calculate the area or the volume of several different shapes. If you are confused about the Methods you can access from the Math class and would like to see some examples click here. Hint: Most of these methods can be done in one line. Step 1 - circleArea In this method you will calculate the area of a circle. Before you can calculate...
MATLAB’s conv() function produces an output that is longer than both the original impulse response and...
MATLAB’s conv() function produces an output that is longer than both the original impulse response and input signals. We will look more at this in the discrete-time signals and systems unit, but think about why this might be happening and how to deal with this when plotting your resultant output.
Please do the math by hand, do not use a program, I need to see the...
Please do the math by hand, do not use a program, I need to see the procedure, the answer itself is less important. Comparison of peak expiratory flow rate (PEFR) before and after a walk on a cold winter's day for a random sample of 9 asthmatics. Use the following data to determine if the patients conditioned changed after a walk. Present your results and make some interpretations. Subject Before After 1 312 300 2 242 201 3 340 232...
The question is: State the transfer function, time step response and define the model parameters for...
The question is: State the transfer function, time step response and define the model parameters for a first order and integrating capacity.
Why we need to use elastic limit state?
Why we need to use elastic limit state?
Python Write a for loop with a range function and format output as currency Use an...
Python Write a for loop with a range function and format output as currency Use an input statement to ask the user for # of iterations using the prompt: #? [space after the ?] & assign to a variable Convert the variable to an integer Use a for loop and a range function to display all whole numbers from 1 to the user entered number Display the value of the item variable on screen in each iteration in the following...
Risk analysis question- (a) Explain in words how the math is supposed to work for calculating...
Risk analysis question- (a) Explain in words how the math is supposed to work for calculating the number of scenarios. (b) Show the arithmetic behind calculating the final value. (c) Why is it important to be able to estimate the number of scenarios before beginning your full assessment?
My Teacher gave this answer and we need to response this answer You need to response...
My Teacher gave this answer and we need to response this answer You need to response this answer why you agree with it or why you disagree and explain 1. Watch the posted video interview of Jony Ive, Apple's Chief Design Officer, posted below. Compose a reaction post (not a summary) to the video, its content, and what the interviewee had to say as it relates to user-interface (UI) design, user-experience (UX) design, design process, and other analysis/design work and...
My Teacher gave this answer and we need to response this answer You need to response...
My Teacher gave this answer and we need to response this answer You need to response this answer why you agree with it or why you disagree and explain If you were to perform the analysis and develop a logical model for the college's course registration system, would it be better to use a top-down approach or a bottom-up strategy (or another approach...be sure to describe). What are the reasons for your approach decision? Answer:-  If I need to do the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT