Commit 18a25595 authored by Mathieu Hemery's avatar Mathieu Hemery

Start branching the pipe on biocham

parent ca124727
......@@ -9,7 +9,11 @@
numerical_simulation/0,
continue/0,
% Public API
prepare_numerical_simulation_options/1
prepare_numerical_simulation_options/1,
gather_equations/1,
check_no_free_identifiers/0,
convert_ode/0,
enumerate_variables/0
]
).
......
/* Module to find the stable/unstable states of a set of ODE
* Most of the code is based on the algorithm describde in Numerical Recipes
* Coder: M. Hemery
*/
:- module(stable_state,
[
test_stable/0
]
).
% Only for separate compilation
:- use_module(arithmetic_rules).
:- use_module(util).
:- use_module(formal_derivation).
:- use_module(functions).
:- use_module(numerical_simulation).
:- use_module(rosenbrock).
%%% BIOCHAM COMMAND
test_stable :-
biocham_command,
with_current_ode_system(
with_clean(
[
numerical_simulation:variable/2,
numerical_simulation:equation/2,
numerical_simulation:parameter_index/2,
numerical_simulation:conditional_event/2,
numerical_simulation:conditional_parameter_value/2
],
(
get_option(time, Time),
get_option(method, Method),
get_option(error_epsilon_absolute, ErrorEpsilonAbsolute),
get_option(error_epsilon_relative, ErrorEpsilonRelative),
get_option(initial_step_size, InitialStepSize),
get_option(maximum_step_size, MaximumStepSize),
get_option(minimum_step_size, MinimumStepSize),
get_option(precision, Precision),
get_option(filter, Filter),
set_counter(conditional_events,0),
check_no_free_identifiers,
enumerate_variables,
convert_ode,
gather_equations(Equations)
)
)
),
format("Equations: ~w~n", [Equations]).
%%% API
%%% INTERNAL FUNCTION
%~~~ Equations should be written as those passed to integration (where ?)
newton_method(Equations, Jacobian, Current, Parameters, Tolerance, Result) :-
% Estimate function and jacobian
eval_state(Current, Parameters, TrueCurrent),
eval_row(Equations, TrueCurrent, Parameters, F_Value),
eval_matrix(Jacobian, State, Parameters, J_Value),
debug(stable_state, "Current value: ~w~n", [F_Value]).
% Check convergence
% Solve LU Decomposition
% Update the solution
......@@ -113,6 +113,7 @@
- markov.pl
- rosenbrock.pl
- matrix.pl
- stable_state.pl
** Hybrid simulations
- hybrid.pl
** Plotting and exporting the result of simulations
......
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