Modifiying the scs_m (Clock block period) requires recompilation of the cpr (Info),
so it was not safe to use the same Info variable.
Also, used the context to update that value,
instead of looking for it in the scs_m through loops.
In the diagrams, removed the unnecessary Scope blocks and recalibrated the buffer sizes
to match the minimal number of steps (final time / highest clock period).
Also, cleaned the contexts from unused variable L.
Change-Id: Ieeadd9f9c00f2e42273a3b12fb99e2e67e93e133
disp(msg);
endfunction
funcprot(prot);
-Info = scicos_simulate(scs_m, list(), 'nw');
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 50 50 50 50
+Info = scicos_simulate(scs_m, list());
--------------------------------------------\
- Main Modelica : TMPDIR/DDaskr_test2_im.mo
+ Main Modelica : TMPDIR/DDaskr_Bouncing_test_im.mo
- Flat Modelica : TMPDIR/DDaskr_test2_imf.mo
- Simulation C code :TMPDIR/DDaskr_test2_im.c
+ Flat Modelica : TMPDIR/DDaskr_Bouncing_test_imf.mo
+ Simulation C code :TMPDIR/DDaskr_Bouncing_test_im.c
!Modelica blocks are reduced to a block with: !
! !
! !
!Number of inputs : 0 !
! !
-!Number of outputs: 3 !
+!Number of outputs: 1 !
! !
!Input/output dependency:[T] !
! !
Generate a loader file
Generate a Makefile
ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy DDaskr_test2_im.c to TMPDIR
+ ilib_gen_Make: Copy DDaskr_Bouncing_test_im.c to TMPDIR
ilib_gen_Make: configure : Generate Makefile.
ilib_gen_Make: Modification of the Makefile in TMPDIR.
Running the Makefile
Generate a cleaner file
Shared archive loaded.
Link done.
-// looking for the CLOCK_f/EVTDLY_f to update period
-for path_1=1:length(scs_m.objs)
- if typeof(scs_m.objs(path_1))=="Block" & scs_m.objs(path_1).gui=="CLOCK_f" then
- CLOCK_f_scs_m = scs_m.objs(path_1).model.rpar;
- break;
- end
-end
-for path_2=1:length(CLOCK_f_scs_m)
- if typeof(CLOCK_f_scs_m.objs(path_2))=="Block" & CLOCK_f_scs_m.objs(path_2).gui=="EVTDLY_f" then
- EVTDLY_f_blk = CLOCK_f_scs_m.objs(path_2);
- break;
- end
-end
-// Start by updating the clock block period (sampling)
-scs_m.objs(path_1).model.rpar.objs(path_2).graphics.exprs = [string(5*(10^-3));"0"];
// Modify solver + run DDaskr + save results
-scs_m.props.tol(6) = 102; // Solver
-//scs_m.props.tol(1) = 1.0e-10; // abstol
-//scs_m.props.tol(2) = 1.0e-10; // reltol
-scicos_simulate(scs_m, Info, 'nw'); // DDaskr
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 50 50 50 50
+scs_m.props.tol(6) = 102; // Solver
+scicos_simulate(scs_m, Info); // DDaskr
Warning : redefining function: dst . Use funcprot(0) to avoid this message
ddaskrval = res.values; // Results
time = res.time; // Time
// Modify solver + run IDA + save results
-scs_m.props.tol(6) = 100; // Solver
-scicos_simulate(scs_m, Info, 'nw'); // IDA
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 50 50 50 50
+scs_m.props.tol(6) = 100; // Solver
+scicos_simulate(scs_m, Info); // IDA
Warning : redefining function: dst . Use funcprot(0) to avoid this message
-idaval = res.values; // Results
+idaval = res.values; // Results
// Compare results
compa = abs(ddaskrval-idaval);
// Extract mean, standard deviation, maximum
[maxi, indexMaxi] = max(compa);
stdeviation = st_deviation(compa);
// Verifying closeness of the results
-assert_checktrue(maxi <= 10^-(4));
-assert_checktrue(mea <= 10^-(4));
-assert_checktrue(stdeviation <= 10^-(4));
+assert_checktrue(maxi <= 5*10^-(5));
+assert_checktrue(mea <= 5*10^-(5));
+assert_checktrue(stdeviation <= 5*10^-(5));
disp(msg);
endfunction
funcprot(prot);
-Info = scicos_simulate(scs_m, list(), 'nw');
-
-// looking for the CLOCK_f/EVTDLY_f to update period
-for path_1=1:length(scs_m.objs)
- if typeof(scs_m.objs(path_1))=="Block" & scs_m.objs(path_1).gui=="CLOCK_f" then
- CLOCK_f_scs_m = scs_m.objs(path_1).model.rpar;
- break;
- end
-end
-for path_2=1:length(CLOCK_f_scs_m)
- if typeof(CLOCK_f_scs_m.objs(path_2))=="Block" & CLOCK_f_scs_m.objs(path_2).gui=="EVTDLY_f" then
- EVTDLY_f_blk = CLOCK_f_scs_m.objs(path_2);
- break;
- end
-end
-
-// Start by updating the clock block period (sampling)
-scs_m.objs(path_1).model.rpar.objs(path_2).graphics.exprs = [string(5*(10^-3));"0"];
+Info = scicos_simulate(scs_m, list());
// Modify solver + run DDaskr + save results
-scs_m.props.tol(6) = 102; // Solver
-//scs_m.props.tol(1) = 1.0e-10; // abstol
-//scs_m.props.tol(2) = 1.0e-10; // reltol
-scicos_simulate(scs_m, Info, 'nw'); // DDaskr
+scs_m.props.tol(6) = 102; // Solver
+scicos_simulate(scs_m, Info); // DDaskr
ddaskrval = res.values; // Results
time = res.time; // Time
// Modify solver + run IDA + save results
-scs_m.props.tol(6) = 100; // Solver
-scicos_simulate(scs_m, Info, 'nw'); // IDA
-idaval = res.values; // Results
+scs_m.props.tol(6) = 100; // Solver
+scicos_simulate(scs_m, Info); // IDA
+idaval = res.values; // Results
// Compare results
compa = abs(ddaskrval-idaval);
stdeviation = st_deviation(compa);
// Verifying closeness of the results
-assert_checktrue(maxi <= 10^-(4));
-assert_checktrue(mea <= 10^-(4));
-assert_checktrue(stdeviation <= 10^-(4));
+assert_checktrue(maxi <= 5*10^-(5));
+assert_checktrue(mea <= 5*10^-(5));
+assert_checktrue(stdeviation <= 5*10^-(5));
disp(msg);
endfunction
funcprot(prot);
-Info = scicos_simulate(scs_m, list(), 'nw');
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 50 50 50 50
+// Modify solver + run DDaskr + save results
+scs_m.props.tol(6) = 102; // Solver
+scicos_simulate(scs_m); // DDaskr
--------------------------------------------\
Main Modelica : TMPDIR/DDaskr_Hydraulics_test_im.mo
! !
!Number of inputs : 1 !
! !
-!Number of outputs: 2 !
+!Number of outputs: 1 !
! !
!Input/output dependency:[F] !
! !
Generate a cleaner file
Shared archive loaded.
Link done.
-// looking for the CLOCK_f/EVTDLY_f to update period
-for path_1=1:length(scs_m.objs)
- if typeof(scs_m.objs(path_1))=="Block" & scs_m.objs(path_1).gui=="CLOCK_f" then
- CLOCK_f_scs_m = scs_m.objs(path_1).model.rpar;
- break;
- end
-end
-for path_2=1:length(CLOCK_f_scs_m)
- if typeof(CLOCK_f_scs_m.objs(path_2))=="Block" & CLOCK_f_scs_m.objs(path_2).gui=="EVTDLY_f" then
- EVTDLY_f_blk = CLOCK_f_scs_m.objs(path_2);
- break;
- end
-end
-// Start by updating the clock block period (sampling)
-scs_m.objs(path_1).model.rpar.objs(path_2).graphics.exprs = [string(5*(10^-3));"0"];
-// Modify solver + run DDaskr + save results
-scs_m.props.tol(6) = 102; // Solver
-//scs_m.props.tol(1) = 1.0e-10; // abstol
-//scs_m.props.tol(2) = 1.0e-10; // reltol
-scicos_simulate(scs_m, Info, 'nw'); // DDaskr
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 50 50 50 50
-Warning : redefining function: dst . Use funcprot(0) to avoid this message
-
ddaskrval = res.values; // Results
time = res.time; // Time
// Modify solver + run IDA + save results
-scs_m.props.tol(6) = 100; // Solver
-scicos_simulate(scs_m, Info, 'nw'); // IDA
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 50 50 50 50
-Warning : redefining function: dst . Use funcprot(0) to avoid this message
+scs_m.props.tol(6) = 100; // Solver
+scicos_simulate(scs_m); // IDA
+--------------------------------------------\
+ Main Modelica : TMPDIR/DDaskr_Hydraulics_test_im.mo
-idaval = res.values; // Results
+ Flat Modelica : TMPDIR/DDaskr_Hydraulics_test_imf.mo
+ Simulation C code :TMPDIR/DDaskr_Hydraulics_test_im.c
+
+!Modelica blocks are reduced to a block with: !
+! !
+!Number of differential states: 2 !
+! !
+!Number of algebraic states: 5 !
+! !
+!Number of discrete time states : 0 !
+! !
+!Number of zero-crossing surfaces: 19 !
+! !
+!Number of modes : 19 !
+! !
+!Number of inputs : 1 !
+! !
+!Number of outputs: 1 !
+! !
+!Input/output dependency:[F] !
+! !
+!Analytical Jacobian: enabled (%Jacobian=%t) !
+! !
+!Parameter embedding mode: enabled (%Modelica_ParEmb=%t) !
+! !
+! !
+! !
+!Generated files path: TMPDIR/ !
+! !
+! !
+ Generate a loader file
+ Generate a Makefile
+ ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
+ ilib_gen_Make: Copy DDaskr_Hydraulics_test_im.c to TMPDIR
+ ilib_gen_Make: configure : Generate Makefile.
+ ilib_gen_Make: Modification of the Makefile in TMPDIR.
+ Running the Makefile
+ Generate a cleaner file
+Shared archive loaded.
+Link done.
+idaval = res.values; // Results
// Compare results
compa = abs(ddaskrval-idaval);
// Extract mean, standard deviation, maximum
[maxi, indexMaxi] = max(compa);
stdeviation = st_deviation(compa);
// Verifying closeness of the results
-assert_checktrue(maxi <= 10^-(7));
-assert_checktrue(mea <= 10^-(7));
-assert_checktrue(stdeviation <= 10^-(7));
+assert_checktrue(maxi <= 2*10^-(6));
+assert_checktrue(mea <= 2*10^-(6));
+assert_checktrue(stdeviation <= 2*10^-(6));
disp(msg);
endfunction
funcprot(prot);
-Info = scicos_simulate(scs_m, list(), 'nw');
-
-// looking for the CLOCK_f/EVTDLY_f to update period
-for path_1=1:length(scs_m.objs)
- if typeof(scs_m.objs(path_1))=="Block" & scs_m.objs(path_1).gui=="CLOCK_f" then
- CLOCK_f_scs_m = scs_m.objs(path_1).model.rpar;
- break;
- end
-end
-for path_2=1:length(CLOCK_f_scs_m)
- if typeof(CLOCK_f_scs_m.objs(path_2))=="Block" & CLOCK_f_scs_m.objs(path_2).gui=="EVTDLY_f" then
- EVTDLY_f_blk = CLOCK_f_scs_m.objs(path_2);
- break;
- end
-end
-
-// Start by updating the clock block period (sampling)
-scs_m.objs(path_1).model.rpar.objs(path_2).graphics.exprs = [string(5*(10^-3));"0"];
// Modify solver + run DDaskr + save results
scs_m.props.tol(6) = 102; // Solver
-//scs_m.props.tol(1) = 1.0e-10; // abstol
-//scs_m.props.tol(2) = 1.0e-10; // reltol
-scicos_simulate(scs_m, Info, 'nw'); // DDaskr
+scicos_simulate(scs_m); // DDaskr
ddaskrval = res.values; // Results
time = res.time; // Time
// Modify solver + run IDA + save results
-scs_m.props.tol(6) = 100; // Solver
-scicos_simulate(scs_m, Info, 'nw'); // IDA
-idaval = res.values; // Results
+scs_m.props.tol(6) = 100; // Solver
+scicos_simulate(scs_m); // IDA
+idaval = res.values; // Results
// Compare results
compa = abs(ddaskrval-idaval);
stdeviation = st_deviation(compa);
// Verifying closeness of the results
-assert_checktrue(maxi <= 10^-(7));
-assert_checktrue(mea <= 10^-(7));
-assert_checktrue(stdeviation <= 10^-(7));
+assert_checktrue(maxi <= 2*10^-(6));
+assert_checktrue(mea <= 2*10^-(6));
+assert_checktrue(stdeviation <= 2*10^-(6));
disp(msg);
endfunction
funcprot(prot);
-Info = scicos_simulate(scs_m, list(),'nw');
+Info = scicos_simulate(scs_m, list());
--------------------------------------------\
Main Modelica : TMPDIR/DDaskr_Platform_test_im.mo
! !
!Number of inputs : 0 !
! !
-!Number of outputs: 3 !
+!Number of outputs: 1 !
! !
!Input/output dependency:[T] !
! !
! !
! !
! !
-!Generated files path: TMPDIR/ !
+!Generated files path: TMPDIR/ !
! !
! !
Generate a loader file
Generate a cleaner file
Shared archive loaded.
Link done.
-// looking for the CLOCK_f/EVTDLY_f to update period
-for path_1=1:length(scs_m.objs)
- if typeof(scs_m.objs(path_1))=="Block" & scs_m.objs(path_1).gui=="CLOCK_c" then
- CLOCK_f_scs_m = scs_m.objs(path_1).model.rpar;
- break;
- end
-end
-for path_2=1:length(CLOCK_f_scs_m)
- if typeof(CLOCK_f_scs_m.objs(path_2))=="Block" & CLOCK_f_scs_m.objs(path_2).gui=="EVTDLY_c" then
- EVTDLY_f_blk = CLOCK_f_scs_m.objs(path_2);
- break;
- end
-end
for i=1:2 // 'max step size' = 10^-i, precision
// Start by updating the clock block period (sampling)
- scs_m.objs(path_1).model.rpar.objs(path_2).graphics.exprs = [string(5*(10^-i));"0"];
+ Context.per = 5*10^-i;
// Modify solver + run DDaskr + save results
scs_m.props.tol(6) = 102; // Solver
- scicos_simulate(scs_m, Info, 'nw'); // DDaskr
+ scicos_simulate(scs_m, Info, Context); // DDaskr
ddaskrval = res.values; // Results
time = res.time; // Time
// Modify solver + run IDA + save results
scs_m.props.tol(6) = 100; // Solver
- scicos_simulate(scs_m, Info, 'nw'); // IDA
+ scicos_simulate(scs_m, Info, Context); // IDA
idaval = res.values; // Results
// Compare results
compa = abs(ddaskrval-idaval);
// Extract mean, standard deviation, maximum
mea = mean(compa);
[maxi, indexMaxi] = max(compa);
+ maxi, mea
stdeviation = st_deviation(compa);
// Verifying closeness of the results
- assert_checktrue(maxi <= 10^-(i+1));
- assert_checktrue(mea <= 10^-(i+1));
- assert_checktrue(stdeviation <= 10^-(i+1));
+ assert_checktrue(maxi <= 5*10^-(i+2));
+ assert_checktrue(mea <= 5*10^-(i+2));
+ assert_checktrue(stdeviation <= 5*10^-(i+2));
end
Warning : redefining function: dst . Use funcprot(0) to avoid this message
Warning : redefining function: dst . Use funcprot(0) to avoid this message
+ maxi =
+
+ 0.0000197
+ mea =
+
+ 0.0000043
Warning : redefining function: dst . Use funcprot(0) to avoid this message
Warning : redefining function: dst . Use funcprot(0) to avoid this message
+ maxi =
+
+ 0.0002730
+ mea =
+
+ 0.0000455
disp(msg);
endfunction
funcprot(prot);
-Info = scicos_simulate(scs_m, list(),'nw');
-
-// looking for the CLOCK_f/EVTDLY_f to update period
-for path_1=1:length(scs_m.objs)
- if typeof(scs_m.objs(path_1))=="Block" & scs_m.objs(path_1).gui=="CLOCK_c" then
- CLOCK_f_scs_m = scs_m.objs(path_1).model.rpar;
- break;
- end
-end
-for path_2=1:length(CLOCK_f_scs_m)
- if typeof(CLOCK_f_scs_m.objs(path_2))=="Block" & CLOCK_f_scs_m.objs(path_2).gui=="EVTDLY_c" then
- EVTDLY_f_blk = CLOCK_f_scs_m.objs(path_2);
- break;
- end
-end
+Info = scicos_simulate(scs_m, list());
for i=1:2 // 'max step size' = 10^-i, precision
// Start by updating the clock block period (sampling)
- scs_m.objs(path_1).model.rpar.objs(path_2).graphics.exprs = [string(5*(10^-i));"0"];
+ Context.per = 5*10^-i;
// Modify solver + run DDaskr + save results
scs_m.props.tol(6) = 102; // Solver
- scicos_simulate(scs_m, Info, 'nw'); // DDaskr
+ scicos_simulate(scs_m, Info, Context); // DDaskr
ddaskrval = res.values; // Results
time = res.time; // Time
// Modify solver + run IDA + save results
scs_m.props.tol(6) = 100; // Solver
- scicos_simulate(scs_m, Info, 'nw'); // IDA
+ scicos_simulate(scs_m, Info, Context); // IDA
idaval = res.values; // Results
// Compare results
// Extract mean, standard deviation, maximum
mea = mean(compa);
[maxi, indexMaxi] = max(compa);
+ maxi, mea
stdeviation = st_deviation(compa);
// Verifying closeness of the results
- assert_checktrue(maxi <= 10^-(i+1));
- assert_checktrue(mea <= 10^-(i+1));
- assert_checktrue(stdeviation <= 10^-(i+1));
+ assert_checktrue(maxi <= 5*10^-(i+2));
+ assert_checktrue(mea <= 5*10^-(i+2));
+ assert_checktrue(stdeviation <= 5*10^-(i+2));
end
disp(msg);
endfunction
funcprot(prot);
-Info = scicos_simulate(scs_m, list(), 'nw');
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 2 2 2 2
+for i=2:3
+ // Start by updating the clock block period (sampling)
+ Context.per = 5*10^-i;
+ Info = scicos_simulate(scs_m, list(), Context);
+ // Modify solver + run DDaskr + save results
+ scs_m.props.tol(6) = 102; // Solver
+ scicos_simulate(scs_m, Info); // DDaskr
+ ddaskrval = res.values; // Results
+ time = res.time; // Time
+ // Modify solver + run IDA + save results
+ scs_m.props.tol(6) = 100; // Solver
+ scicos_simulate(scs_m, Info); // IDA
+ idaval = res.values; // Results
+ // Compare results
+ compa = abs(ddaskrval-idaval);
+ // Extract mean, standard deviation, maximum
+ mea = mean(compa);
+ [maxi, indexMaxi] = max(compa);
+ stdeviation = st_deviation(compa);
+ // Verifying closeness of the results
+ assert_checktrue(maxi <= 10^-(i+4));
+ assert_checktrue(mea <= 10^-(i+4));
+ assert_checktrue(stdeviation <= 10^-(i+4));
+end
--------------------------------------------\
Main Modelica : TMPDIR/DDaskr_RLC_test_im.mo
! !
!Number of inputs : 0 !
! !
-!Number of outputs: 3 !
+!Number of outputs: 1 !
! !
!Input/output dependency:[T] !
! !
Generate a cleaner file
Shared archive loaded.
Link done.
-// looking for the CLOCK_f/EVTDLY_f to update period
-for path_1=1:length(scs_m.objs)
- if typeof(scs_m.objs(path_1))=="Block" & scs_m.objs(path_1).gui=="CLOCK_f" then
- CLOCK_f_scs_m = scs_m.objs(path_1).model.rpar;
- break;
- end
-end
-for path_2=1:length(CLOCK_f_scs_m)
- if typeof(CLOCK_f_scs_m.objs(path_2))=="Block" & CLOCK_f_scs_m.objs(path_2).gui=="EVTDLY_f" then
- EVTDLY_f_blk = CLOCK_f_scs_m.objs(path_2);
- break;
- end
-end
-for i=2:3
- // Start by updating the clock block period (sampling)
- scs_m.objs(path_1).model.rpar.objs(path_2).graphics.exprs = [string(5*(10^-i));"0"];
- // Modify solver + run DDaskr + save results
- scs_m.props.tol(6) = 102; // Solver
- scicos_simulate(scs_m, Info, 'nw'); // DDaskr
- ddaskrval = res.values; // Results
- time = res.time; // Time
- // Modify solver + run IDA + save results
- scs_m.props.tol(6) = 100; // Solver
- scicos_simulate(scs_m, Info, 'nw'); // IDA
- idaval = res.values; // Results
- // Compare results
- compa = abs(ddaskrval-idaval);
- // Extract mean, standard deviation, maximum
- mea = mean(compa);
- [maxi, indexMaxi] = max(compa);
- stdeviation = st_deviation(compa);
- // Verifying closeness of the results
- assert_checktrue(maxi <= 10^-(i+3));
- assert_checktrue(mea <= 10^-(i+3));
- assert_checktrue(stdeviation <= 10^-(i+3));
-end
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 2 2 2 2
Warning : redefining function: dst . Use funcprot(0) to avoid this message
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 2 2 2 2
Warning : redefining function: dst . Use funcprot(0) to avoid this message
+--------------------------------------------\
+ Main Modelica : TMPDIR/DDaskr_RLC_test_im.mo
+
+ Flat Modelica : TMPDIR/DDaskr_RLC_test_imf.mo
+ Simulation C code :TMPDIR/DDaskr_RLC_test_im.c
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 2 2 2 2
+!Modelica blocks are reduced to a block with: !
+! !
+!Number of differential states: 2 !
+! !
+!Number of algebraic states: 1 !
+! !
+!Number of discrete time states : 0 !
+! !
+!Number of zero-crossing surfaces: 0 !
+! !
+!Number of modes : 0 !
+! !
+!Number of inputs : 0 !
+! !
+!Number of outputs: 1 !
+! !
+!Input/output dependency:[T] !
+! !
+!Analytical Jacobian: enabled (%Jacobian=%t) !
+! !
+!Parameter embedding mode: enabled (%Modelica_ParEmb=%t) !
+! !
+! !
+! !
+!Generated files path: TMPDIR/ !
+! !
+! !
+ Generate a loader file
+ Generate a Makefile
+ ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
+ ilib_gen_Make: Copy DDaskr_RLC_test_im.c to TMPDIR
+ ilib_gen_Make: configure : Generate Makefile.
+ ilib_gen_Make: Modification of the Makefile in TMPDIR.
+ Running the Makefile
+ Generate a cleaner file
+Shared archive loaded.
+Link done.
Warning : redefining function: dst . Use funcprot(0) to avoid this message
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 2 2 2 2
Warning : redefining function: dst . Use funcprot(0) to avoid this message
disp(msg);
endfunction
funcprot(prot);
-Info = scicos_simulate(scs_m, list(), 'nw');
-
-// looking for the CLOCK_f/EVTDLY_f to update period
-for path_1=1:length(scs_m.objs)
- if typeof(scs_m.objs(path_1))=="Block" & scs_m.objs(path_1).gui=="CLOCK_f" then
- CLOCK_f_scs_m = scs_m.objs(path_1).model.rpar;
- break;
- end
-end
-for path_2=1:length(CLOCK_f_scs_m)
- if typeof(CLOCK_f_scs_m.objs(path_2))=="Block" & CLOCK_f_scs_m.objs(path_2).gui=="EVTDLY_f" then
- EVTDLY_f_blk = CLOCK_f_scs_m.objs(path_2);
- break;
- end
-end
-
-
for i=2:3
// Start by updating the clock block period (sampling)
- scs_m.objs(path_1).model.rpar.objs(path_2).graphics.exprs = [string(5*(10^-i));"0"];
+ Context.per = 5*10^-i;
+ Info = scicos_simulate(scs_m, list(), Context);
// Modify solver + run DDaskr + save results
scs_m.props.tol(6) = 102; // Solver
- scicos_simulate(scs_m, Info, 'nw'); // DDaskr
- ddaskrval = res.values; // Results
- time = res.time; // Time
+ scicos_simulate(scs_m, Info); // DDaskr
+ ddaskrval = res.values; // Results
+ time = res.time; // Time
// Modify solver + run IDA + save results
scs_m.props.tol(6) = 100; // Solver
- scicos_simulate(scs_m, Info, 'nw'); // IDA
+ scicos_simulate(scs_m, Info); // IDA
idaval = res.values; // Results
// Compare results
stdeviation = st_deviation(compa);
// Verifying closeness of the results
- assert_checktrue(maxi <= 10^-(i+3));
- assert_checktrue(mea <= 10^-(i+3));
- assert_checktrue(stdeviation <= 10^-(i+3));
+ assert_checktrue(maxi <= 10^-(i+4));
+ assert_checktrue(mea <= 10^-(i+4));
+ assert_checktrue(stdeviation <= 10^-(i+4));
+
end
disp(msg);
endfunction
funcprot(prot);
-Info = scicos_simulate(scs_m, list(), 'nw');
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 50 50 50 50
+Info = scicos_simulate(scs_m, list());
--------------------------------------------\
- Main Modelica : TMPDIR/DDaskr_test2_im.mo
+ Main Modelica : TMPDIR/DDaskr_Bouncing_test_im.mo
- Flat Modelica : TMPDIR/DDaskr_test2_imf.mo
- Simulation C code :TMPDIR/DDaskr_test2_im.c
+ Flat Modelica : TMPDIR/DDaskr_Bouncing_test_imf.mo
+ Simulation C code :TMPDIR/DDaskr_Bouncing_test_im.c
!Modelica blocks are reduced to a block with: !
! !
! !
!Number of inputs : 0 !
! !
-!Number of outputs: 3 !
+!Number of outputs: 1 !
! !
!Input/output dependency:[T] !
! !
! !
! !
! !
-!Generated files path: TMPDIR/ !
+!Generated files path: TMPDIR/ !
! !
! !
Generate a loader file
Generate a Makefile
ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
- ilib_gen_Make: Copy DDaskr_test2_im.c to TMPDIR
+ ilib_gen_Make: Copy DDaskr_Bouncing_test_im.c to TMPDIR
ilib_gen_Make: configure : Generate Makefile.
ilib_gen_Make: Modification of the Makefile in TMPDIR.
Running the Makefile
Generate a cleaner file
Shared archive loaded.
Link done.
-// looking for the CLOCK_f/EVTDLY_f to update period
-for path_1=1:length(scs_m.objs)
- if typeof(scs_m.objs(path_1))=="Block" & scs_m.objs(path_1).gui=="CLOCK_f" then
- CLOCK_f_scs_m = scs_m.objs(path_1).model.rpar;
- break;
- end
-end
-for path_2=1:length(CLOCK_f_scs_m)
- if typeof(CLOCK_f_scs_m.objs(path_2))=="Block" & CLOCK_f_scs_m.objs(path_2).gui=="EVTDLY_f" then
- EVTDLY_f_blk = CLOCK_f_scs_m.objs(path_2);
- break;
- end
-end
-// Start by updating the clock block period (sampling)
-scs_m.objs(path_1).model.rpar.objs(path_2).graphics.exprs = [string(5*(10^-3));"0"];
// Modify solver + run DDaskr + save results
scs_m.props.tol(6) = 101; // Solver
-//scs_m.props.tol(1) = 1.0e-10; // abstol
-//scs_m.props.tol(2) = 1.0e-10; // reltol
-scicos_simulate(scs_m, Info, 'nw'); // DDaskr
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 50 50 50 50
+scicos_simulate(scs_m, Info); // DDaskr
Warning : redefining function: dst . Use funcprot(0) to avoid this message
ddaskrval = res.values; // Results
time = res.time; // Time
// Modify solver + run IDA + save results
scs_m.props.tol(6) = 100; // Solver
-scicos_simulate(scs_m, Info, 'nw'); // IDA
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 50 50 50 50
+scicos_simulate(scs_m, Info); // IDA
Warning : redefining function: dst . Use funcprot(0) to avoid this message
idaval = res.values; // Results
disp(msg);
endfunction
funcprot(prot);
-Info = scicos_simulate(scs_m, list(), 'nw');
-
-// looking for the CLOCK_f/EVTDLY_f to update period
-for path_1=1:length(scs_m.objs)
- if typeof(scs_m.objs(path_1))=="Block" & scs_m.objs(path_1).gui=="CLOCK_f" then
- CLOCK_f_scs_m = scs_m.objs(path_1).model.rpar;
- break;
- end
-end
-for path_2=1:length(CLOCK_f_scs_m)
- if typeof(CLOCK_f_scs_m.objs(path_2))=="Block" & CLOCK_f_scs_m.objs(path_2).gui=="EVTDLY_f" then
- EVTDLY_f_blk = CLOCK_f_scs_m.objs(path_2);
- break;
- end
-end
-
-// Start by updating the clock block period (sampling)
-scs_m.objs(path_1).model.rpar.objs(path_2).graphics.exprs = [string(5*(10^-3));"0"];
+Info = scicos_simulate(scs_m, list());
// Modify solver + run DDaskr + save results
scs_m.props.tol(6) = 101; // Solver
-//scs_m.props.tol(1) = 1.0e-10; // abstol
-//scs_m.props.tol(2) = 1.0e-10; // reltol
-scicos_simulate(scs_m, Info, 'nw'); // DDaskr
+scicos_simulate(scs_m, Info); // DDaskr
ddaskrval = res.values; // Results
time = res.time; // Time
// Modify solver + run IDA + save results
scs_m.props.tol(6) = 100; // Solver
-scicos_simulate(scs_m, Info, 'nw'); // IDA
+scicos_simulate(scs_m, Info); // IDA
idaval = res.values; // Results
// Compare results
disp(msg);
endfunction
funcprot(prot);
-Info = scicos_simulate(scs_m, list(), 'nw');
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 50 50 50 50
+// Modify solver + run DDaskr + save results
+scs_m.props.tol(6) = 101; // Solver
+scicos_simulate(scs_m); // DDaskr
--------------------------------------------\
Main Modelica : TMPDIR/DDaskr_Hydraulics_test_im.mo
! !
!Number of inputs : 1 !
! !
-!Number of outputs: 2 !
+!Number of outputs: 1 !
! !
!Input/output dependency:[F] !
! !
! !
! !
! !
-!Generated files path: TMPDIR/ !
+!Generated files path: TMPDIR/ !
! !
! !
Generate a loader file
Generate a cleaner file
Shared archive loaded.
Link done.
-// looking for the CLOCK_f/EVTDLY_f to update period
-for path_1=1:length(scs_m.objs)
- if typeof(scs_m.objs(path_1))=="Block" & scs_m.objs(path_1).gui=="CLOCK_f" then
- CLOCK_f_scs_m = scs_m.objs(path_1).model.rpar;
- break;
- end
-end
-for path_2=1:length(CLOCK_f_scs_m)
- if typeof(CLOCK_f_scs_m.objs(path_2))=="Block" & CLOCK_f_scs_m.objs(path_2).gui=="EVTDLY_f" then
- EVTDLY_f_blk = CLOCK_f_scs_m.objs(path_2);
- break;
- end
-end
-// Start by updating the clock block period (sampling)
-scs_m.objs(path_1).model.rpar.objs(path_2).graphics.exprs = [string(5*(10^-3));"0"];
-// Modify solver + run DDaskr + save results
-scs_m.props.tol(6) = 101; // Solver
-//scs_m.props.tol(1) = 1.0e-10; // abstol
-//scs_m.props.tol(2) = 1.0e-10; // reltol
-scicos_simulate(scs_m, Info, 'nw'); // DDaskr
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 50 50 50 50
-Warning : redefining function: dst . Use funcprot(0) to avoid this message
-
ddaskrval = res.values; // Results
time = res.time; // Time
// Modify solver + run IDA + save results
scs_m.props.tol(6) = 100; // Solver
-scicos_simulate(scs_m, Info, 'nw'); // IDA
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 50 50 50 50
-Warning : redefining function: dst . Use funcprot(0) to avoid this message
+scicos_simulate(scs_m); // IDA
+--------------------------------------------\
+ Main Modelica : TMPDIR/DDaskr_Hydraulics_test_im.mo
+ Flat Modelica : TMPDIR/DDaskr_Hydraulics_test_imf.mo
+ Simulation C code :TMPDIR/DDaskr_Hydraulics_test_im.c
+
+!Modelica blocks are reduced to a block with: !
+! !
+!Number of differential states: 2 !
+! !
+!Number of algebraic states: 5 !
+! !
+!Number of discrete time states : 0 !
+! !
+!Number of zero-crossing surfaces: 19 !
+! !
+!Number of modes : 19 !
+! !
+!Number of inputs : 1 !
+! !
+!Number of outputs: 1 !
+! !
+!Input/output dependency:[F] !
+! !
+!Analytical Jacobian: enabled (%Jacobian=%t) !
+! !
+!Parameter embedding mode: enabled (%Modelica_ParEmb=%t) !
+! !
+! !
+! !
+!Generated files path: TMPDIR/ !
+! !
+! !
+ Generate a loader file
+ Generate a Makefile
+ ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
+ ilib_gen_Make: Copy DDaskr_Hydraulics_test_im.c to TMPDIR
+ ilib_gen_Make: configure : Generate Makefile.
+ ilib_gen_Make: Modification of the Makefile in TMPDIR.
+ Running the Makefile
+ Generate a cleaner file
+Shared archive loaded.
+Link done.
idaval = res.values; // Results
// Compare results
compa = abs(ddaskrval-idaval);
[maxi, indexMaxi] = max(compa);
stdeviation = st_deviation(compa);
// Verifying closeness of the results
-assert_checktrue(maxi <= 10^-(7));
-assert_checktrue(mea <= 10^-(7));
-assert_checktrue(stdeviation <= 10^-(7));
+assert_checktrue(maxi <= 2*10^-(7));
+assert_checktrue(mea <= 2*10^-(7));
+assert_checktrue(stdeviation <= 2*10^-(7));
disp(msg);
endfunction
funcprot(prot);
-Info = scicos_simulate(scs_m, list(), 'nw');
-
-// looking for the CLOCK_f/EVTDLY_f to update period
-for path_1=1:length(scs_m.objs)
- if typeof(scs_m.objs(path_1))=="Block" & scs_m.objs(path_1).gui=="CLOCK_f" then
- CLOCK_f_scs_m = scs_m.objs(path_1).model.rpar;
- break;
- end
-end
-for path_2=1:length(CLOCK_f_scs_m)
- if typeof(CLOCK_f_scs_m.objs(path_2))=="Block" & CLOCK_f_scs_m.objs(path_2).gui=="EVTDLY_f" then
- EVTDLY_f_blk = CLOCK_f_scs_m.objs(path_2);
- break;
- end
-end
-
-// Start by updating the clock block period (sampling)
-scs_m.objs(path_1).model.rpar.objs(path_2).graphics.exprs = [string(5*(10^-3));"0"];
// Modify solver + run DDaskr + save results
scs_m.props.tol(6) = 101; // Solver
-//scs_m.props.tol(1) = 1.0e-10; // abstol
-//scs_m.props.tol(2) = 1.0e-10; // reltol
-scicos_simulate(scs_m, Info, 'nw'); // DDaskr
+scicos_simulate(scs_m); // DDaskr
ddaskrval = res.values; // Results
time = res.time; // Time
// Modify solver + run IDA + save results
scs_m.props.tol(6) = 100; // Solver
-scicos_simulate(scs_m, Info, 'nw'); // IDA
+scicos_simulate(scs_m); // IDA
idaval = res.values; // Results
// Compare results
stdeviation = st_deviation(compa);
// Verifying closeness of the results
-assert_checktrue(maxi <= 10^-(7));
-assert_checktrue(mea <= 10^-(7));
-assert_checktrue(stdeviation <= 10^-(7));
+assert_checktrue(maxi <= 2*10^-(7));
+assert_checktrue(mea <= 2*10^-(7));
+assert_checktrue(stdeviation <= 2*10^-(7));
disp(msg);
endfunction
funcprot(prot);
-Info = scicos_simulate(scs_m, list(), 'nw');
+Info = scicos_simulate(scs_m, list());
--------------------------------------------\
Main Modelica : TMPDIR/DDaskr_Platform_test_im.mo
! !
!Number of inputs : 0 !
! !
-!Number of outputs: 3 !
+!Number of outputs: 1 !
! !
!Input/output dependency:[T] !
! !
! !
! !
! !
-!Generated files path: TMPDIR/ !
+!Generated files path: TMPDIR/ !
! !
! !
Generate a loader file
Generate a cleaner file
Shared archive loaded.
Link done.
-// looking for the CLOCK_f/EVTDLY_f to update period
-for path_1=1:length(scs_m.objs)
- if typeof(scs_m.objs(path_1))=="Block" & scs_m.objs(path_1).gui=="CLOCK_c" then
- CLOCK_f_scs_m = scs_m.objs(path_1).model.rpar;
- break;
- end
-end
-for path_2=1:length(CLOCK_f_scs_m)
- if typeof(CLOCK_f_scs_m.objs(path_2))=="Block" & CLOCK_f_scs_m.objs(path_2).gui=="EVTDLY_c" then
- EVTDLY_f_blk = CLOCK_f_scs_m.objs(path_2);
- break;
- end
-end
for i=1:3 // 'max step size' = 10^-i, precision
// Start by updating the clock block period (sampling)
- scs_m.objs(path_1).model.rpar.objs(path_2).graphics.exprs = [string(5*(10^-i));"0"];
+ Context.per = 5*10^-i;
// Modify solver + run DDaskr + save results
scs_m.props.tol(6) = 101; // Solver
- scicos_simulate(scs_m, Info, 'nw'); // DDaskr
+ scicos_simulate(scs_m, Info, Context); // DDaskr
ddaskrval = res.values; // Results
time = res.time; // Time
// Modify solver + run IDA + save results
scs_m.props.tol(6) = 100; // Solver
- scicos_simulate(scs_m, Info, 'nw'); // IDA
+ scicos_simulate(scs_m, Info, Context); // IDA
idaval = res.values; // Results
// Compare results
compa = abs(ddaskrval-idaval);
disp(msg);
endfunction
funcprot(prot);
-Info = scicos_simulate(scs_m, list(), 'nw');
-
-// looking for the CLOCK_f/EVTDLY_f to update period
-for path_1=1:length(scs_m.objs)
- if typeof(scs_m.objs(path_1))=="Block" & scs_m.objs(path_1).gui=="CLOCK_c" then
- CLOCK_f_scs_m = scs_m.objs(path_1).model.rpar;
- break;
- end
-end
-for path_2=1:length(CLOCK_f_scs_m)
- if typeof(CLOCK_f_scs_m.objs(path_2))=="Block" & CLOCK_f_scs_m.objs(path_2).gui=="EVTDLY_c" then
- EVTDLY_f_blk = CLOCK_f_scs_m.objs(path_2);
- break;
- end
-end
+Info = scicos_simulate(scs_m, list());
for i=1:3 // 'max step size' = 10^-i, precision
// Start by updating the clock block period (sampling)
- scs_m.objs(path_1).model.rpar.objs(path_2).graphics.exprs = [string(5*(10^-i));"0"];
+ Context.per = 5*10^-i;
// Modify solver + run DDaskr + save results
scs_m.props.tol(6) = 101; // Solver
- scicos_simulate(scs_m, Info, 'nw'); // DDaskr
+ scicos_simulate(scs_m, Info, Context); // DDaskr
ddaskrval = res.values; // Results
time = res.time; // Time
// Modify solver + run IDA + save results
scs_m.props.tol(6) = 100; // Solver
- scicos_simulate(scs_m, Info, 'nw'); // IDA
+ scicos_simulate(scs_m, Info, Context); // IDA
idaval = res.values; // Results
// Compare results
disp(msg);
endfunction
funcprot(prot);
-Info = scicos_simulate(scs_m, list(), 'nw');
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 2 2 2 2
+for i=2:3
+ // Start by updating the clock block period (sampling)
+ Context.per = 5*10^-i;
+ Info = scicos_simulate(scs_m, list(), Context);
+ // Modify solver + run DDaskr + save results
+ scs_m.props.tol(6) = 101; // Solver
+ scicos_simulate(scs_m, Info); // DDaskr
+ ddaskrval = res.values; // Results
+ time = res.time; // Time
+ // Modify solver + run IDA + save results
+ scs_m.props.tol(6) = 100; // Solver
+ scicos_simulate(scs_m, Info); // IDA
+ idaval = res.values; // Results
+ // Compare results
+ compa = abs(ddaskrval-idaval);
+ // Extract mean, standard deviation, maximum
+ mea = mean(compa);
+ [maxi, indexMaxi] = max(compa);
+ stdeviation = st_deviation(compa);
+ // Verifying closeness of the results
+ assert_checktrue(maxi <= 10^-(i+4));
+ assert_checktrue(mea <= 10^-(i+4));
+ assert_checktrue(stdeviation <= 10^-(i+4));
+end
--------------------------------------------\
Main Modelica : TMPDIR/DDaskr_RLC_test_im.mo
! !
!Number of inputs : 0 !
! !
-!Number of outputs: 3 !
+!Number of outputs: 1 !
! !
!Input/output dependency:[T] !
! !
Generate a cleaner file
Shared archive loaded.
Link done.
-// looking for the CLOCK_f/EVTDLY_f to update period
-for path_1=1:length(scs_m.objs)
- if typeof(scs_m.objs(path_1))=="Block" & scs_m.objs(path_1).gui=="CLOCK_f" then
- CLOCK_f_scs_m = scs_m.objs(path_1).model.rpar;
- break;
- end
-end
-for path_2=1:length(CLOCK_f_scs_m)
- if typeof(CLOCK_f_scs_m.objs(path_2))=="Block" & CLOCK_f_scs_m.objs(path_2).gui=="EVTDLY_f" then
- EVTDLY_f_blk = CLOCK_f_scs_m.objs(path_2);
- break;
- end
-end
-for i=2:3
- // Start by updating the clock block period (sampling)
- scs_m.objs(path_1).model.rpar.objs(path_2).graphics.exprs = [string(5*(10^-i));"0"];
- // Modify solver + run DDaskr + save results
- scs_m.props.tol(6) = 101; // Solver
- scicos_simulate(scs_m, Info, 'nw'); // DDaskr
- ddaskrval = res.values; // Results
- time = res.time; // Time
- // Modify solver + run IDA + save results
- scs_m.props.tol(6) = 100; // Solver
- scicos_simulate(scs_m, Info, 'nw'); // IDA
- idaval = res.values; // Results
- // Compare results
- compa = abs(ddaskrval-idaval);
- // Extract mean, standard deviation, maximum
- mea = mean(compa);
- [maxi, indexMaxi] = max(compa);
- stdeviation = st_deviation(compa);
- // Verifying closeness of the results
- assert_checktrue(maxi <= 10^-(i+4));
- assert_checktrue(mea <= 10^-(i+4));
- assert_checktrue(stdeviation <= 10^-(i+4));
-end
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 2 2 2 2
Warning : redefining function: dst . Use funcprot(0) to avoid this message
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 2 2 2 2
Warning : redefining function: dst . Use funcprot(0) to avoid this message
+--------------------------------------------\
+ Main Modelica : TMPDIR/DDaskr_RLC_test_im.mo
+
+ Flat Modelica : TMPDIR/DDaskr_RLC_test_imf.mo
+ Simulation C code :TMPDIR/DDaskr_RLC_test_im.c
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 2 2 2 2
+!Modelica blocks are reduced to a block with: !
+! !
+!Number of differential states: 2 !
+! !
+!Number of algebraic states: 1 !
+! !
+!Number of discrete time states : 0 !
+! !
+!Number of zero-crossing surfaces: 0 !
+! !
+!Number of modes : 0 !
+! !
+!Number of inputs : 0 !
+! !
+!Number of outputs: 1 !
+! !
+!Input/output dependency:[T] !
+! !
+!Analytical Jacobian: enabled (%Jacobian=%t) !
+! !
+!Parameter embedding mode: enabled (%Modelica_ParEmb=%t) !
+! !
+! !
+! !
+!Generated files path: TMPDIR/ !
+! !
+! !
+ Generate a loader file
+ Generate a Makefile
+ ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
+ ilib_gen_Make: Copy DDaskr_RLC_test_im.c to TMPDIR
+ ilib_gen_Make: configure : Generate Makefile.
+ ilib_gen_Make: Modification of the Makefile in TMPDIR.
+ Running the Makefile
+ Generate a cleaner file
+Shared archive loaded.
+Link done.
Warning : redefining function: dst . Use funcprot(0) to avoid this message
-
- CMSCOPE('set'): Wrong size for block parameter 'Refresh period': 2 exp
- ected, getting 2 2 2 2
Warning : redefining function: dst . Use funcprot(0) to avoid this message
disp(msg);
endfunction
funcprot(prot);
-Info = scicos_simulate(scs_m, list(), 'nw');
-
-// looking for the CLOCK_f/EVTDLY_f to update period
-for path_1=1:length(scs_m.objs)
- if typeof(scs_m.objs(path_1))=="Block" & scs_m.objs(path_1).gui=="CLOCK_f" then
- CLOCK_f_scs_m = scs_m.objs(path_1).model.rpar;
- break;
- end
-end
-for path_2=1:length(CLOCK_f_scs_m)
- if typeof(CLOCK_f_scs_m.objs(path_2))=="Block" & CLOCK_f_scs_m.objs(path_2).gui=="EVTDLY_f" then
- EVTDLY_f_blk = CLOCK_f_scs_m.objs(path_2);
- break;
- end
-end
-
-
for i=2:3
// Start by updating the clock block period (sampling)
- scs_m.objs(path_1).model.rpar.objs(path_2).graphics.exprs = [string(5*(10^-i));"0"];
+ Context.per = 5*10^-i;
+ Info = scicos_simulate(scs_m, list(), Context);
// Modify solver + run DDaskr + save results
scs_m.props.tol(6) = 101; // Solver
- scicos_simulate(scs_m, Info, 'nw'); // DDaskr
- ddaskrval = res.values; // Results
- time = res.time; // Time
+ scicos_simulate(scs_m, Info); // DDaskr
+ ddaskrval = res.values; // Results
+ time = res.time; // Time
// Modify solver + run IDA + save results
scs_m.props.tol(6) = 100; // Solver
- scicos_simulate(scs_m, Info, 'nw'); // IDA
+ scicos_simulate(scs_m, Info); // IDA
idaval = res.values; // Results
// Compare results
assert_checktrue(maxi <= 10^-(i+4));
assert_checktrue(mea <= 10^-(i+4));
assert_checktrue(stdeviation <= 10^-(i+4));
+
end