Simscape run-time with transmission line

4 ビュー (過去 30 日間)
Stefan Schützhoff
Stefan Schützhoff 2022 年 5 月 14 日
回答済み: Hari 2024 年 1 月 10 日
Dear all,
I want to simulate wave effects with a series of Lumped parameter L-Section transmission lines. I call the simulation from an Matlab App with the "sim" command and use the "setVariable" function for simulation input. So I want to set the Inductance, Capacitance and Resistance per unit length from "Compile-time" to "Run-time". But if I do that, I receive the following error when I try to Update the Model:
Error compiling Simscape network for model Wanderwellen_Leitungsmodell.
Caused by:
  • Function 'ee.internal.passive.transmission_line_distributed_param' must be an unprotected MATLAB function. In ee.passive.lines.transmission_line
  • R = {[1x1 double], 'Ohm/km'}
  • x_L = {[1x1 double], 'H'}
  • LEN = {1, 'km'}
  • C = {[1x1 double], 'F/km'}
  • G = {0, 'S/km'}
  • freq = {60, 'Hz'}
Can somebody help me please?
Thanks a lot!

回答 (1 件)

Hari
Hari 2024 年 1 月 10 日
Hi Stefan Schützhoff,
I understand that you want to simulate wave effects using a series of Lumped parameter L-Section transmission lines in Simscape and you need to set the inductance, capacitance, and resistance per unit length from compile-time to run-time. You are encountering an error upon updating the model after making these parameters run-time configurable.
The provided error suggests there might be an issue with the Simscape language file or function that defines the transmission line. Simscape requires MATLAB functions used in component definitions to be unprotected, which means they should not be encrypted or p-coded.
To resolve this issue,
  • Ensure that the function "ee.internal.passive.transmission_line_distributed_param" is a regular MATLAB .m file and is accessible on the MATLAB path.
  • If this function is part of a Simscape custom component or library, you might need to check that the file is not p-coded and does not have any restrictions that would prevent Simscape from accessing it during model compilation.
Refer to the documentation of Simscape for more information on creating custom components and setting parameters:
Hope this helps!

カテゴリ

Help Center および File ExchangeComposite Components についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by