From db637b811576ad9399cf0ac92a5f813e20781acc Mon Sep 17 00:00:00 2001
From: baggepinnen <cont-frb@ulund.org>
Date: Mon, 19 Feb 2018 07:42:06 +0100
Subject: [PATCH] fix timeindex bug in nn prior simulation

---
 flux/nn_prior/two_link_sys.jl    | 4 ++--
 jump_lin_id/figs/robot_train.tex | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/flux/nn_prior/two_link_sys.jl b/flux/nn_prior/two_link_sys.jl
index ce9ca9b..7a655b4 100644
--- a/flux/nn_prior/two_link_sys.jl
+++ b/flux/nn_prior/two_link_sys.jl
@@ -24,9 +24,9 @@ function generate_data(sys::TwoLinkSys, systype, seed, validation=false; ufun=u-
     local x,u
     while !done
         u = ufun(randn(n,N+2))
-        t  = h:h:N*h+h
+        t  = 0:h:N*h
         x0 = [-0.4,0,0,0]
-        prob = OrdinaryDiffEq.ODEProblem((x,p,t)->time_derivative(x, u[:,ceil(Int,t/h)]),x0,(t[[1,end]]...))
+        prob = OrdinaryDiffEq.ODEProblem((x,p,t)->time_derivative(x, u[:,floor(Int,t/h)+1]),x0,(t[[1,end]]...))
         sol = solve(prob,Tsit5(),reltol=1e-8,abstol=1e-8)
         x = hcat(sol(t)...)
         done = all(abs.(x[1:2,:]) .< 0.9π)
diff --git a/jump_lin_id/figs/robot_train.tex b/jump_lin_id/figs/robot_train.tex
index d037400..874d131 100644
--- a/jump_lin_id/figs/robot_train.tex
+++ b/jump_lin_id/figs/robot_train.tex
@@ -1899,7 +1899,7 @@ mark options = {
 (200.0, 0.7559084700421508)
 };
 \end{axis}
-\begin{axis}[height = {\figureheight}, ylabel = {}, title = {End effector positions}, xmin = {1.0}, xmax = {200.0}, ymax = {0.9017369909373718}, xlabel = {}, unbounded coords=jump
+\begin{axis}[height = {\figureheight}, ylabel = {}, title = {End-effector positions}, xmin = {1.0}, xmax = {200.0}, ymax = {0.9017369909373718}, xlabel = {}, unbounded coords=jump
 , scaled x ticks = false
 , xticklabel style={rotate = 0}
 , xmajorgrids = false
-- 
GitLab