Commit fdefcf23 authored by HEMERY Mathieu's avatar HEMERY Mathieu
Browse files

Add a first simple test of numerical integration

parent 7c7bcb73
:- use_module(rosenbrock).
near(X, Y, Epsilon) :-
Epsilon >= abs(X-Y);
Error is abs(X-Y),
write(Error).
check_integration_1([]).
check_integration_1([Head|Tail]) :-
Head = row(T,A,B),
Sum is A+B, near(1.0, Sum, 0.001),
Value is exp(-T), near(B, Value, 0.001),
check_integration_1(Tail).
:- begin_tests(rosenbrock).
test(eva_coeff_1) :-
......@@ -22,6 +34,8 @@ test(eva_coeff_2) :-
test(simple_integration) :-
command(a => b),
command(present(a,1.0)),
command(numerical_simulation(method:rsbk)).
command(numerical_simulation(method:rsbk)),
get_table_data(D),
check_integration_1(D).
:- end_tests(rosenbrock).
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment