summaryrefslogtreecommitdiff
path: root/887/CH3/EX3.1/3_1.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.1/3_1.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.1/3_1.sce')
-rwxr-xr-x887/CH3/EX3.1/3_1.sce28
1 files changed, 28 insertions, 0 deletions
diff --git a/887/CH3/EX3.1/3_1.sce b/887/CH3/EX3.1/3_1.sce
new file mode 100755
index 000000000..7e7e655a5
--- /dev/null
+++ b/887/CH3/EX3.1/3_1.sce
@@ -0,0 +1,28 @@
+clc
+//ex3.1
+C=1*10^-6;
+//t in micro seconds
+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 voltage variations
+V_1=5*t_1;
+V_2=0*t_2+10;
+V_3=-10*t_3+50;
+//charge q=C*V
+q_1=C*V_1;
+q_2=C*V_2;
+q_3=C*V_3;
+q=[q_1,q_2,q_3];
+subplot(121)
+plot(t,q*10^6)
+xtitle('charge vs time','time in Ms','charge in Mc') //M-micro(10^-6)
+//current i=C*dV/dt*10^6, for above equations we get
+i_1=10^6*(0*t_1+C*(5));
+i_2=10^6*0*t_2;
+i_3=10^6*(0*t_3+C*(-10));
+i=[i_1,i_2,i_3];
+subplot(122)
+plot(t,i)
+xtitle('current vs time','time in Ms','current in amperes') //M-micro(10^-6)