Changes between Initial Version and Version 2 of Ticket #1692
- Timestamp:
- 2012-10-02T10:06:18Z (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #1692
- Property Cc added; removed
- Property Component → Backend
-
Ticket #1692 – Description
initial v2 1 1 http://openmodelica.org/index.php?option=com_agora&task=topic&id=526&Itemid=87 2 {{{package Medium 2 {{{ 3 package Medium 3 4 function h_pt 4 5 input Real p; … … 128 129 129 130 {{{$ MODELICAUSERCFLAGS="-g -fstack-protector" omc +s +simCodeTarget=Dump a.mo | grep residual | wc -l 130 16}}} 131 132 {{{$ MODELICAUSERCFLAGS="-g -fstack-protector" omc +s +simCodeTarget=Dump a.mo | grep nonlinear | tr , \\n | cut -d: -f2 | tr -d " " | wc -l 133 12}}} 131 16 132 }}} 133 134 {{{ 135 $ MODELICAUSERCFLAGS="-g -fstack-protector" omc +s +simCodeTarget=Dump a.mo | grep nonlinear | tr , \\n | cut -d: -f2 | tr -d " " | wc -l 136 12 137 }}} 134 138 135 139 So we have 16 residual expressions written to 12 memory locations. WRONG WRONG WRONG. 136 140 137 141 Also, many of the expressions are KNOWN ZERO! 138 {{{ residual: xloc[2]; 142 {{{ 143 residual: xloc[2]; 139 144 residual: xloc[1]; 140 145 residual: xloc[11] - Medium.d_ph(100000.0,xloc[10]); … … 151 156 residual: xloc[2]; 152 157 residual: xloc[1]; 153 residual: xloc[8] - Medium.h_pt(xloc[0],300.0);}}} 154 155 We can replace {{{xloc[1]=xloc[2]=xloc[4]=xloc[3]=0}}} since this is a trivial solution (and the only correct one). We can then replace all these variables with the known constant (like removeSimpleExpressions), and re-run SCC algorithm since this may no longer be a SCC :) 158 residual: xloc[8] - Medium.h_pt(xloc[0],300.0); 159 }}} 160 161 We can replace `xloc[1]=xloc[2]=xloc[4]=xloc[3]=0` since this is a trivial solution (and the only correct one). We can then replace all these variables with the known constant (like removeSimpleExpressions), and re-run SCC algorithm since this may no longer be a SCC :) 156 162 157 163 In this case: 158 {{{ residual: xloc[11] - Medium.d_ph(100000.0,xloc[10]); 164 {{{ 165 residual: xloc[11] - Medium.d_ph(100000.0,xloc[10]); 159 166 residual: xloc[9] + (-0.9999999999999998 * source.port.h + -0.00000000000000009999999999999999 * xloc[10]); 160 167 residual: xloc[10] + -0.5 * (xloc[8] + xloc[9]); … … 163 170 residual: xloc[5] - Medium.d_ph(100000.0,xloc[6]); 164 171 residual: xloc[0] - 0.0; 165 residual: xloc[8] - Medium.h_pt(xloc[0],300.0);}}} 166 167 168 In this case (re-run {{{xloc[0]=0}}}: 169 {{{ residual: xloc[11] - Medium.d_ph(100000.0,xloc[10]); 172 residual: xloc[8] - Medium.h_pt(xloc[0],300.0); 173 }}} 174 175 In this case (re-run `xloc[0]=0`: 176 {{{ 177 residual: xloc[11] - Medium.d_ph(100000.0,xloc[10]); 170 178 residual: xloc[9] + (-0.9999999999999998 * source.port.h + -0.00000000000000009999999999999999 * xloc[10]); 171 179 residual: xloc[10] + -0.5 * (xloc[8] + xloc[9]); … … 173 181 residual: xloc[7] + (-0.6666666666666666 * source.port.h + -0.3333333333333333 * xloc[6]); 174 182 residual: xloc[5] - Medium.d_ph(100000.0,xloc[6]); 175 residual: xloc[8] - Medium.h_pt(0.0,300.0); /* Another known constant! */}}} 176 177 178 179 In this case (re-run {{{xloc[8]=300.0}}}: 180 {{{ residual: xloc[11] - Medium.d_ph(100000.0,xloc[10]); 183 residual: xloc[8] - Medium.h_pt(0.0,300.0); /* Another known constant! */ 184 }}} 185 186 187 188 In this case (re-run `xloc[8]=300.0`): 189 {{{ 190 residual: xloc[11] - Medium.d_ph(100000.0,xloc[10]); 181 191 residual: xloc[9] + (-0.9999999999999998 * source.port.h + -0.00000000000000009999999999999999 * xloc[10]); 182 192 residual: xloc[10] + -0.5 * (300.0 + xloc[9]); 183 193 residual: xloc[6] + (-0.9999999999999999 * xloc[7] + -0.00000000000000006666666666666667 * 300.0); 184 194 residual: xloc[7] + (-0.6666666666666666 * source.port.h + -0.3333333333333333 * xloc[6]); 185 residual: xloc[5] - Medium.d_ph(100000.0,xloc[6]);}}} 195 residual: xloc[5] - Medium.d_ph(100000.0,xloc[6]); 196 }}} 186 197 187 198 Much simpler to solve :) Feel free to split this into 2 different bugs if needed. … … 198 209 residual: xloc[7] + (-0.6666666666666666 * source.port.h + -0.3333333333333333 * xloc[6]); 199 210 Scalar: 200 residual: xloc[5] = Medium.d_ph(100000.0,xloc[6]);}}} 211 residual: xloc[5] = Medium.d_ph(100000.0,xloc[6]); 212 }}} 201 213 202 214 This equation system screams: Please make me faster, Willi and/or Jens