summaryrefslogtreecommitdiff
path: root/3432/CH9/EX9.9/Ex9_9.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3432/CH9/EX9.9/Ex9_9.sce
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '3432/CH9/EX9.9/Ex9_9.sce')
-rw-r--r--3432/CH9/EX9.9/Ex9_9.sce49
1 files changed, 49 insertions, 0 deletions
diff --git a/3432/CH9/EX9.9/Ex9_9.sce b/3432/CH9/EX9.9/Ex9_9.sce
new file mode 100644
index 000000000..977c213cc
--- /dev/null
+++ b/3432/CH9/EX9.9/Ex9_9.sce
@@ -0,0 +1,49 @@
+//Example 9.9
+//Describing Function for a saturation nonlinearity.
+
+xdel(winsid())//close all graphics Windows
+clear;
+clc;
+//------------------------------------------------------------------
+//Response of the saturation nonlinearity to sinusoidal input
+figure;
+importXcosDiagram(".\Ex9_9_model.xcos")
+xcos_simulate(scs_m,4);
+scs_m.props.context
+plot(yt.time,yt.values(:,1),'r--')
+plot(yt.time,yt.values(:,2),'b')
+
+xlabel('Time (sec.)');
+ylabel('Amplitude');
+title("Saturation nonlinearity output to sinusoidal input",...
+'fontsize',3);
+exec .\fig_settings.sci; //custom script for setting figure properties
+//------------------------------------------------------------------
+//Describing Functin for saturation nonlinearity.
+k=1;
+N=1;
+i=1;
+Keq=[];
+
+for a=0:0.2:10
+ if k*a/N > 1 then
+ Keq(i,1)=2/%pi*(k*asin(N/a/k)+N/a*sqrt(1-(N/k/a)^2))
+ else
+ Keq(i,1)=k
+ end
+ i=i+1;
+end
+
+a=0:0.2:10;
+a=a';
+figure,
+plot(a,Keq)
+xlabel('$a$');
+ylabel('$K_{eq}}$');
+
+xset('font size',3);
+title("Describing Function for a saturation nonlinearity...
+ with k=N=1",'fontsize',3);
+exec .\fig_settings.sci; //custom script for setting figure properties
+zoom_rect([0 0 10 1.1])
+//------------------------------------------------------------------