openmodelica - Modelica vector parameters from a file -


is possible read vector of parameters file? i'm trying create vector of objects, such shown here: enter link description here starting on page 49. however, pull specific resistance , capacitance values text file. (i'm using example how read in).
so, example fills in data this:

a.basic.resistor  r[n + 1](r = vector([re/2; fill(re,n-1); re/2]) ); a.basic.capacitor c[n](each c = c*l/n); 

but, instead have text file contains like, first column index, second r values , third c values:

#1 double test1(4,3)   #first set of data (row col) 1.0 1.0 10.0 2.0 2.0 30.0 3.0 5.0 50.0 4.0 7.0 100.0 

i know can read data in using combitable1d or combitable2d. but, there way convert each column of data vector can analogous to:

readintablefromdisk a.basic.resistor  r[n + 1](r = firstdatacolumnofdataondisk ); a.basic.capacitor c[n](each c = seconddatacolumnofdataondisk); 

i recommend externdata library if want load external data files modelica tool.

modelica library data i/o of ini, json, xml, matlab mat , excel xls/xlsx files


Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -