Friends from the SystemModeler
I have created a WSM model in Mathematica, In the simulation center, I have connected a Pulse source that drivens the dynamics of the model. The responses are as expected. I wanted to do the connection within Mathematica like this
BoostParmeters = {Rs -> 0.001, Rd -> 0.001, RLoad -> 12.5, Vd -> 0.8,
C1 -> 0.0002, L -> 0.0002, Vin -> 18};
(*System equations*)
eqns1 = {Derivative[1][iL][t] ==
Vin/L - (Rs iL[t])/L - (Vd S[t])/L - (Rd iL[t] S[t])/L + (
Rs iL[t] S[t])/L - (S[t] vC[t])/L,
Derivative[1][vC][t] == (iL[t] S[t])/C1 - vC[t]/(C1 RLoad)};
(*The connections*)
conns = {S[t] \[Element] "Modelica.Blocks.Interfaces.RealInput",
iL[t] \[Element] "Modelica.Blocks.Interfaces.RealOutput"};
BoostWSM =
CreateSystemModel["BoostCCM", eqns1, t,
conns, <|"InitialValues" -> Thread[{iL -> 0, vC -> 0}],
"ParameterValues" -> BoostParmeters|>];
(*Source*)
pwm2 =
SystemModel[
"Modelica.Blocks.Sources.Pulse", <|"ModelName" -> "pwmSignal",
"ParameterValues" -> {"width" -> 40, "period" -> 0.000100}|>];
(*Connecting the systems*)
Boost2 =
ConnectSystemModelComponents[{BoostWSM,
pwm2}, {"Pulse.y" -> "BoostCCM.S"}]
After this, it seems that the connection has been done. However, the siumlation
Simu = SystemModelSimulate[Boost2, {0, 0.02}];
SystemModelPlot[Simu, {"iL", "vC"}, PlotMarkers -> None]
will fail. I am not sure what I have done wrong. Could someone help me with this?
Cheers Jesus