From 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 10 Oct 2017 12:27:19 +0530 Subject: initial commit / add all books --- 3432/CH9/EX9.9/Ex9_9.sce | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 3432/CH9/EX9.9/Ex9_9.sce (limited to '3432/CH9/EX9.9/Ex9_9.sce') 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]) +//------------------------------------------------------------------ -- cgit