-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: Keep greek letters in extracted model somehow #6224
Comments
Only the name should be translated to unicode characters. |
So, when one sends Greek letters in the LaTeX to "Create model from equations" operator, the SymPy intermediate code writes them as words, which MIRA then uses to make the AMR with names A solution would be to pass the model AMR through some regex that will convert any Greek letter words in the state/parameter/observable "name" (not "id" nor anywhere else) to the unicode character, e.g. https://en.wikipedia.org/wiki/Greek_letters_used_in_mathematics,_science,_and_engineering Caveat:
LaTeX [
"\\frac{d S(t)}{d t} = - \\beta * S(t) * I(t) - \\mu",
"\\frac{d I(t)}{d t} = \\beta * S(t) * I(t) - \\gamma * I(t) - \\mu",
"\\frac{d R(t)}{d t} = \\gamma * I(t) - \\mu"
] becomes SymPy: import sympy
# Define time variable
t = sympy.symbols("t")
# Define variables with time derivative to be time-dependent functions
S, I, R = sympy.symbols("S I R", cls=sympy.Function)
# Define all parameters
beta, mu, gamma = sympy.symbols("beta mu gamma")
# Define the equations without time-derivative on the left hand side
equation_output = [
sympy.Eq(S(t).diff(t), (-beta * S(t) * I(t) - mu).expand()),
sympy.Eq(I(t).diff(t), (beta * S(t) * I(t) - gamma * I(t) - mu).expand()),
sympy.Eq(R(t).diff(t), (gamma * I(t) - mu).expand())
] and then this AMR
|
Describe the bug
Keep greek letters in extracted model somehow
Screenshots
The text was updated successfully, but these errors were encountered: