rbmatlab  1.13.10
 All Classes Namespaces Files Functions Variables Groups Pages
test_matlab_convdiff.m
Go to the documentation of this file.
1 function OK = test_matlab_convdiff
2 % function performing a test of the elementary convdiff_model
3 % routines. In particular simulation without diffusion must be
4 % 10 times faster!!
5 % returns 1, if test is OK, 0 otherwise
6 
7 % Bernard Haasdonk 21.7.2009
8 
9 OK = 1;
10 
11 model = convdiff_model([]);
12 model_data = gen_model_data(model);
13 % without diffusion:
14 model = model.set_mu(model, [1,0,0]);
15 tic;
16 detailed_simulation(model,model_data);
17 t1 = toc;
18 % with diffusion
19 model = model.set_mu(model, [1, 0, 5e-8]);
20 tic;
21 detailed_simulation(model,model_data);
22 t2 = toc;
23 
24 if t2/t1<3
25  error('no! diffusion computation should be 10-20 times faster !!')
26  OK = 0;
27 end;
28 
29 
30 %| \docupdate