Errors when trying to latexify the model equations #4681
Sven-Mattus
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm currently using pybamm 24.11.0. When I try to use the latexify function for the model equations (mainly interested in the DFN), then I get several different errors, depending on what I try to do and which submodels I use.
E.g. generating the equations for simple base models like SPM() or DFN() including a .png file works fine. However,
Exception has occurred: RuntimeError
'latex' exited abnormally with the following output:
b"This is pdfTeX, Version 3.141592653-2.6-1.40.26 (MiKTeX 24.4) (preloaded format=latex.fmt)\r\n restricted...
Are there any specific latex programmes/versions we have to install to make this work?
/pybamm/latexify_pybamm.py
Traceback (most recent call last):
File "c:\Users\spm121\pybamm\latexify_pybamm.py", line 40, in
latex = model.latexify(newline=False)
\pybamm\expression_tree\unary_operators.py", line 128, in to_equation
eq1 = self.child.to_equation()
TypeError: cannot determine truth value of Relational
Traceback (most recent call last):
File "pybamm\latexify_pybamm.py", line 16, in
model.latexify("dfn_thermal_test.png")
File "\Lib\site-packages\pybamm\models\base_model.py", line 1364, in latexify
return Latexify(self, filename, newline).latexify(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\Lib\site-packages\pybamm\expression_tree\operations\latexify.py", line 210, in latexify
geo = self._get_geometry_displays(var)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\Lib\site-packages\pybamm\expression_tree\operations\latexify.py", line 76, in _get_geometry_displays
rng_min = get_rng_min_max_name(rng, "min")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "\Lib\site-packages\pybamm\expression_tree\operations\latexify.py", line 16, in get_rng_min_max_name
if getattr(rng[min_or_max], "print_name", None) is None:
~~~^^^^^^^^^^^^
KeyError: 'min'
Should this work or are those known issues/instabilities?
What are the conditions (like versions, submodels, settings of geometry and parameters etc.) and recommendations to make latexify work reliably?
This would be quite helpful to analyse the models and equations used as well as for generation presentations/reports etc.
thank you and best wishes,
Beta Was this translation helpful? Give feedback.
All reactions