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