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.

cosimulation

Please login with a confirmed email address before reporting spam

I have a question . You may not be engaged in this field, but I believe that your professional ability can advise me. That is, I want to make a model in simulink and then use livelink with simulink co-simulation, and then the model made in COMSOL is a two-winding transformer. I hope to be able to connect one port (one coil) of the transformer to one circuit in simulink and then connect the rest of one port (another coil) of one of the coils to another circuit, so this situation must require COMSOL. To have input and output, for example, Simulink has a circuit that generates a voltage and this voltage is applied to the COMSOL model transformer, and then another coil has a terminal voltage that is input to the next circuits. Do you have a good suggestion? Thank you.


1 Reply Last Post 16 mars 2023, 05:57 UTC−4
Remi Magnard COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 years ago 16 mars 2023, 05:57 UTC−4
Updated: 2 years ago 16 mars 2023, 08:47 UTC−4

Dear Guo Jiang,

In the COMSOL Application Libraries you will find a section for LiveLink for Simulink tutorial models. The workflow to run a cosimulation is always the same, so even we do not have the exact application you want to solve you will find the information to set up your model.

If you experience problems when running the cosimulation in Simulink you may try the following general advice:

  1. Make sure the model runs in COMSOL with similar input as you would set in Simulink. In your specific case you may want to try to set up a simple electrical circuit in COMSOL and see if you can solve your problem using a segregated solver (both finite element model and circuit running sequentially). In some cases, the component is so intricate in the electrical circuit that it needs to be solved fully coupled. If it is the case for you, cosimulation might not be suited.

  2. Reduce the communication step size. Keep in mind that, in cosimulations, COMSOL and Simulink run independently and exchange information at communication time steps. It is important to adjust this communication time step; a too large value may cause convergence error, while a very small value leads to important computational time.

If you have issues to set-up your model, please send it to the our support (support@comsol.com) so we can provide an appropriate answer to your specific problem.

Best regards,

Rémi Magnard

Dear Guo Jiang, In the COMSOL Application Libraries you will find a section for LiveLink for Simulink tutorial models. The workflow to run a cosimulation is always the same, so even we do not have the exact application you want to solve you will find the information to set up your model. If you experience problems when running the cosimulation in Simulink you may try the following general advice: 1. Make sure the model runs in COMSOL with similar input as you would set in Simulink. In your specific case you may want to try to set up a simple electrical circuit in COMSOL and see if you can solve your problem using a segregated solver (both finite element model and circuit running sequentially). In some cases, the component is so intricate in the electrical circuit that it needs to be solved fully coupled. If it is the case for you, cosimulation might not be suited. 2. Reduce the communication step size. Keep in mind that, in cosimulations, COMSOL and Simulink run independently and exchange information at communication time steps. It is important to adjust this communication time step; a too large value may cause convergence error, while a very small value leads to important computational time. If you have issues to set-up your model, please send it to the our support (support@comsol.com) so we can provide an appropriate answer to your specific problem. Best regards, Rémi Magnard

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.