Skip to content
Snippets Groups Projects
Commit 60ad2bd9 authored by Lars Hubatsch's avatar Lars Hubatsch
Browse files

to_min_theory, needed for previous commit.

parent 14cbff96
No related branches found
No related tags found
No related merge requests found
function [cost, v_fit] = to_min_theory(r_n, t, x_fit, reference)
% TO_MIN_THEORY Takes reference simulation and tries to find simulation
% that fits total intensity recovery. Uses the full model, including bulk.
T = Ternary_model(2, 'FRAP', [-1, 0.001, 0.5, 0.4, x_fit(1), x_fit(2), 40], t, 1);
T.solve_tern_frap();
v_fit = T.sol(:, 1:100);
% Return cost as the sum of squared differences of model and experiment
% cost = sum(sum((v_fit-r_n).^2));
cost = sum((sum(v_fit, 2) - reference).^2);
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment