Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Advanced Closed-Loop Control of COMSOL Model using Matlab

Please login with a confirmed email address before reporting spam

Hi

I'm an experienced user of Matlab where I usually do modelling and simulation of a desired control object. The problem is, that the object I'm about to control contains some complicated dynamics, that would be tedious to model and simulate in Matlab.

Instead, I would like to simulate the model in a more appropriate software like COMSOL, while calculating the control action from Matlab. In this way, I can take advantage of all the control-toolboxes available in Matlab, while using the modeling and simulation engine of COMSOL. I have never used COMSOL, but it seems to be a very powerful tool.

In a quick search I encountered LiveLink™ for MATLAB. Do anyone know if that can be used to create the link between Matlab and COMSOL that I'm looking for?

Best Regards,
Andreas

4 Replies Last Post Jan 10, 2016, 3:26 p.m. EST
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 9 years ago Jan 9, 2016, 9:42 p.m. EST
Hi

certainly that is a good approach, the Matlab link allows you full control of the COMSOL internals, but be aware that the entry demand is rather high, COMSOL is very open and generic but also very detailed to allow full control of all physics.

Nevertheless, I can clearly state that once you master both Matlab and COMSOL you have an unique selling force of your skills, within your company and outside, so its really worth to consider!

Now if you are doing i.e advance mechanism control, another approach is to use COMSOL to generate the State Space reduced matrices of your model and export only those to Matlab for further processing. You will certainly gain solver time. And Finally depending on your model, you might be just as well optimizing and implementing your controller fully inside COMSOL, you do not have the same engineering tools there but one can do quite a lot inside COMSOL too, all depends on the model complexity and your possible need to run via other tools such as dSpace or other hardware in the loop programs, closely linked to Matlab, to test your model once simulated

--
Good luck
Ivar
Hi certainly that is a good approach, the Matlab link allows you full control of the COMSOL internals, but be aware that the entry demand is rather high, COMSOL is very open and generic but also very detailed to allow full control of all physics. Nevertheless, I can clearly state that once you master both Matlab and COMSOL you have an unique selling force of your skills, within your company and outside, so its really worth to consider! Now if you are doing i.e advance mechanism control, another approach is to use COMSOL to generate the State Space reduced matrices of your model and export only those to Matlab for further processing. You will certainly gain solver time. And Finally depending on your model, you might be just as well optimizing and implementing your controller fully inside COMSOL, you do not have the same engineering tools there but one can do quite a lot inside COMSOL too, all depends on the model complexity and your possible need to run via other tools such as dSpace or other hardware in the loop programs, closely linked to Matlab, to test your model once simulated -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 9 years ago Jan 10, 2016, 7:38 a.m. EST
Thanks Ivar.

That was the answer I looked for.

Do you know of any examples where COMSOL and Matlab is used together to do control system analysis, design and simulation? Some tutorial in how to get started would be appreciated.

Do you have some general good advice in how to get started?

Specifically, what I have to simulate in COMSOL is plastic injection molding, i.e. the plastic injection process into a mold-cavity while having access to the melt-front position, melt-pressures and temperatures.

Best Regards,
Andreas
Thanks Ivar. That was the answer I looked for. Do you know of any examples where COMSOL and Matlab is used together to do control system analysis, design and simulation? Some tutorial in how to get started would be appreciated. Do you have some general good advice in how to get started? Specifically, what I have to simulate in COMSOL is plastic injection molding, i.e. the plastic injection process into a mold-cavity while having access to the melt-front position, melt-pressures and temperatures. Best Regards, Andreas

Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 9 years ago Jan 10, 2016, 2:28 p.m. EST
Hi

no I do not have anything else than the Application library of COMSOL to propose (do not forget to upload latest: File - Help - Update Application library (but you must run COMSOL as admin to save them on MS-Win

To learn COMSOL, check the COMSOL website: all the Videos and tutorials and take a few of the Webinars that are related to your interest, then go through all application library modules that are related with the physics you want to study (and Matlab Livelink), print them out as pdf and build the models as described.

And as usual start simple, because COMSOL has thousands of buttons hidden under the hood, so use defaults values to begin with and change a parameter and one physics at the time, and soon you will become a specialist :)

--
Good luck
Ivar
Hi no I do not have anything else than the Application library of COMSOL to propose (do not forget to upload latest: File - Help - Update Application library (but you must run COMSOL as admin to save them on MS-Win To learn COMSOL, check the COMSOL website: all the Videos and tutorials and take a few of the Webinars that are related to your interest, then go through all application library modules that are related with the physics you want to study (and Matlab Livelink), print them out as pdf and build the models as described. And as usual start simple, because COMSOL has thousands of buttons hidden under the hood, so use defaults values to begin with and change a parameter and one physics at the time, and soon you will become a specialist :) -- Good luck Ivar

Please login with a confirmed email address before reporting spam

Posted: 9 years ago Jan 10, 2016, 3:26 p.m. EST
Hi Ivar

Thanks for your help!

I will give it a try.

Best Regards,
Andreas
Hi Ivar Thanks for your help! I will give it a try. Best Regards, Andreas

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.