diff options
Diffstat (limited to '260/CH14/EX14.7/14_7.sce')
-rw-r--r-- | 260/CH14/EX14.7/14_7.sce | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/260/CH14/EX14.7/14_7.sce b/260/CH14/EX14.7/14_7.sce new file mode 100644 index 000000000..49fa8d299 --- /dev/null +++ b/260/CH14/EX14.7/14_7.sce @@ -0,0 +1,23 @@ +//Eg-14.7
+//pg-593
+
+clear
+clc
+close()
+
+x = [0 0.2 0.8 1];
+
+//Using the boundary conditions and the equations at the internal points we have 4 equations and 4 unknowns
+
+A = [-7.0004 8.1966 -2.1964 1.0001;-0.9996 2.1955 -8.1957 6.9999;13.6609 -24.2685 13.7324 -5.1247;-3.6594 10.2665 -27.7312 19.1244];
+
+B = [0;1;0;0];
+
+X = inv(A)*B;
+
+printf('y0 = %f y1 = %f\n y2 = %f y3 = %f\n',X(1),X(2),X(3),X(4))
+
+plot(x,X,'ks')
+legend('Two point OC')
+xlabel('x')
+ylabel('y')
\ No newline at end of file |