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 /50/CH4/EX4.32 | |
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 '50/CH4/EX4.32')
-rwxr-xr-x | 50/CH4/EX4.32/ex_4_32.sce | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/50/CH4/EX4.32/ex_4_32.sce b/50/CH4/EX4.32/ex_4_32.sce new file mode 100755 index 000000000..81c43db58 --- /dev/null +++ b/50/CH4/EX4.32/ex_4_32.sce @@ -0,0 +1,45 @@ +// example 4.32
+// obtain the linear polinomial approximation to the function f(x)=x^1/2
+
+// let P(x)=a0*x+a1
+
+
+// for n=1;
+// hence I(c0,c1)= integral (x^1/2-(c1*x+c0))^2 in the interval [0,1]
+
+
+printf('dI/dc0 = -2*(2/3-c0-c1/2)=0')
+
+printf('dI/dc1 =-2*(2/5-c0/2-c1/3) =0')
+
+// hence
+
+printf('[1 1/2;1/2 1/3]*[c0 ;c1]=[-4/3; -4/5]')
+
+// hence solving for c0 and c1;
+
+
+// the first degree square approximation P(x)=4*(1+3*x)/15;
+
+// for n=2;
+
+// hence I(c0,c1,c2)= integral (x^1/2-(c2*x^2+c1*x+c0))^2 in the interval [0,1]
+
+
+printf('dI/dc0 = (2/3-c0-c1/2-c2/2)=0')
+
+printf('dI/dc1 =(2/5-c0/2-c1/3-c2/4) =0')
+
+printf('dI/dc2 =(2/7-c0/3-c1/4-c2/5) =0')
+
+
+// hence
+
+printf('[1 1/2 1/2;1/2 1/3 1/4;1/3 1/4 1/5]*[c0 ;c1;c2]=[-2/3; -2/5;-2/7]')
+
+// hence solving for c0,c1 and c2;
+
+
+// the first degree square approximation P(x)=(6+48*x-20*x^2)/35;
+
+
|