Skip to content

Commit

Permalink
Fix predictive controller
Browse files Browse the repository at this point in the history
  • Loading branch information
YingboMa committed Jan 21, 2019
1 parent 7f4541e commit e17fc18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/integrators/integrator_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ function stepsize_controller!(integrator,
expo = 1/(get_current_adaptive_order(integrator.alg,integrator.cache)+1)
qtmp = (integrator.EEst^expo)/fac
@fastmath q = max(inv(integrator.opts.qmax),min(inv(integrator.opts.qmin),qtmp))
integrator.qold = q

This comment has been minimized.

Copy link
@ChrisRackauckas

ChrisRackauckas Jan 21, 2019

Member

Why is this important?

This comment has been minimized.

Copy link
@ChrisRackauckas

ChrisRackauckas Jan 21, 2019

Member

Default qsteady should be 1 and 1 IIRC, so this might not be a real change right now.

This comment has been minimized.

Copy link
@YingboMa

YingboMa Jan 21, 2019

Author Member

If qold is one, then when the solver has step rejection, it will get stuck.

This comment has been minimized.

Copy link
@ChrisRackauckas

ChrisRackauckas Jan 21, 2019

Member

How so?

This comment has been minimized.

Copy link
@YingboMa

YingboMa via email Jan 21, 2019

Author Member

This comment has been minimized.

Copy link
@ChrisRackauckas

ChrisRackauckas Jan 21, 2019

Member

This inequality won't occur when there's a rejection anyways, if everything is acting sane. It's solve purpose is so that if accepted but q is close to 1, make it exactly 1 to increase stability (among other things. It also helps Jacobian re-use which is the main effect).

This comment has been minimized.

Copy link
@YingboMa

YingboMa via email Jan 21, 2019

Author Member
if q <= integrator.opts.qsteady_max && q >= integrator.opts.qsteady_min
q = one(q)
end
integrator.qold = q
end
q
end
Expand Down

0 comments on commit e17fc18

Please sign in to comment.