mobook / MO-book

Hands-On Optimization with Python
https://mobook.github.io/MO-book/
MIT License
162 stars 47 forks source link

main book drawings.ipynb #32

Open alessandrozocca opened 2 years ago

alessandrozocca commented 2 years ago
jckantor commented 2 years ago

I added a the start of a new preamble that would give the option of displaying svg files in all notebooks. Then with one line, the notebooks could be run and the svg files saved for import to the book. The first example is "refinery production" problem in Chapter 5. If this workflow makes sense, we can refine the font sizes.

If you're willing to add one line to each cell producing a desired graphic, then a meta data tag with a current date could be added to the figure which might help track versioning.

gromicho commented 2 years ago

@jckantor : that's great stuff what you are collecting on mobook.py! the refinery production notebook runs like a charm on windows as well and the picture is indeed vectorized, the interactive saving gives choice of pdf or svg.

jckantor commented 2 years ago

Great. I've added a a few functions to allow some flexibility in setting up a google colab session.

mobook.setup_pyomo() mobook.setup_solvers()

provides pyomo a small set of solvers. For mac and windows users, the these would check and test for pyomo and some solvers. If you only need a specific solver, then

mobook.setup_pyomo() mobook.setup_ipopt()

would do the job. Let me know what you think .. this is a work in progress.