Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LCSB-BioCore
SBML.jl
Commits
951bf82b
Commit
951bf82b
authored
Jun 27, 2021
by
Miroslav Kratochvil
Browse files
make the symbolics translation a bit more comprehensive
parent
6c2df2d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/symbolics.jl
View file @
951bf82b
...
...
@@ -11,21 +11,10 @@ unambiguously represented in Julia; it is supposed to be extended by the user
if more functions need to be supported.
"""
const
default_symbolics_mapping
=
Dict
{
String
,
Any
}(
"*"
=>
:*
,
"+"
=>
:+
,
"-"
=>
:-
,
"*"
=>
:*
,
"/"
=>
:/
,
"power"
=>
:^
,
"lt"
=>
:<
,
"leq"
=>
:<=
,
"geq"
=>
:>=
,
"gt"
=>
:>
,
"ceiling"
=>
:
ceil
,
"floor"
=>
:
floor
,
"piecewise"
=>
:
(
Core
.
ifelse
),
"ln"
=>
:
log
,
"exp"
=>
:
exp
,
"abs"
=>
:
abs
,
"arccos"
=>
:
acos
,
"arccosh"
=>
:
acosh
,
...
...
@@ -39,6 +28,7 @@ const default_symbolics_mapping = Dict{String,Any}(
"arcsinh"
=>
:
asinh
,
"arctan"
=>
:
atan
,
"arctanh"
=>
:
atanh
,
"ceiling"
=>
:
ceil
,
"cos"
=>
:
cos
,
"cosh"
=>
:
cosh
,
"cot"
=>
:
cot
,
...
...
@@ -46,17 +36,32 @@ const default_symbolics_mapping = Dict{String,Any}(
"csc"
=>
:
csc
,
"csch"
=>
:
csch
,
"eq"
=>
:
isequal
,
"exp"
=>
:
exp
,
"factorial"
=>
:
factorial
,
# "log" => :log, # fix
# "root" => ,
"sec"
=>
:
sec
,
"floor"
=>
:
floor
,
"geq"
=>
:>=
,
"gt"
=>
:>
,
"leq"
=>
:<=
,
"ln"
=>
:
log
,
"log"
=>
:
sbmlLog
,
"lt"
=>
:<
,
"piecewise"
=>
:
(
Core
.
ifelse
),
"power"
=>
:^
,
"root"
=>
:
sbmlRoot
,
"sech"
=>
:
sech
,
"s
in
"
=>
:
s
in
,
"s
ec
"
=>
:
s
ec
,
"sinh"
=>
:
sinh
,
"sin"
=>
:
sin
,
"tanh"
=>
:
tanh
,
"tan"
=>
:
tan
,
"tanh"
=>
:
tanh
,
)
sbmlLog
(
x
)
=
log
(
x
,
10
)
sbmlLog
(
base
,
x
)
=
log
(
x
,
base
)
sbmlRoot
(
x
)
=
sqrt
(
x
)
sbmlRoot
(
power
,
x
)
=
x
^
(
1
/
power
)
allowed_sym
(
x
,
allowed_funs
)
=
haskey
(
allowed_funs
,
x
)
?
allowed_funs
[
x
]
:
throw
(
DomainError
(
x
,
"Unknown SBML function"
))
...
...
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