summaryrefslogtreecommitdiff
path: root/3012/CH2/EX2.6/Ex2_6.sce
diff options
context:
space:
mode:
Diffstat (limited to '3012/CH2/EX2.6/Ex2_6.sce')
-rwxr-xr-x3012/CH2/EX2.6/Ex2_6.sce42
1 files changed, 42 insertions, 0 deletions
diff --git a/3012/CH2/EX2.6/Ex2_6.sce b/3012/CH2/EX2.6/Ex2_6.sce
new file mode 100755
index 000000000..bc96d913a
--- /dev/null
+++ b/3012/CH2/EX2.6/Ex2_6.sce
@@ -0,0 +1,42 @@
+// Given:-
+omega = 100.0 //motor rotation speed in rad/s
+tau = 18.0 //torque applied by shaft in N.m
+Welecdot = -2.0 //electric power input in KW
+
+Wshaftdot = (tau*omega)/1000 //shaft work rate in KW
+Wdot = Welecdot + Wshaftdot //net work rate in KW
+
+//function [Qdot]=f(t)
+//Qdot = (-0.2)* [1-2**(-0.05*t)]
+
+
+//function [Edot]=f1(t) //function for rate of change of energy
+//Edot = (-0.2)*[1-2**(-0.05*t)] - Wdot
+
+//function [deltaE] =f2(t) //function for change in energy
+
+t = linspace(0,120,100);
+for i = 1:100
+ Qd(i) = i
+ Wd(i) = i
+ dltaE(i) = i
+ Qd(i) = (-0.2*(1-%e^(-0.05*t(i))))
+ Wd(i) = Wdot
+ dltaE(i) = 4*(1 - %e^(-0.05*t(i)))
+end
+
+subplot(2,2,1)
+plot(t,Qd)
+xlabel("Time (s)")
+ylabel("Qdot (KW)")
+
+subplot(2,2,2)
+plot(t,Wd)
+xlabel("Time (s)")
+ylabel("Wdot (KW)")
+
+subplot(2,2,3)
+plot(t,dltaE)
+xlabel("Time (s)")
+ylabel("deltaE (KJ)")
+