Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Non-array modification 'true' for array component, possibly due to mis

Non-array modification 'true' for array component, possibly due to mis

check of model is ok During translation appear this error: " Non-array modification 'true' for array component, possibly due to missing 'each' " . What is the meaning of this error?

Re: Non-array modification 'true' for array component, possibly due to mis

This means that you have an array modification that's not an array, like this:

Code:


Real x[3](start = 1.0);

The proper way of doing this is to use each, like this:

Code:


Real x[3](each start = 1.0);

Re: Non-array modification 'true' for array component, possibly due to mis

thank you so much but there is a strange situation, in my model there are not array declaration:


model IdThreeLegs_battery_motore3 "Switches ideali Una gamba pwm"
  import SIM = Modelica.SIunits;
  import Modelica.Constants.pi;
  parameter Modelica.SIunits.Torque TLoad = 181.4 "Nominal load torque";
  parameter Modelica.SIunits.Time tStep = 1.2 "Time of load torque step";
  parameter Modelica.SIunits.Inertia JLoad = 0.29 "Load's moment of inertia";
  Modelica.Blocks.Sources.Constant ampl(k = 0.7);
  Modelica.Blocks.Sources.Constant phase(k = 0);
  PwmPulser pwmPulser;
  Modelica.Electrical.Analog.Ideal.IdealClosingSwitch SWd;
  Modelica.Electrical.Analog.Ideal.IdealClosingSwitch SWu;
  Modelica.Electrical.Analog.Basic.Resistor Load(R = 30);
  Modelica.Electrical.Analog.Basic.Capacitor Cf(C = 634e-6);
  Modelica.Electrical.Analog.Sensors.PotentialSensor potentialSensor;
  Modelica.Electrical.Analog.Basic.Ground ground;
  Modelica.Electrical.Analog.Basic.Inductor Lf(L = 0.001);
  Modelica.Electrical.Analog.Basic.Resistor Rf(R = 0.125);
  Modelica.Blocks.Math.Mean mean1(f = 1000);
  EHPowerTrain.SupportModels.Batt1 batt(SOCInit = 0.9, QCellNom = 50 * 3600.0, ns = 100, np = 3);
  Modelica.Blocks.Sources.Constant ampl1(k = 0.7);
  Modelica.Blocks.Sources.Constant phase1(k = 0);
  PwmPulser pwmPulser1;
  Modelica.Electrical.Analog.Ideal.IdealClosingSwitch SWd1;
  Modelica.Electrical.Analog.Ideal.IdealClosingSwitch SWu1;
  Modelica.Electrical.Analog.Basic.Resistor Load1(R = 30);
  Modelica.Electrical.Analog.Basic.Capacitor Cf1(C = 634e-6);
  Modelica.Electrical.Analog.Sensors.PotentialSensor potentialSensor1;
  Modelica.Electrical.Analog.Basic.Inductor Lf1(L = 0.001);
  Modelica.Electrical.Analog.Basic.Resistor Rf1(R = 0.125);
  Modelica.Blocks.Math.Mean mean2(f = 1000);
  Modelica.Blocks.Sources.Constant ampl2(k = 0.7);
  Modelica.Blocks.Sources.Constant phase2(k = 0);
  PwmPulser pwmPulser2;
  Modelica.Electrical.Analog.Ideal.IdealClosingSwitch SWd2;
  Modelica.Electrical.Analog.Ideal.IdealClosingSwitch SWu2;
  Modelica.Electrical.Analog.Basic.Resistor Load2(R = 30);
  Modelica.Electrical.Analog.Basic.Capacitor Cf2(C = 634e-6);
  Modelica.Electrical.Analog.Sensors.PotentialSensor potentialSensor2;
  Modelica.Electrical.Analog.Basic.Inductor Lf2(L = 0.001);
  Modelica.Electrical.Analog.Basic.Resistor Rf2(R = 0.125);
  Modelica.Blocks.Math.Mean mean3(f = 1000);
  Modelica.Electrical.MultiPhase.Basic.PlugToPin_p plugToPin_p1(k = 1);
  Modelica.Electrical.MultiPhase.Basic.PlugToPin_p plugToPin_p2(k = 2);
  Modelica.Electrical.MultiPhase.Basic.PlugToPin_p plugToPin_p(k = 3);
  Modelica.Electrical.Machines.Sensors.CurrentQuasiRMSSensor currentQuasiRMSSensor1;
  Modelica.Electrical.Machines.BasicMachines.SynchronousInductionMachines.SM_PermanentMagnet
                                                                                             smpm(p = smpmData.p, fsNominal = smpmData.fsNominal, Rs = smpmData.Rs, TsRef = smpmData.TsRef, Lszero = smpmData.Lszero, Lssigma = smpmData.Lssigma, Jr = smpmData.Jr, Js = smpmData.Js, frictionParameters = smpmData.frictionParameters, phiMechanical(fixed = true), wMechanical(fixed = true), statorCoreParameters = smpmData.statorCoreParameters, strayLoadParameters = smpmData.strayLoadParameters, VsOpenCircuit = smpmData.VsOpenCircuit, Lmd = smpmData.Lmd, Lmq = smpmData.Lmq, useDamperCage = smpmData.useDamperCage, Lrsigmad = smpmData.Lrsigmad, Lrsigmaq = smpmData.Lrsigmaq, Rrd = smpmData.Rrd, Rrq = smpmData.Rrq, TrRef = smpmData.TrRef, permanentMagnetLossParameters = smpmData.permanentMagnetLossParameters, ir(fixed = true), TsOperational = 293.15, alpha20s = smpmData.alpha20s, TrOperational = 293.15, alpha20r = smpmData.alpha20r);
  Modelica.Electrical.Machines.Sensors.RotorDisplacementAngle rotorDisplacementAngle1(p = smpm.p);
  Modelica.Mechanics.Rotational.Components.Inertia loadInertia1(J = JLoad);
  Modelica.Mechanics.Rotational.Sources.TorqueStep loadTorqueStep1(startTime = tStep, stepTorque = -TLoad, useSupport = false, offsetTorque = 0);
  Modelica.Electrical.Machines.Utilities.TerminalBox terminalBox(terminalConnection = "Y");
  parameter
    Modelica.Electrical.Machines.Utilities.ParameterRecords.SM_PermanentMagnetData
                                                                                           smpmData;
  EHPowerTrain.SupportModels.Batt1 batt1_1;


