Hi,
The table is a parameter in the TableCurrent block. You can set parameters by using
WSMSimulate["mymodel", {tstart,tend}, WSMParameterValues-> {"tableCurrent.table[1,1"->1,...}]
The drawback here is that you need to allocate the correct size of the table in the model before calling WSMSimulate. WSMParameterValues can only set values that already exist, i.e. it doesn't automatically expand the table matrix.
Thus, a better alternative would be to use the
SignalCurrent component. Like this:
model Model1
Modelica.Electrical.Analog.Basic.Ground ground;
Modelica.Electrical.Analog.Basic.Resistor resistor;
Modelica.Electrical.Analog.Sources.SignalCurrent signalCurrent;
Modelica.Blocks.Interfaces.RealInput u;
equation
connect(signalCurrent.i,u);
connect(signalCurrent.p,ground.p);
connect(signalCurrent.n,resistor.p);
connect(resistor.n,ground.p) ;
end Model1;
Then you can use
WSMInputFunctions to control the input signal from
WSMSimulate, like this:
WSMSimulate["Model1", {0, 10}, WSMInputFunctions -> {"u" -> Sin}]
Here, Sin can be replaced with an arbitrary Mathematica function.
I hope this helps.