MATLAB: Please tell how MATLAB num=[303 4848 0]; den=[1 16 164]; ea=tf(num,den) subplot(1,2,2) step(ea) express it with Best Answer Try thisnum=[303 4848 0];den=[1 16 164];ea=tf(num,den);subplot(1,2,1)step(ea)[t, y] = ode45(@odeFun, [0 1], [303; 0]);subplot(1,2,2)plot(t, y(:,1), '-')function dydt = odeFun(t, y) % transfer function is equivalent to following ODE % y'' = -16y'-164y+303u''+4848u' u = 1; % step input du = 0; ddu = 0; dydt = zeros(2, 1); dydt(1) = y(2); dydt(2) = -16*y(2)-164*y(1)+303*ddu+4848*du+134*u;end Related SolutionsMATLAB: Please tell me how to use ode45 code Following is one way of using ode45 to solve this[t, y] = ode45(@odeFun, [0 1], [0; 0]);plot(t, y(:,1), 'o-')function dydt = odeFun(t, y) % transfer function is equivalent to following ODE % y'' = -16y'-124y+134u u = 1; % step input dydt = zeros(2, 1); dydt(1) = y(2); dydt(2) = -16*y(2)-124*y(1)+134*u;end MATLAB: I want to add Based on your comment on other question for expression of ea(t): https://www.mathworks.com/matlabcentral/answers/541922-please-tell-me-how-to-use-ode45-code#comment_883106 the following shows how to use ode45 to solve this ODE with input saturation[t, y] = ode45(@odeFun, [0 1], [0; 0]);plot(t, y(:,1), 'o-')function dxdt = odeFun(t, x) % transfer function is equivalent to following ODE % x'' = 4/9(-16x'+ea(t)) ea = (1-x(1))*303; if ea > 100 ea = 100; elseif ea < -100 ea = -100; end dxdt = zeros(2, 1); dxdt(1) = x(2); dxdt(2) = 4/9*(-16*x(2)+ea);end Related QuestionTrying to graph two differential equations on same plotI have a tf(num,den), and I need to obtain values like G(s)=y from it. Is there any function that allows me to do thatI wanna obtain numerical values from a tf(num,den). How to do itHow to draw Fig. 4Error using for loop with transfer function
Best Answer