Wednesday, 15 April 2015

Modelica Programming: fixed constraint in 'for loop' -- for Multistage Constant Current Battery Charging -



Modelica Programming: fixed constraint in 'for loop' -- for Multistage Constant Current Battery Charging -

i want perform multistage constant current battery charging in modelica.

could help me? in advance.

model batterycharge constant real voltage0 = 3; parameter real current_vec[5] = {0.01,0.005,0.004,0.003,0.002}; real voltage; real current; // integer k; // algorithm // k := 1; // current := current_vec[k]; // voltage := voltage0 + current * time; // // if voltage > 4 // k := k+1; // end if; algorithm k in 1:5 loop current := current_vec[k]; voltage := voltage0 + current * time; if voltage > 4 break; end if; end for; end batterycharge

i need help.

pls not inquire me in matlab since 1 simple case of part of programming code.

it looks mixing units of current, voltage , time. so, not clear trying accomplish. however, if trying generate voltage function of time, utilize modelica.blocks.sources.timetable give voltage.

for-loop constraints modelica

No comments:

Post a Comment