Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lifeware
biocham
Commits
257ca6d5
Commit
257ca6d5
authored
Mar 19, 2018
by
SOLIMAN Sylvain
Browse files
Merge branch 'hotfix/ode_simplification'
parents
111e93f7
137a208d
Changes
3
Hide whitespace changes
Inline
Side-by-side
about.pl
View file @
257ca6d5
...
...
@@ -8,7 +8,7 @@
about
/
0
]).
version
(
'4.1.
6
'
).
version
(
'4.1.
7
'
).
copyright
(
'Copyright (C) 2003-2018 Inria, EPI Lifeware, Saclay-Île de France, France'
...
...
ode.pl
View file @
257ca6d5
...
...
@@ -1077,8 +1077,7 @@ ode_add_expression_to_molecule(NewExpression, Molecule) :-
(
retract
(
assoc
(
Molecule
,
Expression
))
->
true
asserta
(
assoc
(
Molecule
,
Expression
+
NewExpression
))
;
Expression
=
0
),
asserta
(
assoc
(
Molecule
,
Expression
+
NewExpression
)).
asserta
(
assoc
(
Molecule
,
NewExpression
))
).
reaction_editor.pl
View file @
257ca6d5
...
...
@@ -471,11 +471,12 @@ factorize_solution([], []).
factorize_solution
([
Coefficient
*
Object
|
Tail
],
SimplifiedSolution
)
:-
collect_object
(
Tail
,
Object
,
TailCoefficient
,
Others
),
simplify
(
Coefficient
+
TailCoefficient
,
SimplifiedCoefficient
),
% simplify(Coefficient + TailCoefficient, SimplifiedCoefficient),
SimplifiedCoefficient
is
Coefficient
+
TailCoefficient
,
(
SimplifiedCoefficient
=
0
->
simplify_solution
(
Others
,
Simplified
Coefficient
)
simplify_solution
(
Others
,
Simplified
Solution
)
;
SimplifiedSolution
=
[
SimplifiedCoefficient
*
Object
|
SimplifiedTail
],
simplify_solution
(
Others
,
SimplifiedTail
)
...
...
@@ -598,13 +599,17 @@ make_reaction(
compute_ode_for_reactions
:-
\
+
(
item
([
kind
:
reaction
,
item
:
Item
]),
reaction
(
Item
,
Kinetics
,
Reactants
,
Inhibitors
,
Products
),
\
+
(
forall
(
(
item
([
kind
:
reaction
,
item
:
Item
]),
reaction
(
Item
,
Kinetics
,
Reactants
,
Inhibitors
,
Products
)
),
(
kinetics
(
Reactants
,
Inhibitors
,
Kinetics
,
KineticsExpression
),
add_molecules
(
Reactants
,
-
KineticsExpression
),
add_molecules
(
Products
,
KineticsExpression
)
maplist
(
negate_coefficient
,
Reactants
,
NegatedReactants
),
append
(
NegatedReactants
,
Products
,
StoichiometricSolution
),
simplify_solution
(
StoichiometricSolution
,
SimplifiedSolution
),
add_molecules
(
SimplifiedSolution
,
KineticsExpression
)
)
).
...
...
@@ -620,3 +625,6 @@ add_molecules(Molecules, Kinetics) :-
add_molecule
(
Coefficient
*
Molecule
,
Kinetics
)
:-
ode_add_expression_to_molecule
(
Coefficient
*
Kinetics
,
Molecule
).
negate_coefficient
(
C
*
X
,
(
-
C
)
*
X
).
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment