Remi Magnard
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
3 years ago
2022年4月12日 GMT-4 10:38
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
2022年4月17日 GMT-4 13:46
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
2022年4月18日 GMT-4 13:50
Updated:
3 years ago
2022年4月18日 GMT-4 13:51
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
2022年4月19日 GMT-4 10:54
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.