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 /122/CH2/EX2.b.14 | |
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 '122/CH2/EX2.b.14')
-rwxr-xr-x | 122/CH2/EX2.b.14/excB_2_14.sce | 31 | ||||
-rwxr-xr-x | 122/CH2/EX2.b.14/figB2_14_a.jpg | bin | 0 -> 24937 bytes | |||
-rwxr-xr-x | 122/CH2/EX2.b.14/figB2_14_b.jpg | bin | 0 -> 19630 bytes |
3 files changed, 31 insertions, 0 deletions
diff --git a/122/CH2/EX2.b.14/excB_2_14.sce b/122/CH2/EX2.b.14/excB_2_14.sce new file mode 100755 index 000000000..1fb9b25d4 --- /dev/null +++ b/122/CH2/EX2.b.14/excB_2_14.sce @@ -0,0 +1,31 @@ +// Exercise B-2-14 + +// An illustration on Linearization +// Linearize the function y = f(x) = 0.2*x^3 at x=2 +// SOLUTION : y = 2.4*x - 3.2 + +// Let us observe graphically the linear approximation +// and the error, and percentage error + +clear; clc; xdel(winsid()); + +x = 0.05:0.05:5; +y = 0.2 * x .^ 3; + +yl = 2.4 * x - 3.2 ; // this is not a linear system! +err = abs(y - yl); //Error in approximation +errpc = err ./ y * 100; //Percentage error + +subplot(2,1,1); +plot2d(x,y,style=2); +plot2d(x,yl,style=3,leg="linearized system"); +xtitle('Original and linearized system','x','y'); + +subplot(2,1,2); +plot2d(x,err,style=5); +xtitle('Error','x','error'); + +scf(); +plot2d(x,errpc,style=5,rect=[1 0 3 100]); +plot2d(x, 10 * ones(1,length(x)) ,style=2,leg="10% error margin" ); +xtitle('Percentage Error','x','% error'); diff --git a/122/CH2/EX2.b.14/figB2_14_a.jpg b/122/CH2/EX2.b.14/figB2_14_a.jpg Binary files differnew file mode 100755 index 000000000..e75c17462 --- /dev/null +++ b/122/CH2/EX2.b.14/figB2_14_a.jpg diff --git a/122/CH2/EX2.b.14/figB2_14_b.jpg b/122/CH2/EX2.b.14/figB2_14_b.jpg Binary files differnew file mode 100755 index 000000000..624e85ccb --- /dev/null +++ b/122/CH2/EX2.b.14/figB2_14_b.jpg |