Remi Magnard
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
3 years ago
Apr 12, 2022, 10:38 a.m. EDT
Dear Christian,
It seems that the problem you want to solve is exactly what LiveLink for Simulink is made for: running cosimulation between Simulink and COMSOL.
If you want to do it in MATLAB, you can look for the tutorial model: pseudoperiodicity_llmatlab. This model shows how to extract COMSOL result in MATLAB and set MATLAB variables back to the COMSOL model.
Dear Christian,
It seems that the problem you want to solve is exactly what LiveLink for Simulink is made for: running cosimulation between Simulink and COMSOL.
If you want to do it in MATLAB, you can look for the tutorial model: pseudoperiodicity_llmatlab. This model shows how to extract COMSOL result in MATLAB and set MATLAB variables back to the COMSOL model.
NafGh
Tallinn University of technology
Please login with a confirmed email address before reporting spam
Posted:
3 years ago
Apr 17, 2022, 1:46 p.m. EDT
Dear Christain,
Yes, this can be done. Your PID controller designed in MATLAB can a Function in COMSOL. However, to get real time the error from the concentration of gas, you would have to add to the study the Previous Solution Operator . you can get more information on this from the link below
https://www.comsol.com/blogs/using-the-previous-solution-operator-in-transient-modeling/#:~:text=COMSOL%20Multiphysics%20version%205.1%20includes,default%20implicit%20time%2Dstepping%20algorithm.
Dear Christain,
Yes, this can be done. Your PID controller designed in MATLAB can a Function in COMSOL. However, to get real time the error from the concentration of gas, you would have to add to the study the Previous Solution Operator . you can get more information on this from the link below
https://www.comsol.com/blogs/using-the-previous-solution-operator-in-transient-modeling/#:~:text=COMSOL%20Multiphysics%20version%205.1%20includes,default%20implicit%20time%2Dstepping%20algorithm.
Please login with a confirmed email address before reporting spam
Posted:
3 years ago
Apr 18, 2022, 1:50 p.m. EDT
Updated:
3 years ago
Apr 18, 2022, 1:51 p.m. EDT
An alternate approach would be to implement the controller in Comsol using added ODE physics.
(Easy enough for a simple PID controller with constant coefficients).
An alternate approach would be to implement the controller in Comsol using added ODE physics.
(Easy enough for a simple PID controller with constant coefficients).
Magnus Ringh
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
3 years ago
Apr 19, 2022, 10:54 a.m. EDT
Yes, or use the PID Controller add-in, available from Add-in Libraries on the Developer ribbon toolbar in the COMSOL Desktop.
Yes, or use the PID Controller add-in, available from Add-in Libraries on the Developer ribbon toolbar in the COMSOL Desktop.