summaryrefslogtreecommitdiff
path: root/1430/CH11/EX11.3/exa11_3.sce
diff options
context:
space:
mode:
Diffstat (limited to '1430/CH11/EX11.3/exa11_3.sce')
-rw-r--r--1430/CH11/EX11.3/exa11_3.sce19
1 files changed, 19 insertions, 0 deletions
diff --git a/1430/CH11/EX11.3/exa11_3.sce b/1430/CH11/EX11.3/exa11_3.sce
new file mode 100644
index 000000000..3f7a756bc
--- /dev/null
+++ b/1430/CH11/EX11.3/exa11_3.sce
@@ -0,0 +1,19 @@
+// Example 11.3
+// Frequency-Response Calcuations
+s=%s;
+num=20*(s+25)
+den=s^2+20*s+500;
+omega=[0:1:1000]; // diffrent value of frequency for frequency respose plot
+H_s=num/den; // Given transfer function
+H_omega=horner(H_s,%i*omega);
+a_omega=abs(H_omega);
+theta=atan(imag(H_omega),real(H_omega))*(180/%pi);
+subplot(2,1,1)
+plot(omega,a_omega,'-g')
+xlabel('omega')
+ylabel('a_omega')
+title('Frequency-response curve')
+subplot(2,1,2)
+plot(omega,theta,'-r')
+xlabel('omega')
+ylabel('theta')