note description: "A non-stiff set of ODEs (d02cjc example)" legal: "See notice at end of class."; status: "See notice at end of class."; date: "$Date$"; revision: "$Revision$" class EXAMPLE_PLAIN_ODE inherit EIFFELMATH_TESTING_FRAMEWORK STANDARD_ODE undefine print end MATHEMATICIAN undefine print end feature -- Basic operations rhs (x: DOUBLE; y: ARRAY [DOUBLE]): ARRAY [DOUBLE] do create Result.make(1, 3); Result.put (tangent (y @ 3), 1); Result.put ( -0.032 * tangent (y @ 3) / (y @ 2) - 0.02 * (y @ 2) / cosine(y @ 3), 2); Result.put (-0.032 / (y @ 2)^2, 3); end; g (x: DOUBLE; y: ARRAY [DOUBLE]): DOUBLE do Result := y @ 1 end; jacobian (x: DOUBLE; y: ARRAY [DOUBLE]): BASIC_MATRIX -- None available. do end; output (x: DOUBLE; y: ARRAY [DOUBLE]) do print (x); print ('%T'); print (y @ 1); print ('%T'); print (y @ 2); print ('%T'); print (y @ 3); print ('%N'); end; note copyright: "Copyright (c) 1984-2006, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software 356 Storke Road, Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com ]" end -- class EXAMPLE_ODE