@@ -523,7 +523,13 @@ an updated `prob` to be used for solving. All implementations should accept arbi
523
523
keyword arguments.
524
524
525
525
Should be called before the problem is solved, after performing type-promotion on the
526
- problem.
526
+ problem. If the returned problem is not `===` the provided `prob`, it is assumed to
527
+ contain the `u0` and `p` passed as keyword arguments.
528
+
529
+ # Keyword Arguments
530
+
531
+ - `u0`, `p`: Override values for `state_values(prob)` and `parameter_values(prob)` which
532
+ should be used instead of the ones in `prob`.
527
533
"""
528
534
function get_updated_symbolic_problem (indp, prob; kw... )
529
535
return prob
@@ -1239,27 +1245,36 @@ function checkkwargs(kwargshandle; kwargs...)
1239
1245
end
1240
1246
1241
1247
function get_concrete_problem (prob:: AbstractJumpProblem , isadapt; kwargs... )
1242
- get_updated_symbolic_problem (_get_root_indp (prob), prob)
1248
+ get_updated_symbolic_problem (_get_root_indp (prob), prob; kwargs ... )
1243
1249
end
1244
1250
1245
1251
function get_concrete_problem (prob:: SteadyStateProblem , isadapt; kwargs... )
1246
- prob = get_updated_symbolic_problem (_get_root_indp (prob), prob)
1252
+ prob = get_updated_symbolic_problem (_get_root_indp (prob), prob; kwargs... )
1253
+ if prob != = prob
1254
+ kwargs = (; kwargs... , u0 = SII. state_values (prob), p = SII. parameter_values (prob))
1255
+ end
1247
1256
p = get_concrete_p (prob, kwargs)
1248
1257
u0 = get_concrete_u0 (prob, isadapt, Inf , kwargs)
1249
1258
u0 = promote_u0 (u0, p, nothing )
1250
1259
remake (prob; u0 = u0, p = p)
1251
1260
end
1252
1261
1253
1262
function get_concrete_problem (prob:: NonlinearProblem , isadapt; kwargs... )
1254
- prob = get_updated_symbolic_problem (_get_root_indp (prob), prob)
1263
+ prob = get_updated_symbolic_problem (_get_root_indp (prob), prob; kwargs... )
1264
+ if prob != = prob
1265
+ kwargs = (; kwargs... , u0 = SII. state_values (prob), p = SII. parameter_values (prob))
1266
+ end
1255
1267
p = get_concrete_p (prob, kwargs)
1256
1268
u0 = get_concrete_u0 (prob, isadapt, nothing , kwargs)
1257
1269
u0 = promote_u0 (u0, p, nothing )
1258
1270
remake (prob; u0 = u0, p = p)
1259
1271
end
1260
1272
1261
1273
function get_concrete_problem (prob:: NonlinearLeastSquaresProblem , isadapt; kwargs... )
1262
- prob = get_updated_symbolic_problem (_get_root_indp (prob), prob)
1274
+ prob = get_updated_symbolic_problem (_get_root_indp (prob), prob; kwargs... )
1275
+ if prob != = prob
1276
+ kwargs = (; kwargs... , u0 = SII. state_values (prob), p = SII. parameter_values (prob))
1277
+ end
1263
1278
p = get_concrete_p (prob, kwargs)
1264
1279
u0 = get_concrete_u0 (prob, isadapt, nothing , kwargs)
1265
1280
u0 = promote_u0 (u0, p, nothing )
@@ -1281,7 +1296,10 @@ function init(prob::PDEProblem, alg::AbstractDEAlgorithm, args...;
1281
1296
end
1282
1297
1283
1298
function get_concrete_problem (prob, isadapt; kwargs... )
1284
- prob = get_updated_symbolic_problem (_get_root_indp (prob), prob)
1299
+ prob = get_updated_symbolic_problem (_get_root_indp (prob), prob; kwargs... )
1300
+ if prob != = prob
1301
+ kwargs = (; kwargs... , u0 = SII. state_values (prob), p = SII. parameter_values (prob))
1302
+ end
1285
1303
p = get_concrete_p (prob, kwargs)
1286
1304
tspan = get_concrete_tspan (prob, isadapt, kwargs, p)
1287
1305
u0 = get_concrete_u0 (prob, isadapt, tspan[1 ], kwargs)
@@ -1300,7 +1318,10 @@ function get_concrete_problem(prob, isadapt; kwargs...)
1300
1318
end
1301
1319
1302
1320
function get_concrete_problem (prob:: DAEProblem , isadapt; kwargs... )
1303
- prob = get_updated_symbolic_problem (_get_root_indp (prob), prob)
1321
+ prob = get_updated_symbolic_problem (_get_root_indp (prob), prob; kwargs... )
1322
+ if prob != = prob
1323
+ kwargs = (; kwargs... , u0 = SII. state_values (prob), p = SII. parameter_values (prob))
1324
+ end
1304
1325
p = get_concrete_p (prob, kwargs)
1305
1326
tspan = get_concrete_tspan (prob, isadapt, kwargs, p)
1306
1327
u0 = get_concrete_u0 (prob, isadapt, tspan[1 ], kwargs)
@@ -1324,7 +1345,10 @@ function get_concrete_problem(prob::DAEProblem, isadapt; kwargs...)
1324
1345
end
1325
1346
1326
1347
function get_concrete_problem (prob:: DDEProblem , isadapt; kwargs... )
1327
- prob = get_updated_symbolic_problem (_get_root_indp (prob), prob)
1348
+ prob = get_updated_symbolic_problem (_get_root_indp (prob), prob; kwargs... )
1349
+ if prob != = prob
1350
+ kwargs = (; kwargs... , u0 = SII. state_values (prob), p = SII. parameter_values (prob))
1351
+ end
1328
1352
p = get_concrete_p (prob, kwargs)
1329
1353
tspan = get_concrete_tspan (prob, isadapt, kwargs, p)
1330
1354
u0 = get_concrete_u0 (prob, isadapt, tspan[1 ], kwargs)
0 commit comments