Linking LAMMPS output with MATLAB

Hello all,

I am learning LAAMPS now and had one question. Will be very helpful if anyone here can reply.

Can I link the output found in LAMMPS with MATLAB? Say for example, if I find out thermal conductivity of Graphene with LAMMPS, can I optimise it in MATLAB with their optimisation tools?

Can anyone please advice on the code connecting them?

Hello all,

I am learning LAAMPS now and had one question. Will be very helpful if
anyone here can reply.

Can I link the output found in LAMMPS with MATLAB? Say for example, if I
find out thermal conductivity of Graphene with LAMMPS, can I optimise it in
MATLAB with their optimisation tools?

what would be the optimization target? which variables would you want
to vary? how are you going to teach MATLAB to find out when your
result has converged? how are you going to handle the statistical and
systematic errors contained in your simulation results?

If you can answer all the Qs Axel posed,
then from a software point of view it is
not hard to “link” LAMMPS and Matlab.

For example, LAMMPS has a shell command
that you could run an external program (e.g.
a Matlab script). You could use a file-style
variable to get the Matlab output into the
LAMMPS input script. Or you could use
LAMMPS from an external program (like
a Python script) that invokes LAMMPS and
Matlab in an interative loop.

But the hard questions are the conceptual
ones that Axel asked.

Steve

Thanks a lot Axel and Steve for the helpful advice. I have created a Graphene sheet using Nanotube Builder options in VMD and saved the data in LAMMPS readable format. Then I changed the data file to incorporate the dopes (C-13) in it. Now, I wrote a LAMMPS input script to fix the thermal conductivity and found it out with the help of Mueller Plathe’s paper. Now can I minimise the thermal conductivity with respect to the location of dopes in the Graphene sheet,comprising of 1500 atoms.?

This was briefly my problem and am searching for a suitable technique. Open to helpful advice. Thanks.

Thanks a lot Axel and Steve for the helpful advice. I have created a
Graphene sheet using Nanotube Builder options in VMD and saved the data in
LAMMPS readable format.

Then I changed the data file to incorporate the dopes (C-13) in it.

why not do this right away with VMD?

Now, I wrote a LAMMPS input script to fix the thermal
conductivity and found it out with the help of Mueller Plathe's paper. Now
can I minimise the thermal conductivity with respect to the location of
dopes in the Graphene sheet,comprising of 1500 atoms.?

This was briefly my problem and am searching for a suitable technique. Open
to helpful advice. Thanks.

well, that still doesn't explain what kind of target function you want
to present to the "optimizer" and what kind of optimization method you
can use at all.

axel.

Axel,

Basically he is trying to perform series of calculations, by altering doping position. In this way he will get get the Conductivity as a function of doping position. I guess this the main issue.

Therefore, basic question, I suppose, is how to automate the process?

Axel,

Basically he is trying to perform series of calculations, by altering doping
position. In this way he will get get the Conductivity as a function of
doping position. I guess this the main issue.

Therefore, basic question, I suppose, is how to automate the process?

in my personal opinion, all that really needs to be automated would be
the creation of data files, which can be done with VMD.
then you'd run a bunch of calculations and then create new data files
based on the results, e.g. using a simple evolutionary algorithm. the
scoring/fitness of a given "mutant" is a trivial parse of the
simulation log.

the management of the whole simulation thing can be done with
variables that can be passed to the lammps input script via the -var
command line flag.

it is probably also possible to do the same thing in python using
Pizza.py. MATLAB is most certainly overkill and rather pointless since
you don't have a well defined target function to optimize.

axel.

Thanks a lot Rajib and Axel. That helped a lot. Working on it.