ModECI / MDF

This repository contains the source for the MDF specification and Python API
https://mdf.readthedocs.io
Apache License 2.0
36 stars 69 forks source link

Newton's Law of cooling #533

Closed rimjhimittal closed 5 months ago

rimjhimittal commented 6 months ago

This PR contains python file, notebook, plot, graph, json, yaml and changes in test file and Readme demonstrating Newton's Law of Cooling with MDF

pgleeson commented 6 months ago

Thanks @rimjhimittal. Can you add the example to https://github.com/ModECI/MDF/blob/main/examples/MDF/README.mdwith a short description and saying it demonstrates the use of time_derivative?

rimjhimittal commented 6 months ago

Hi @pgleeson , I have made the required changes, Please check.

pgleeson commented 6 months ago

Thanks @rimjhimittal, looks good. Just for consistency though, could you move the notebook to the examples dir, and the png images to the images dir. See https://github.com/ModECI/MDF/blob/main/test_all.sh#L49.

Also, for the final committed notebook, think about a reader who wants to see all the steps as clearly and quickly as possible. Most of the notebook is a printout of the output of the simulation at every timestep. Useful for debugging, but slightly inconvenient when you have to scroll through it all. Maybe put an optional if verbose==True: ... in there so this can be switched on/off when required, but the default setting produces a nice compact resource to read.

rimjhimittal commented 6 months ago

Hi, if i change the code to if verbose: print... for optionally hiding output of simulation, i would still get the following in the output which is declared in execution_engine.py-

Init graph: cooling_process
Evaluating graph: cooling_process, root nodes: ['cool_node'], with array format numpy
Evaluating graph: cooling_process, root nodes: ['cool_node'], with array format numpy
Evaluating graph: cooling_process, root nodes: ['cool_node'], with array format numpy
Evaluating graph: cooling_process, root nodes: ['cool_node'], with array format numpy
Evaluating graph: cooling_process, root nodes: ['cool_node'], with array format numpy......

Should i do something to hide this too?

rimjhimittal commented 5 months ago

made the required changes

pgleeson commented 5 months ago

Looks good, thanks @rimjhimittal