summaryrefslogtreecommitdiff
path: root/1430/CH13/EX13.13/exa13_13.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /1430/CH13/EX13.13/exa13_13.sce
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '1430/CH13/EX13.13/exa13_13.sce')
-rw-r--r--1430/CH13/EX13.13/exa13_13.sce30
1 files changed, 30 insertions, 0 deletions
diff --git a/1430/CH13/EX13.13/exa13_13.sce b/1430/CH13/EX13.13/exa13_13.sce
new file mode 100644
index 000000000..4f29e103d
--- /dev/null
+++ b/1430/CH13/EX13.13/exa13_13.sce
@@ -0,0 +1,30 @@
+// Example 13.13
+// Calculating a Complex Response
+L=0.5;
+R=5;
+C=1/40;
+s=%s;
+v_s1=20; //t<0
+v_s2=-20; // t>=0
+// from figure 13.14(a), for t<0
+i_L_bef=v_s1/R;
+v_C_bef=20;
+// Laplace transform of the input signal for t>=0
+V_s=-20/s;
+
+// Inspection of figure 13.13(b) yields the systematic node equation
+// (s/40+1/5+1/(0.5*s))*V_C_s=(2-20/s)/(0.5*s)+0.5
+num=20*(s^2+8*s-80);
+den=(s*(s^2+8*s+80));
+V_C_s=num/den; // Voltage across capacitor
+pfe=pfss(V_C_s); // Partial fraction expansion
+t=0:0.001:10
+// inverse Laplace tranform of pfe(1)
+v_C1=-20;
+// inverse Laplace transform of pfe(2)
+v_C2=20*sqrt(5)*exp(-4*t).*cos(8*t-(%pi/180)*(26.6));
+v_C=v_C1+v_C2; // t>0
+plot(t,v_C)
+xlabel('t')
+ylabel('v_C(t)')
+title("Capacitor Voltage Waveform")