0
$\begingroup$

I am trying to use the Dynamo notebook (https://www.ssc.wisc.edu/~whs/dynamo/dynamo_3S_v1.4.1.nb) in a loop over parameters. Basically, this software takes one matrix as input, solves ODEs and some other rather complex equations, and produces some graphical output that I am rerouting into an eps file. What I am trying to do is not only having one matrix as an input, but a list of them, and call the notebook with an index parameter that tells the Dynamo notebook to use the matrix at this index. This I could easily loop over. However, while I have been successfully operating master-slave notebooks with

nb=NotebookOpen["/path/to/file.nb"]
f[par_]:=(
  index1=par;
  NotebookEvaluate[nb];
)
f[5] (*5 is my choice for the variable index1 in my slave notebook*),

it produces a huge amount of error messages for the Dynamo software that vanish again immediately and restart the whole kernel on top of that. How can I fix this?

$\endgroup$
  • $\begingroup$ Why not just convert the code to a package and run that...? Any time you're "calling a notebook" you're probably thinking about the problem wrong. Notebooks are for exploration and interactivity. Packages are for chunks of code you want to reuse. $\endgroup$ – b3m2a1 Jul 3 at 8:11
  • $\begingroup$ How about mathematica.stackexchange.com/questions/29324/… $\endgroup$ – Kuba Jul 3 at 9:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.