Skip to content

Commit

Permalink
export lastErr
Browse files Browse the repository at this point in the history
  • Loading branch information
godsic committed Nov 14, 2014
1 parent 3fef72c commit 5435228
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion engine/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ func (g *guistate) prepareOnUpdate() {
g.Set("nsteps", NSteps)
g.Set("time", fmt.Sprintf("%1.5e", Time))
g.Set("dt", fmt.Sprintf("%1.3e", Dt_si))
g.Set("lasterr", fmt.Sprintf("%1.3e", lastErr))
g.Set("lasterr", fmt.Sprintf("%1.3e", LastErr))
g.Set("maxerr", MaxErr)
g.Set("mindt", MinDt)
g.Set("maxdt", MaxDt)
Expand Down
6 changes: 3 additions & 3 deletions engine/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var (
MinDt, MaxDt float64 // minimum and maximum time step
MaxErr float64 = 1e-5 // maximum error/step
Headroom float64 = 0.8 // solver headroom, (Gustafsson, 1992, Control of Error and Convergence in ODE Solvers)
lastErr, peakErr float64 // error of last step, highest error ever
LastErr, peakErr float64 // error of last step, highest error ever
lastTorque float64 // maxTorque of last time step
NSteps, NUndone, NEvals int // number of good steps, undone steps
FixDt float64 // fixed time step?
Expand All @@ -35,7 +35,7 @@ func init() {
DeclVar("t", &Time, "Total simulated time (s)")
DeclVar("step", &NSteps, "Total number of time steps taken")
DeclVar("dt", &Dt_si, "Last solver time step (s)")
DeclROnly("lastErr", &lastErr, "Maximum error of last time step")
DeclROnly("lastErr", &LastErr, "Maximum error of last time step")
DeclROnly("peakErr", &peakErr, "Maximum error over all time steps")
DeclFunc("NEval", getNEval, "Total number of torque evaluations")
DeclVar("MinDt", &MinDt, "Minimum time step the solver can take (s)")
Expand Down Expand Up @@ -97,7 +97,7 @@ func getNEval() int {

// update lastErr and peakErr
func setLastErr(err float64) {
lastErr = err
LastErr = err
if err > peakErr {
peakErr = err
}
Expand Down

0 comments on commit 5435228

Please sign in to comment.