Problem connecting a Simscape block with a Simulink block, even with a PS-Simulink Converter

13 visualizaciones (últimos 30 días)
Hi
Im trying to create a PEMFC system in simulink using Simscape, I've already created a made-up subsystem block with all the electrochemical modelling equations. But when I want to connect a source/tank to have the pressure and molar flow inputs I can't connect the Simscape block to the Simulink subsystem block using thr PS-Simulink converter. I've attached a screenshot of the problem.
Maybe is because I need to use another Simscape block as source?
  2 comentarios
Umar
Umar hace alrededor de 7 horas

Hi @Sergio,

I did research on your Simulink block diagram by doing some research work on math works documentation and found out what was going wrong in your screenshot. You're trying to use a PS-Simulink Converter to connect your Simulink subsystem to the fuel cell, but that's backwards and won't work. Let me explain the issue and give you the fix with proper references to the MathWorks documentation. The PS-Simulink Converter you’re using only goes from Simscape to Simulink — it reads physical signals out. To send your subsystem signal into the fuel cell, you need a Simulink-PS Converter instead.

Also, you can’t connect Simulink lines directly to conserving ports (the solid ones that carry pressure or flow). Those must link to other conserving ports. The way to bridge this is with Simscape source blocks — for example, use Pressure Source (G) or Flow Rate Source (G) set to “Controlled.” Then connect your Simulink signal → Simulink-PS Converter → source block control port, and connect the source’s conserving port to the fuel cell.

That’s exactly how MathWorks does it in the PEM Fuel Cell example (`openExample('simscape/PEMFuelCellSystemExample')`). It shows the full setup with hydrogen and air sources controlled by Simulink signals. Once you switch the converter direction and use the controlled source blocks, your model should run without those connection errors.

Hope that helps!

Umar
Umar hace alrededor de 3 horas

Hi @Sergio,

Let me know if this helps resolve your problem.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Simscape en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by