yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #14986
Re: [Question #634499]: interface problem Yade-Matlab
Question #634499 on Yade changed:
https://answers.launchpad.net/yade/+question/634499
Status: Open => Answered
Robert Caulk proposed the following answer:
Hello,
I have not seen anyone try to do this. Probably because python-numpy can
do nearly everything matlab can do, and yade's interface runs through
python.
My first question is, which optimization function are you trying to use
in matlab? It is possible there is a comparable one in python which
would make your life very easy. For example, here is a PSO for python
[1]. My second question is, which parameters are you trying
As far as I see, you have two options. The first option is to port your
matlab code over to python and add it as a function within the yade
script. This way you can run the yade simulation followed by your
optimization, which will modify certain parameters, then you can reload
the yade simulation to some virgin state and loop until you want to
stop. All within the same script.
The second option is to use a bash or python script to manipulate yade
and matlab externally. First the script would execute yade. Inside yade
it would read txt files for its parameters and write its output to txt
files. Then the bash script would move to executing matlab, which would
also read the txt files output by yade and write its output parameters
to a txt file for yade.
Cheers,
Robert
[1]https://pypi.python.org/pypi/pyswarm/
--
You received this question notification because your team yade-users is
an answer contact for Yade.