Jeff Hiller
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
6 years ago
Apr 12, 2019, 5:24 p.m. EDT
Updated:
6 years ago
Apr 12, 2019, 5:24 p.m. EDT
Hello Owen,
Yes, you can use LiveLink for MATLAB to automate geometry creation, if you have MATLAB, see its documentation for syntax information.
Another approach is to use model methods, see this webinar for example or this blog.
And if you just want to generate equally spaced copies of an object, in the GUI you can use the array tool.
Best,
Jeff
-------------------
Jeff Hiller
Hello Owen,
Yes, you can use LiveLink for MATLAB to automate geometry creation, if you have MATLAB, see its documentation for syntax information.
Another approach is to use model methods, see this [webinar](https://www.comsol.com/video/automating-your-modeling-workflow-with-model-methods-in-comsol) for example or this [blog](https://www.comsol.com/blogs/how-to-create-a-randomized-geometry-using-model-methods/).
And if you just want to generate equally spaced copies of an object, in the GUI you can use the array tool.
Best,
Jeff
Lars Gregersen
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
6 years ago
Apr 23, 2019, 6:30 a.m. EDT
The rule is simple. If you know how to do a thing in the Comsol GUI then you can learn about the corresponding syntax by saving the model as an M-file.
Try to add something (e.g. a box) to your model. Duplicate it. Change a few parameters for the new box. Save the model as an M-file. If you open the M-file you can see exactly what commands to use in your Matlab scripts.
There is a duplicate() method in the API that can be used for duplication. It is not expected that duplication is faster than creating a new object from scratch (but it may be possible to do what you want with less coding).
-------------------
Lars Gregersen
Comsol Denmark
The rule is simple. If you know how to do a thing in the Comsol GUI then you can learn about the corresponding syntax by saving the model as an M-file.
Try to add something (e.g. a box) to your model. Duplicate it. Change a few parameters for the new box. Save the model as an M-file. If you open the M-file you can see exactly what commands to use in your Matlab scripts.
There is a duplicate() method in the API that can be used for duplication. It is not expected that duplication is faster than creating a new object from scratch (but it may be possible to do what you want with less coding).