summaryrefslogtreecommitdiff
path: root/1964/CH4/EX4.5
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1964/CH4/EX4.5
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 '1964/CH4/EX4.5')
-rwxr-xr-x1964/CH4/EX4.5/ex4_5.sce29
1 files changed, 29 insertions, 0 deletions
diff --git a/1964/CH4/EX4.5/ex4_5.sce b/1964/CH4/EX4.5/ex4_5.sce
new file mode 100755
index 000000000..ae63f801c
--- /dev/null
+++ b/1964/CH4/EX4.5/ex4_5.sce
@@ -0,0 +1,29 @@
+//Chapter-4, Example 4.5, Page 133
+//=============================================================================
+clc
+clear
+funcprot(0)
+//CALCULATIONS
+Im=100;//current in amps
+f=50;//freq in hz
+w=2*%pi*50;//angular freq in rad/sec
+//at t=0.0025
+function f=myfun(t)
+ f=Im*sin(w*t(1));
+endfunction
+t=[0.0025];
+g=numdiff(myfun,t)//by using numdiff function the calculated value will defer to observed value by 15
+//at t= 0.005
+function f1=myfun(t1)
+ f1=Im*sin(w*t1(1));
+endfunction
+t1=[0.005];
+g1=numdiff(myfun,t1);
+//at t= 0.01
+function f2=myfun(t2);
+ f2=Im*sin(w*t2(1));
+endfunction
+t2=[0.01];
+g2=numdiff(myfun,t2);
+mprintf("rate of change of current at t=0.025,t=0.005,t=0.01 sec are %d A/sec %d A/sec %d A/sec respectively",g,g1,g2);
+//=================================END OF PROGRAM==============================