Can one call an external function to calculate something during a simulation?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Can one call an external function to calculate something during a simulation?

Submitted Questions
Jiao Zhao wrote
We can transfer the GUI code to m code. Does it mean that after the conversion, we can call some external solver to calculate the concentration of c in a reaction during the simulation?
You can export and save models in Matlab m-file format by selecting Save As MATLAB Script... from the File menu. The exported Matlab script is the exact same simulation model you have developed in the GUI but can now be run in Matlab without the GUI (as long as you have FEATool Multiphysics installed). You can also edit the script as you like including using all Matlab functionality and toolboxes you might have.

You can of course also call any function or custom script you have both in the GUI and command line interfae (CLI) provided it follows a compatible syntax. See for example the "Custom and user-defined functions" section in the following link:

https://www.featool.com/tutorial/2019/01/07/modeling-with-non-constant-coefficients-in-featool-multiphysics.html