Mercurial > octave-nkf
comparison scripts/ode/private/integrate_const.m @ 20586:b7ac1e94266e
maint: Further clean up of functions in ode/private dir.
* AbsRel_Norm.m, fuzzy_compare.m, integrate_adaptive.m, integrate_const.m,
integrate_n_steps.m, ode_struct_value_check.m, odepkg_event_handle.m,
odepkg_structure_check.m, runge_kutta_45_dorpri.m:
Place latest copyright first in file.
Use two spaces before beginning single-line comment.
Use parentheses around variable to be tested in switch stmt.
Use space between function name and opening parenthesis.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 05 Oct 2015 12:03:16 -0700 |
parents | eb9e2d187ed2 |
children | a260a6acb70f |
comparison
equal
deleted
inserted
replaced
20585:45151de7423f | 20586:b7ac1e94266e |
---|---|
134 u = [x(:,end),y]; | 134 u = [x(:,end),y]; |
135 | 135 |
136 ## if next tspan value is caught, update counter | 136 ## if next tspan value is caught, update counter |
137 if ((z(end) == tspan(counter)) | 137 if ((z(end) == tspan(counter)) |
138 || (abs (z(end) - tspan(counter)) / | 138 || (abs (z(end) - tspan(counter)) / |
139 (max(abs (z(end)), abs(tspan(counter)))) < 8*eps) ) | 139 (max (abs (z(end)), abs (tspan(counter)))) < 8*eps) ) |
140 counter++; | 140 counter++; |
141 | 141 |
142 ## if there is an element in time vector at which the solution is required | 142 ## if there is an element in time vector at which the solution is required |
143 ## the program must compute this solution before going on with next steps | 143 ## the program must compute this solution before going on with next steps |
144 elseif (vdirection * z(end) > vdirection * tspan(counter) ) | 144 elseif (vdirection * z(end) > vdirection * tspan(counter) ) |
148 | 148 |
149 ## if next tspan value is caught, update counter | 149 ## if next tspan value is caught, update counter |
150 if ((counter <= k) | 150 if ((counter <= k) |
151 && (((z(i) == tspan(counter)) | 151 && (((z(i) == tspan(counter)) |
152 || (abs (z(i) - tspan(counter)) / | 152 || (abs (z(i) - tspan(counter)) / |
153 (max(abs (z(i)), abs (tspan(counter)))) < 8*eps))) ) | 153 (max (abs (z(i)), abs (tspan(counter)))) < 8*eps))) ) |
154 counter++; | 154 counter++; |
155 endif | 155 endif |
156 ## else, loop until there are requested values inside this subinterval | 156 ## else, loop until there are requested values inside this subinterval |
157 while ((counter <= k) | 157 while ((counter <= k) |
158 && vdirection * z(i) > vdirection * tspan(counter) ) | 158 && vdirection * z(i) > vdirection * tspan(counter) ) |
230 break; | 230 break; |
231 endif | 231 endif |
232 endif | 232 endif |
233 | 233 |
234 ## Update counters that count the number of iteration cycles | 234 ## Update counters that count the number of iteration cycles |
235 solution.vcntcycles = solution.vcntcycles + 1; # Needed for cost statistics | 235 solution.vcntcycles = solution.vcntcycles + 1; # Needed for cost statistics |
236 vcntiter = vcntiter + 1; # Needed to find iteration problems | 236 vcntiter = vcntiter + 1; # Needed to find iteration problems |
237 | 237 |
238 ## Stop solving because the last 1000 steps no successful valid | 238 ## Stop solving because the last 1000 steps no successful valid |
239 ## value has been found | 239 ## value has been found |
240 if (vcntiter >= 5000) | 240 if (vcntiter >= 5000) |
241 error (["Solving has not been successful. The iterative", | 241 error (["Solving has not been successful. The iterative", |