From 78393cafce80433241bec45bc8edb39602c4dfc7 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 5 Mar 2019 12:22:05 +0530 Subject: updated the code for scilab on cloud[scilab 5.5.2] --- 887/CH4/EX4.2/4_2.sce | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/887/CH4/EX4.2/4_2.sce b/887/CH4/EX4.2/4_2.sce index 957d29c6f..d9c686935 100755 --- a/887/CH4/EX4.2/4_2.sce +++ b/887/CH4/EX4.2/4_2.sce @@ -1,16 +1,16 @@ -clc -//ex4.3 -//Vs is a direct source -//Circuit is in steady state prior to t=0 -//Before t=0, the inductor behaves as a short circuit ==>V(t)=0 for t<0 and i(t)=Vs/Ri for t<0 -//Before the switch opens, current circulates through Vs,R1 and the inductance and When it opens, nothing changes but the return path through R2 -//Then, a voltage appears across R2 and the inductance, causing the current to decay -//There are no sources driving the circuit after the switch opens ==>the steady-state solution is zero for t>0 -//Hence, the solution for i(t) is given by i(t)=K*e^(-t/T) for t>0 in time constant T=L/R2 -//For current to be continuous i(0+)=(Vs/R1)=K*e^0=K ==> K=Vs/R1 -//The voltage is given by V(t)=(L*d(i(t))/dt)=-(L*Vs*e^(-t/T))/(R1*T) for t>0 -disp('Both current and voltage are 0 for t<0') -disp('') -disp('And for t>0:') -disp('The expression for the current is i(t)=(Vs/R1)*e^(-t/T)') -disp('The expression for the volatge is V(t)=-(L*Vs*e^(-t/T))/(R1*T)') +clc +//ex4.2 +//Vs is a direct source +//Circuit is in steady state prior to t=0 +//Before t=0, the inductor behaves as a short circuit ==>V(t)=0 for t<0 and i(t)=Vs/Ri for t<0 +//Before the switch opens, current circulates through Vs,R1 and the inductance and When it opens, nothing changes but the return path through R2 +//Then, a voltage appears across R2 and the inductance, causing the current to decay +//There are no sources driving the circuit after the switch opens ==>the steady-state solution is zero for t>0 +//Hence, the solution for i(t) is given by i(t)=K*e^(-t/T) for t>0 in time constant T=L/R2 +//For current to be continuous i(0+)=(Vs/R1)=K*e^0=K ==> K=Vs/R1 +//The voltage is given by V(t)=(L*d(i(t))/dt)=-(L*Vs*e^(-t/T))/(R1*T) for t>0 +disp('Both current and voltage are 0 for t<0') +disp('') +disp('And for t>0:') +disp('The expression for the current is i(t)=(Vs/R1)*e^(-t/T)') +disp('The expression for the volatge is V(t)=-(L*Vs*e^(-t/T))/(R1*T)') \ No newline at end of file -- cgit