[Reddit Cross Post] Connect Simulink signal to Electrical (Simscape) signal

39 Ansichten (letzte 30 Tage)
I need to use a signal generated in a Simulink subsystem and output its voltage to Simscape Electrical model.
While I know how to convert Simscape signals to Simulink (using a sensor and the PS-Simulink Converter), I'm stuck doing the reverse.
What is the standard method for converting a Simulink signal into the Simscape Electrical domain to control a source? The Simulink-PS Converter block doesn't seem to connect directly to the control port of the electrical sources.
Is this a practical approach for integrating two large, existing systems? Any examples would be great.

Akzeptierte Antwort

Toshiaki Takeuchi
Toshiaki Takeuchi am 6 Nov. 2025 um 18:13
To answer the question in the picture: prefer to use a single simulation technology. In this case the most appropriate Simscape blocks to use are the Voltage Source (Three-Phase) and Current and Voltage Sensor (Three-Phase). If you need to connect the blocks as they appear in the picture, then it's not recommended to mix simulation technologies, but you can use blocks such as Current-Voltage Simscape Interface.

Weitere Antworten (1)

Neal
Neal am 16 Okt. 2025 um 6:42
Hi Toshiaki,
This might be bit of a convoluted way, since I haven't actually spent any time trying out other ways. But off the top of my head you could write out your simulink signal to your workspace as a variable (this might be a challenge as the block "to Workspace" only writes after the simulation has ended or paused, alternatively you could try a matlab function block with "assignin" function, I donot know if it writes after every sample time or at the end of the simulation) and then parameterise your simscape electrical source to accept that variable as its amplitude.
Good luck.

Produkte


Version

R2025b

Community Treasure Hunt

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

Start Hunting!

Translated by