From 3515dd7aba796f200d8ece2a6c5a60b604ae6638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B9=AC?= Date: Wed, 10 Jul 2024 17:45:36 +0800 Subject: [PATCH 1/2] fix model.md --- docs/get-started/model.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/get-started/model.md b/docs/get-started/model.md index da31adb..a218452 100644 --- a/docs/get-started/model.md +++ b/docs/get-started/model.md @@ -30,6 +30,8 @@ Let's write those down in a dynamics function === "Python" ```py + import autograd.numpy as np + mc = 0.2 # mass of the cart (kg) mp = 0.1 # mass of the pole (kg) ℓ = 0.5 # distance to the center of mass (meters) @@ -55,6 +57,7 @@ Let's write those down in a dynamics function === "Julia" ```julia + mc = 0.2 # mass of the cart (kg) mp = 0.1 # mass of the pole (kg) ℓ = 0.5 # distance to the center of mass (meters) @@ -116,8 +119,8 @@ Our integrator takes in the state and control at the current time step and integ dt = 0.01 - A = AG.jacobian(lambda x_: cartpole_rk4(x_, ugoal))(xgoal) - B = AG.jacobian(lambda u_: cartpole_rk4(xgoal, u_))(ugoal) + A = AG.jacobian(lambda x_: cartpole_rk4(x_, ugoal, dt))(xgoal) + B = AG.jacobian(lambda u_: cartpole_rk4(xgoal, u_, dt))(ugoal) ``` === "Julia" From 1efd0d02bc87840fa51f3c8840ee4d395ebc2782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B9=AC?= Date: Wed, 10 Jul 2024 17:47:58 +0800 Subject: [PATCH 2/2] fix model.md --- docs/get-started/model.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/get-started/model.md b/docs/get-started/model.md index a218452..2f77541 100644 --- a/docs/get-started/model.md +++ b/docs/get-started/model.md @@ -57,7 +57,6 @@ Let's write those down in a dynamics function === "Julia" ```julia - mc = 0.2 # mass of the cart (kg) mp = 0.1 # mass of the pole (kg) ℓ = 0.5 # distance to the center of mass (meters)