从R(s)绘制响应r(t)

huangapple go评论57阅读模式
英文:

Plotting response r(t) from R(s)

问题

对于系统函数 H(s)=s^2/(s^2+4) 和输入 E(s)=1/s^2。响应已计算为 R(s)=1/(s^2+4)。如何在时域绘制这个图形?

我尝试使用 lsim,但对我来说没有太多意义。我还尝试使用 step(),但我认为这是在输入是阶跃函数时使用的。

英文:

For system function H(s)=s^2/(s^2+4) and the input E(s)=1/s^2. The response was calculated to be R(s)=1/(s^2+4). How can I plot this in time domain?

I tried using lsim which didn't really make sense to me. I also tried using step() but I thought this is used when the input in a step function

答案1

得分: 1

以下是MATLAB代码的翻译:

使用以下MATLAB代码将为您提供系统的响应:

clear all; close all; clc; clf;

sys = tf([1 0 0],[1 0 4]);

t = 0:0.01:10;
u = t;
lsim(sys,u,t)   % u,t define the input signal

您的输入是E(s)=1/s^2,其拉普拉斯反演等于t。这就是为什么在上面的代码中,我们有u = t

以下是响应的绘图:

从R(s)绘制响应r(t)

灰线是输入,即t。蓝色正弦线是系统的响应。它与您的响应兼容。响应是R(s)=1/(s^2+4),其拉普拉斯反演是0.5*sin(2*t),正如您在上面的图中看到的响应一样。

英文:

Using below MATLAB code will give you the response of system:

clear all; close all; clc; clf;

sys = tf([1 0 0],[1 0 4]);

t = 0:0.01:10;
u = t;
lsim(sys,u,t)   % u,t define the input signal

Your input is E(s)=1/s^2 and its Laplace Inverse is equal to t. That's why in above code, we have u = t.

Below is the plot of response:

从R(s)绘制响应r(t)

gray line is input which is t. The blue sinusoidal line is the response of system. It is compatible with your response. The response is R(s)=1/(s^2+4) and its Laplace Inverse is 0.5*sin(2*t), as you see in above plot as response.

huangapple
  • 本文由 发表于 2023年7月13日 15:18:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/76676829.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定