summaryrefslogtreecommitdiff
path: root/260/CH4/EX4.12/4_12.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /260/CH4/EX4.12/4_12.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 '260/CH4/EX4.12/4_12.sce')
-rw-r--r--260/CH4/EX4.12/4_12.sce28
1 files changed, 28 insertions, 0 deletions
diff --git a/260/CH4/EX4.12/4_12.sce b/260/CH4/EX4.12/4_12.sce
new file mode 100644
index 000000000..da24f074f
--- /dev/null
+++ b/260/CH4/EX4.12/4_12.sce
@@ -0,0 +1,28 @@
+//Eg-4.12
+//pg-165
+
+clear
+clc
+
+deff('[z]=f0(x0,x1)','z=x0^3-2.5*x1^2+4*x0-3.7');
+deff('[z]=f1(x0,x1)','z=0.7*x1^2+3*x1-1.8*x0+1');
+
+x0=0;
+x1=0;
+
+eps=10^-10;
+
+deff('[z]=df0(x0)','z=3*x0^2+4');
+deff('[z]=df1(x1)','z=-5*x1');
+deff('[z]=fd0(x0)','z=-1.8');
+deff('[z]=fd1(x1)','z=1.4*x1+3');
+for i=1:5
+Xold=[x0;x1];
+A=[feval(x0,df0) feval(x1,df1);feval(x0,fd0) feval(x1,fd1)];
+b=-[feval(x0,x1,f0);feval(x0,x1,f1)];
+Xnew=Xold+inv(A)*b;
+x0=Xnew(1);
+x1=Xnew(2);
+end
+
+disp(Xnew) \ No newline at end of file