equation
  connect(Rf.p, SWu.n);
  connect(terminalBox.plugSupply, currentQuasiRMSSensor1.plug_n);
  connect(terminalBox.plug_sp, smpm.plug_sp);
  connect(terminalBox.plug_sn, smpm.plug_sn);
  connect(loadInertia1.flange_b, loadTorqueStep1.flange);
  connect(smpm.flange, loadInertia1.flange_a);
  connect(smpm.flange, rotorDisplacementAngle1.flange);
  connect(rotorDisplacementAngle1.plug_p, smpm.plug_sp);
  connect(rotorDisplacementAngle1.plug_n, smpm.plug_sn);
  connect(potentialSensor.phi, mean1.u);
  connect(Lf.p, Rf.n);
  connect(Load.p, Lf.n);
  connect(Cf.p, Lf.n);
  connect(potentialSensor.p, Load.p);
  connect(SWu.n, SWd.p);
  connect(pwmPulser.Top, SWd.control);
  connect(pwmPulser.Bot, SWu.control);
  connect(ampl.y, pwmPulser.Ampl);
  connect(phase.y, pwmPulser.Ph_deg);
  connect(ground.p, batt.n);
  connect(SWu.p, batt.p);
  connect(batt.n, SWd.n);
  connect(potentialSensor1.phi, mean2.u);
  connect(Rf1.p, SWu1.n);
  connect(Lf1.p, Rf1.n);
  connect(Load1.p, Lf1.n);
  connect(Cf1.p, Lf1.n);
  connect(potentialSensor1.p, Load1.p);
  connect(SWu1.n, SWd1.p);
  connect(pwmPulser1.Top, SWd1.control);
  connect(pwmPulser1.Bot, SWu1.control);
  connect(ampl1.y, pwmPulser1.Ampl);
  connect(phase1.y, pwmPulser1.Ph_deg);
  connect(SWu1.p, batt.p);
  connect(SWd1.n, SWd.n);
  connect(potentialSensor2.phi, mean3.u);
  connect(Rf2.p, SWu2.n);
  connect(Lf2.p, Rf2.n);
  connect(Load2.p, Lf2.n);
  connect(Cf2.p, Lf2.n);
  connect(potentialSensor2.p, Load2.p);
  connect(SWu2.n, SWd2.p);
  connect(pwmPulser2.Top, SWd2.control);
  connect(pwmPulser2.Bot, SWu2.control);
  connect(ampl2.y, pwmPulser2.Ampl);
  connect(phase2.y, pwmPulser2.Ph_deg);
  connect(SWd2.n, SWd.n);
  connect(SWu2.p, batt.p);
  connect(Load.n, plugToPin_p1.pin_p);
  connect(Cf.n, plugToPin_p1.pin_p);
  connect(Load1.n, plugToPin_p2.pin_p);
  connect(plugToPin_p2.pin_p, Cf1.n);
  connect(Cf2.n, plugToPin_p.pin_p);
  connect(plugToPin_p.pin_p, Load2.n);
  connect(currentQuasiRMSSensor1.plug_p, plugToPin_p.plug_p);
  connect(plugToPin_p2.plug_p, currentQuasiRMSSensor1.plug_p);
  connect(plugToPin_p1.plug_p, currentQuasiRMSSensor1.plug_p);

end IdThreeLegs_battery_motore3

Edited by: claudio34 - Nov-28-15 16:45:18

Re: Non-array modification 'true' for array component, possibly due to mis

I understand but the problem in modelica is find the array that have no "each" inizialization

There are 0 guests and 0 other users also viewing this topic
You are here: