summaryrefslogtreecommitdiff
path: root/50/CH7/EX7.4/ex_7_4.sce
diff options
context:
space:
mode:
Diffstat (limited to '50/CH7/EX7.4/ex_7_4.sce')
-rwxr-xr-x50/CH7/EX7.4/ex_7_4.sce28
1 files changed, 28 insertions, 0 deletions
diff --git a/50/CH7/EX7.4/ex_7_4.sce b/50/CH7/EX7.4/ex_7_4.sce
new file mode 100755
index 000000000..2536351fd
--- /dev/null
+++ b/50/CH7/EX7.4/ex_7_4.sce
@@ -0,0 +1,28 @@
+// example 7.4
+// solve by shooting method;
+
+// u''=2*u*u';
+// u(0)=0.5; u(1)=1;
+
+// let -> U1(x)=du/dx;
+// U2(x)=d2u/dx2;
+
+// U(x)=[U1(x);U2(x)]
+
+// hence ;
+// dU/dx=f(x,U);
+
+h=.25;
+
+ub=[.5,1];
+
+up=[0:.1:1];
+
+x=0:h:1;
+
+deff('[w]=f(x,U)','w=[U(2); 2*U(1)*U(2)]')
+
+
+[U] = shooting(ub,up,x,f);
+
+// the solution obtained would show the values of u in the first collumn and their corresponding derivatives in the second collumn ; \ No newline at end of file