diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /215/CH2/EX2.1/ex2_1.sce | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '215/CH2/EX2.1/ex2_1.sce')
-rwxr-xr-x | 215/CH2/EX2.1/ex2_1.sce | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/215/CH2/EX2.1/ex2_1.sce b/215/CH2/EX2.1/ex2_1.sce new file mode 100755 index 000000000..b6e0cfdab --- /dev/null +++ b/215/CH2/EX2.1/ex2_1.sce @@ -0,0 +1,35 @@ +//Example 2.1
+//Computation of power absorbed by each part
+//From figure 2.13a
+V=2;I=3;
+//We have Power(P)=V*I
+P=V*I
+printf("a) Power =%dW\n",P)
+if P>0 then
+ printf("Power is absorbed by the element\n")
+else
+ printf("Power is supplied by the element\n");
+end
+
+clear P;
+//From figure 2.13b
+V=-2;I=-3;
+//We have Power(P)=V*I
+P=V*I
+printf("b) Power =%dW\n",P)
+if P>0 then
+ printf("Power is absorbed by the element\n")
+else
+ printf("Power is supplied by the element\n")
+end
+
+//From figure 2.13c
+V=4;I=-5;
+//We have Power(P)=V*I
+P=V*I
+printf("c) Power =%dW\n",P)
+if P>0 then
+ printf("Power is absorbed by the element\n")
+else
+ printf("Power is supplied by the element\n")
+end
|