diff options
Diffstat (limited to '964/CH18/EX18.7/18_7.sce')
-rwxr-xr-x | 964/CH18/EX18.7/18_7.sce | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/964/CH18/EX18.7/18_7.sce b/964/CH18/EX18.7/18_7.sce new file mode 100755 index 000000000..f4139fb5d --- /dev/null +++ b/964/CH18/EX18.7/18_7.sce @@ -0,0 +1,13 @@ +//clc()
+z = 10;
+x =[1,3,5,7,13];
+v = [800,2310,3090,3940,4755];
+f1 = (z - x(5)) * v(4) / (x(4) - x(5)) + (z - x(4)) * v(5) / (x(5) - x(4));
+f2 = (z - x(4))*(z - x(5)) *v(3)/((x(3) - x(4))*(x(3) - x(5)))+(z - x(3))*(z - x(5)) *v(4)/((x(4) - x(3))*(x(4) - x(5)))+(z - x(4))*(z - x(3)) *v(5)/((x(5) - x(4))*(x(5) - x(3)));
+f3 = (z - x(3))*(z - x(4))*(z - x(5)) *v(2)/((x(2) - x(4))*(x(2) - x(5))*(x(2) - x(3)))+(z - x(4))*(z - x(2))*(z - x(5)) *v(3)/((x(3) - x(2))*(x(3) - x(5))*(x(3) - x(4)))+(z - x(2))*(z - x(3))*(z - x(5)) *v(4)/((x(4) - x(3))*(x(4) - x(2))*(x(4) - x(5)))+ (z - x(3))*(z - x(4))*(z - x(2)) *v(5)/((x(5) - x(4))*(x(5) - x(2))*(x(5) - x(3)));
+f4 = (z - x(2))*(z - x(3))*(z - x(4))*(z - x(5)) *v(1)/((x(1) - x(2))*(x(1) - x(4))*(x(1) - x(5))*(x(1) - x(3)))+ (z - x(1))*(z - x(3))*(z - x(4))*(z - x(5)) *v(2)/((x(2) - x(1))*(x(2) - x(4))*(x(2) - x(5))*(x(2) - x(3)))+(z - x(1))*(z - x(4))*(z - x(2))*(z - x(5)) *v(3)/((x(3) - x(1))*(x(3) - x(2))*(x(3) - x(5))*(x(3) - x(4)))+(z - x(1))*(z - x(2))*(z - x(3))*(z - x(5)) *v(4)/((x(4) - x(1))*(x(4) - x(3))*(x(4) - x(2))*(x(4) - x(5)))+ (z - x(1))*(z - x(3))*(z - x(4))*(z - x(2)) *v(5)/((x(5) - x(1))*(x(5) - x(4))*(x(5) - x(2))*(x(5) - x(3)));
+disp(f1,"Velocity at 10 sec by first order interpolation = ")
+disp(f2,"Velocity at 10 sec by second order interpolation = ")
+disp(f3,"Velocity at 10 sec by third order interpolation = ")
+disp(f4,"Velocity at 10 sec by fourth order interpolation = ")
+
|