Skip to content

Commit

Permalink
[iss-211]
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit b08d6e9
Author: joaquin.f.fernandez <joaquin.f.fernandez@gmail.com>
Date:   Mon Apr 24 15:18:42 2023 -0300

    Updated mmoc tests GT files.

commit ea88f01
Merge: c76b250 5c74c62
Author: joaquin.f.fernandez <joaquin.f.fernandez@gmail.com>
Date:   Thu Apr 20 12:17:33 2023 -0300

    Merge branch 'qss-solver-dev' into mmoc/iss-211-fix-double-expression-printer-in-integer-divisions

commit c76b250
Author: joaquin.f.fernandez <joaquin.f.fernandez@gmail.com>
Date:   Thu Apr 20 11:48:16 2023 -0300

    Check for interger divisions and cast them to double in printer.

commit 4fa29df
Author: joaquin.f.fernandez <joaquin.f.fernandez@gmail.com>
Date:   Thu Apr 20 11:47:23 2023 -0300

    Check for constant integer expressions in visitor.
  • Loading branch information
joaquinffernandez committed Apr 24, 2023
1 parent 7608959 commit dce9d5e
Show file tree
Hide file tree
Showing 26 changed files with 194 additions and 179 deletions.
36 changes: 18 additions & 18 deletions src/mmoc/tests/system/gt_data/NeuralNetwork1/NeuralNetwork1.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,38 +236,38 @@ void QSS_initializeDataStructs(QSS_simulator simulator)
int i;
int j;
int k;
_Cm = 2.5e-10;
_EL = -0.065;
_Jmean = (8.78e-11)/1;
_Ne = 0.8*100;
_Ni = 0.2*100;
_Vr = -0.065;
_Cm = 2.500000e-10;
_EL = -6.500000e-02;
_Jmean = (8.780000e-11)/(double)1;
_Ne = 8.000000e-01*100;
_Ni = 2.000000e-01*100;
_Vr = -6.500000e-02;
for(_d1 = 1; _d1<=100; _d1+=1) {
_active(_d1) = 1;
}
_cI = 1e+09;
_cV = 1000;
_ce = 10*0.8;
_ci = 10*0.2;
_cI = 1.000000e+09;
_cV = 1.000000e+03;
_ce = 10*8.000000e-01;
_ci = 10*2.000000e-01;
_g = 4;
_kext = 940;
_taum = 0.01;
_taur = 0.002;
_taus = 0.0005;
_theta = -0.05;
_taum = 1.000000e-02;
_taur = 2.000000e-03;
_taus = 5.000000e-04;
_theta = -5.000000e-02;
for(_d1 = 1; _d1<=100; _d1+=1) {
_tnextr(_d1) = -1;
}
_vbg = 8;
_vext = _vbg*_kext;
for(i = 1; i<=100; i+=1) {
_Islast(i) = __math__rand(1)*1e-10*_cI+0.4;
_Islast(i) = __math__rand(1)*1.000000e-10*_cI+4.000000e-01;
_init_V(i,0) = __math__rand(15)-65;
_Cn(i) = 0;
if(i<100*0.8) {
_J(i) = (_Jmean+__math__normal(_Jmean*0.1/3));
if(i<100*8.000000e-01) {
_J(i) = (_Jmean+__math__normal(_Jmean*1.000000e-01/(double)3));
} else {
_J(i) = -(_Jmean*_g+__math__normal(_Jmean*_g*0.1/3));
_J(i) = -(_Jmean*_g+__math__normal(_Jmean*_g*1.000000e-01/(double)3));
}
_tnext(i) = __math__exponential(1/_vext);
}
Expand Down
6 changes: 3 additions & 3 deletions src/mmoc/tests/system/gt_data/adr/adr.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,14 @@ void QSS_initializeDataStructs(QSS_simulator simulator)
int i;
_L = 10;
_a = 1;
_dx = _L/1000;
_dx = _L/(double)1000;
_dx2 = pow(_dx,2);
_r = 1000;
for(i = 500; i<=1000; i+=1) {
_d(i) = 10;
_d(i) = 1.000000e+01;
}
for(i = 1; i<=499; i+=1) {
_d(i) = 1e-06;
_d(i) = 1.000000e-06;
}
modelData->nSD[_idx_u(1,0)]++;
modelData->nSD[_idx_u(1000,0)]++;
Expand Down
2 changes: 1 addition & 1 deletion src/mmoc/tests/system/gt_data/adr/adr.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ derdelta=1.00000e-08;
symdiff=1;
lps=0;
nodesize=10000;
jacobian=1;
jacobian=0;
it=0.00000e+00;
ft=1.00000e+01;
sol="LIQSS_BDF";
Expand Down
2 changes: 1 addition & 1 deletion src/mmoc/tests/system/gt_data/adr/adr.mo
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ equation
MMO_PartitionMethod=Metis,
MMO_Output={u[750]},
MMO_OutputType=CI_Sampled,
Jacobian=Dense,
Jacobian=Sparse,
MMO_BDF_Part={u[N/2:N]},
MMO_BDF_PDepth=1,
MMO_BDF_Max_Step=0,
Expand Down
2 changes: 1 addition & 1 deletion src/mmoc/tests/system/gt_data/advection/advection.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ void QSS_initializeDataStructs(QSS_simulator simulator)
int _rg_d1;
int i;
int j;
_alpha = 0.5;
_alpha = 5.000000e-01;
_mu = 1000;
for(i = 1; i<=6666; i+=1) {
_init_u(i,0) = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ void QSS_initializeDataStructs(QSS_simulator simulator)
int _rg_d1;
int i;
int j;
_alpha = 0.5;
_alpha = 5.000000e-01;
_mu = 1000;
for(i = 1; i<=6666; i+=1) {
_init_u_a(i,0) = 1;
Expand Down
8 changes: 4 additions & 4 deletions src/mmoc/tests/system/gt_data/airconds/airconds.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void MOD_zeroCrossing(int idx, double *x, double *d, double *a, double t, double
_get_event_1_idxs(idx);
_apply_usage_event_1(_d1);
if ((i >= 1 && i <= 20000)) {
_zc(0) = _th(i,0)-_tref(i)+_on(i)-0.5-(0);
_zc(0) = _th(i,0)-_tref(i)+_on(i)-5.000000e-01-(0);
_zc(1) = (0)/1;
_zc(2) = (0)/2;

Expand Down Expand Up @@ -102,7 +102,7 @@ void MOD_handlerPos(int idx, double *x, double* q, double *d, double *a, double
_get_event_2_idxs(idx);
_apply_usage_event_2(_d1);
if ((i >= 1 && i <= 20000)) {
_tref(i) = 20.5;
_tref(i) = 2.050000e+01;
}
return;
}
Expand Down Expand Up @@ -240,15 +240,15 @@ void QSS_initializeDataStructs(QSS_simulator simulator)
for(i = 1; i<=20000; i+=1) {
_init_th(i,0) = 4+18;
_CAP(i) = 100+550;
_RES(i) = 0.4+1.8;
_RES(i) = 4.000000e-01+1.800000e+00;
_POT(i) = 2+13;
_pmax = _pmax+_POT(i);
_nextSample(i) = 1;
_noise(i) = 2-1;
_tref(i) = 20;
}
for(i = 1; i<=20000; i+=1) {
if(_init_th(i,0)-_tref(i)-0.5>0) {
if(_init_th(i,0)-_tref(i)-5.000000e-01>0) {
_on(i) = 1;
_ptotal = _ptotal+_POT(i);
} else if(_init_th(i,0)-_tref(i)<0) {
Expand Down
14 changes: 7 additions & 7 deletions src/mmoc/tests/system/gt_data/aircont/aircont.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void MOD_zeroCrossing(int idx, double *x, double *d, double *a, double t, double
_get_event_1_idxs(idx);
_apply_usage_event_1(_d1);
if ((i >= 1 && i <= 200)) {
_zc = _th(i)-_tref-_dtref+_on(i)-0.5-(0);
_zc = _th(i)-_tref-_dtref+_on(i)-5.000000e-01-(0);


}
Expand All @@ -70,11 +70,11 @@ void MOD_handlerPos(int idx, double *x, double *d, double *a, double t)
int i;
switch(idx) {
case _eval_event_2: {
_pref = 0.4;
_pref = 4.000000e-01;
return;
}
case _eval_event_3: {
_pref = 0.5;
_pref = 5.000000e-01;
return;
}
case _eval_event_4: {
Expand Down Expand Up @@ -182,17 +182,17 @@ void CLC_initializeDataStructs(CLC_simulator simulator)
_nextSample = 1;
_noise = 2-1;
_pmax = 0;
_pref = 0.5;
_pref = 5.000000e-01;
_tref = 20;
for(i = 1; i<=200; i+=1) {
_init_th(i) = 4+18;
_CAP(i) = 100+550;
_RES(i) = 0.4+1.8;
_POT(i) = 0.2+13;
_RES(i) = 4.000000e-01+1.800000e+00;
_POT(i) = 2.000000e-01+13;
_pmax = _pmax+_POT(i);
}
for(i = 1; i<=200; i+=1) {
if(_init_th(i)-_tref-0.5>0) {
if(_init_th(i)-_tref-5.000000e-01>0) {
_on(i) = 1;
_ptotal = _ptotal+_POT(i);
}
Expand Down
20 changes: 10 additions & 10 deletions src/mmoc/tests/system/gt_data/bball_downstairs/bball_downstairs.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void MOD_definition(int idx, double *x, double *d, double *a, double t, double *
return;
}
case _eval_vy(0): {
_der_vy(0) = -9.8-0.1*_vy(0)-_contact*((_y(0)-_stair)*1e+06+_vy(0)*30);
_der_vy(0) = -9.800000e+00-1.000000e-01*_vy(0)-_contact*((_y(0)-_stair)*1.000000e+06+_vy(0)*30);
_der_vy(1) = (0)/2;
_der_vy(2) = (0)/6;

Expand All @@ -43,7 +43,7 @@ void MOD_definition(int idx, double *x, double *d, double *a, double t, double *
return;
}
case _eval_vx(0): {
_der_vx(0) = -0.1*_vx(0);
_der_vx(0) = -1.000000e-01*_vx(0);
_der_vx(1) = (0)/2;
_der_vx(2) = (0)/6;

Expand Down Expand Up @@ -182,7 +182,7 @@ void MOD_dependencies(int idx, double *x, double *d, double *a, double t, double
_eval_dep_x(1) = _vx(0);
_eval_dep_x(2) = (0)/2;
_eval_dep_x(3) = (0)/6;
_eval_dep_vx(1) = -0.1*_vx(0);
_eval_dep_vx(1) = -1.000000e-01*_vx(0);
_eval_dep_vx(2) = (0)/2;
_eval_dep_vx(3) = (0)/6;
break;
Expand All @@ -191,13 +191,13 @@ void MOD_dependencies(int idx, double *x, double *d, double *a, double t, double
_eval_dep_y(1) = _vy(0);
_eval_dep_y(2) = (0)/2;
_eval_dep_y(3) = (0)/6;
_eval_dep_vy(1) = -9.8-0.1*_vy(0)-_contact*((_y(0)-_stair)*1e+06+_vy(0)*30);
_eval_dep_vy(1) = -9.800000e+00-1.000000e-01*_vy(0)-_contact*((_y(0)-_stair)*1.000000e+06+_vy(0)*30);
_eval_dep_vy(2) = (0)/2;
_eval_dep_vy(3) = (0)/6;
break;
}
case _eval_y(0): {
_eval_dep_vy(1) = -9.8-0.1*_vy(0)-_contact*((_y(0)-_stair)*1e+06+_vy(0)*30);
_eval_dep_vy(1) = -9.800000e+00-1.000000e-01*_vy(0)-_contact*((_y(0)-_stair)*1.000000e+06+_vy(0)*30);
_eval_dep_vy(2) = (0)/2;
_eval_dep_vy(3) = (0)/6;
break;
Expand All @@ -219,7 +219,7 @@ void MOD_BDF_definition(double *x, double *d, double *a, double t, double *dx, i
continue;
}
case _eval_vy(0): {
_eval_dep_vy(1) = -9.8-0.1*_vy(0)-_contact*((_y(0)-_stair)*1e+06+_vy(0)*30);
_eval_dep_vy(1) = -9.800000e+00-1.000000e-01*_vy(0)-_contact*((_y(0)-_stair)*1.000000e+06+_vy(0)*30);


continue;
Expand All @@ -231,7 +231,7 @@ void MOD_BDF_definition(double *x, double *d, double *a, double t, double *dx, i
continue;
}
case _eval_vx(0): {
_eval_dep_vx(1) = -0.1*_vx(0);
_eval_dep_vx(1) = -1.000000e-01*_vx(0);


continue;
Expand All @@ -252,9 +252,9 @@ void QSS_initializeDataStructs(QSS_simulator simulator)
int row, eq_var, c_row;
int x_ind;
_stair = 10;
_init_vx(0) = 0.5;
_init_x(0) = 0.575;
_init_y(0) = 10.5;
_init_vx(0) = 5.000000e-01;
_init_x(0) = 5.750000e-01;
_init_y(0) = 1.050000e+01;
modelData->nSD[_idx_vx(0)]++;
modelData->nSD[_idx_vx(0)]++;
modelData->nSD[_idx_vy(0)]++;
Expand Down
18 changes: 9 additions & 9 deletions src/mmoc/tests/system/gt_data/boost/boost.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void MOD_zeroCrossing(int idx, double *x, double *d, double *a, double t, double
_iD(1) = 0;
_s(0) = _diodeon*_iD(0)+(1-_diodeon)*_iD(0)*_Rd;
_s(1) = 0;
_zc(0) = _s(0)-(0.6);
_zc(0) = _s(0)-(6.000000e-01);
_zc(1) = (0)/1;

return;
Expand Down Expand Up @@ -256,15 +256,15 @@ void QSS_initializeDataStructs(QSS_simulator simulator)
int* outputs = (int*) malloc(2*sizeof(int));
int row, eq_var, c_row;
int x_ind;
_C = 0.0001;
_DC = 0.5;
_L = 0.0001;
_C = 1.000000e-04;
_DC = 5.000000e-01;
_L = 1.000000e-04;
_R = 10;
_ROff = 100000;
_ROn = 1e-05;
_Rd = 100000;
_Rs = 1e-05;
_T = 0.0001;
_ROff = 1.000000e+05;
_ROn = 1.000000e-05;
_Rd = 1.000000e+05;
_Rs = 1.000000e-05;
_T = 1.000000e-04;
_U = 24;
_nextT = _T;
modelData->nSD[_idx_iL(0)]++;
Expand Down
16 changes: 8 additions & 8 deletions src/mmoc/tests/system/gt_data/buck/buck.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,15 @@ void QSS_initializeDataStructs(QSS_simulator simulator)
int* outputs = (int*) malloc(2*sizeof(int));
int row, eq_var, c_row;
int x_ind;
_C = 0.0001;
_DC = 0.5;
_L = 0.0001;
_C = 1.000000e-04;
_DC = 5.000000e-01;
_L = 1.000000e-04;
_R = 10;
_ROff = 100000;
_ROn = 1e-05;
_Rd = 100000;
_Rs = 1e-05;
_T = 0.0001;
_ROff = 1.000000e+05;
_ROn = 1.000000e-05;
_Rd = 1.000000e+05;
_Rs = 1.000000e-05;
_T = 1.000000e-04;
_U = 24;
_nextT = _T;
modelData->nSD[_idx_iL(0)]++;
Expand Down
16 changes: 8 additions & 8 deletions src/mmoc/tests/system/gt_data/buck_circuit/buck_circuit.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,19 +201,19 @@ void QSS_initializeDataStructs(QSS_simulator simulator)
int* outputs = (int*) malloc(2*sizeof(int));
int row, eq_var, c_row;
int x_ind;
_C = 0.0001;
_DC = 0.5;
_L = 0.0001;
_C = 1.000000e-04;
_DC = 5.000000e-01;
_L = 1.000000e-04;
_R = 10;
_ROff = 100000;
_ROn = 1e-05;
_T = 0.0001;
_ROff = 1.000000e+05;
_ROn = 1.000000e-05;
_T = 1.000000e-04;
_U = 24;
_nextT = _T;
_lastT = 0;
_init_uC(0) = 0;
_Rs = 100000;
_Rd = 100000;
_Rs = 1.000000e+05;
_Rd = 1.000000e+05;
_init_iL(0) = 0;
modelData->nSD[_idx_iL(0)]++;
modelData->nSD[_idx_iL(0)]++;
Expand Down
Loading

0 comments on commit dce9d5e

Please sign in to comment.