Error - "Simulink cannot propagate the variable-size mode"

4 ビュー (過去 30 日間)
Rajani Metri
Rajani Metri 2021 年 3 月 25 日
回答済み: Sulaymon Eshkabilov 2021 年 4 月 3 日
Hello,
I am doing a simple RLC simulation using Simscape and commonly used blocks as shown below,
The block parameters are R = 2ohm, L = 1H, C = 0.2F (initial voltage across capacitor 1V).
and I am getting error as:
In the simulation I used CLK as "t" to represent instantaneous time (u). And the MATLAB fcn block has code which generates the control signal (y) the code is
function y = fcn(u)
coder.extrinsic('solveSymsTotal');
%coder.varsize
y = 0;
y = solveSymsTotal(u);
and in "solveSymsTotal" file has u(t) as given below:
And in Configuration Parameters of SImulation I tried by changing Fixed-Step and Variable-Step both, but still I am getting error.
Also in Simulation I want to plot Phase-trajectory of two states, so I uesd derivative block and XY Graph, but I am unable to find where to give initial Conditions of states? (For capacitor voltage, I mentioned its initial voltage)
Can any one rectify where I am doing wrong?
Thank You.

回答 (1 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021 年 4 月 3 日
Your MATLAB fcn blck file should have:
function y = fcn(u)
y = 0.02559*exp(u).*sin(2*u)-0.059734*exp(u).*cos(2*u);

カテゴリ

Help Center および File ExchangeConverters (High Power) についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by