]> gitweb.michael.orlitzky.com - octave.git/blobdiff - run-tests.m
Add the forward_euler1 function and a test for it.
[octave.git] / run-tests.m
index 2892ba0e84f916571960177c62bb297068d7b448..2ff59a3e7081106154661b3b33b3c737e66e71c8 100755 (executable)
@@ -102,3 +102,16 @@ expected_root = [1.33635; 1.75424];
 unit_test_equals("Homework #3 problem #4 root is correct", ...
                 expected_root, ...
                 actual_root);
+
+
+
+f = @(x,y) y;
+x0 = 0;
+y0 = 1;
+h = 1;
+actual_y = forward_euler1(x0, y0, f, h);
+expected_y = 2;
+
+unit_test_equals("Forward Euler works for one step", ...
+                expected_y, ...
+                actual_y);