summaryrefslogtreecommitdiff
path: root/887/CH3/EX3.6/3_6.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /887/CH3/EX3.6/3_6.sce
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '887/CH3/EX3.6/3_6.sce')
-rwxr-xr-x887/CH3/EX3.6/3_6.sce35
1 files changed, 35 insertions, 0 deletions
diff --git a/887/CH3/EX3.6/3_6.sce b/887/CH3/EX3.6/3_6.sce
new file mode 100755
index 000000000..523556f5c
--- /dev/null
+++ b/887/CH3/EX3.6/3_6.sce
@@ -0,0 +1,35 @@
+clc
+//ex3.6
+L=5; //inductance
+t_1=[0:0.001:2];
+t_2=[2.001:0.001:4];
+t_3=[4.001:0.001:5];
+t=[t_1,t_2,t_3];
+//corresponding current variations
+i_1=(1.5)*t_1;
+i_2=0*t_2+3;
+i_3=(-3*t_3)+15;
+//voltage V=L*(di/dt)
+V_1=L*(0*t_1+(1.5));
+V_2=L*(0*t_2);
+V_3=L*(0*t_3-3);
+V=[V_1,V_2,V_3];
+//stored energy W=1/2*L*i^2
+W_1=(1/2)*L*i_1^2;
+W_2=(1/2)*L*i_2^2;
+W_3=(1/2)*L*i_3^2;
+W=[W_1,W_2,W_3];
+//power P=V*i
+P_1=L*t_1*(1.5^2);
+P_2=0*t_2;
+P_3=-3*L*(-3*t_3+15);
+P=[P_1,P_2,P_3];
+subplot(221)
+plot(t,V)
+xtitle('voltage vs time','time in seconds','voltage in volts')
+subplot(222)
+plot(t,W)
+xtitle('energy vs time','time in seconds','energy in joules')
+subplot(223)
+plot(t,P)
+xtitle('power vs time','time in seconds','power in watts')