rosenbrock.plt 1.08 KB
Newer Older
Mathieu Hemery's avatar
Mathieu Hemery committed
1
2
3
4
:- use_module(rosenbrock).

:- begin_tests(rosenbrock).

5
test(eva_coeff_1) :-
6
  nb_setval(hdid,0.01),
7
8
9
10
11
12
13
14
15
  rosenbrock:eval_coeff(1*[0],[1.5,2.5,3.5],[-1,2], 1, R1), R1 =:= 1.5,
  rosenbrock:eval_coeff(2*[0] + p(1),[1.5,2.5,3.5],[-1,2], 1, R2), R2 =:= 5.0,
  rosenbrock:eval_coeff(t,[1.5,2.5,3.5],[-1,2], 1.23, R3), R3 =:= 1.23,
  rosenbrock:eval_coeff(2*[0] - p(0),[1.5,2.5,3.5],[-1,2], 1, R4), R4 =:=4.0,
  rosenbrock:eval_coeff(-p(1),[1.5,2.5,3.5],[-1,2], 1, R5), R5 =:= -2,
  rosenbrock:eval_coeff(25/[1],[1.5,2.5,3.5],[-1,2], 1, R6), R6 =:= 10,
  rosenbrock:eval_coeff([1]^p(1),[1.5,2.5,3.5],[-1,2], 1, R7), R7 =:= 6.25.

test(eva_coeff_2) :-
16
  nb_setval(hdid,0.01),
17
18
19
  rosenbrock:eval_coeff(floor(1*[0]),[1.5,2.5,3.5],[-1,2], 1, R1), R1 =:= 1,
  rosenbrock:eval_coeff(min([0], p(1)),[1.5,2.5,3.5],[-1,2], 1, R2), R2 =:= 1.5,
  rosenbrock:eval_coeff(infinity,[1.5,2.5,3.5],[-1,2], 1, R3), R3 =:= inf,
20
  rosenbrock:eval_coeff(random,[1.5,2.5,3.5],[-1,2], 1, _R4).
21

HEMERY Mathieu's avatar
HEMERY Mathieu committed
22
23
24
25
26
test(simple_integration) :-
  command(a => b),
  command(present(a,1.0)),
  command(numerical_simulation(method:rsbk)).

Mathieu Hemery's avatar
Mathieu Hemery committed
27
:- end_tests(rosenbrock).