-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with the Carvallo-Whipple Bicycle Model #446
Comments
Here is some code to get the initial dependent u's: eval_nonholonomic = sm.lambdify((u3, u5, u8, u4, u6, u7, q4, q5, q7, d1, d2, d3, rf, rr), nonholonomic)
def eval_nonholonomic_vector(u_dep, u4, u6, u7, q4, q5, q7, d1, d2, d3, rf, rr):
u3 = u_dep[0]
u5 = u_dep[1]
u8 = u_dep[2]
return eval_nonholonomic(u3, u5, u8, u4, u6, u7, q4, q5, q7, d1, d2, d3, rf, rr)
res = fsolve(eval_nonholonomic_vector,
[0.0, 0.0, -initial_speed/sys.constants[rf]], # guess
args=(initial_roll_rate,
-initial_speed/sys.constants[rr],
0.0,
0.0,
initial_pitch_angle,
initial_steer_angle,
sys.constants[d1],
sys.constants[d2],
sys.constants[d3],
sys.constants[rf],
sys.constants[rr]))
initial_yaw_rate = res[0]
initial_pitch_rate = res[1]
initial_front_wheel_rate = res[2] Quick an dirty way. For only setting an initial roll rate and rear wheel rate this doesn't change the results. Only u8 is non-zero and it can be calculated as I have it in the notebook. |
I'm getting very different results across two machines - which are also differing from the example. |
Also, the model gives the correct answers if Symengine is used to evaluate to arbitrary precision. So it is some kind of numerical rounding error. Edit: see this comment #122 (comment) |
This example is live: https://pydy.readthedocs.io/en/latest/examples/carvallo-whipple.html. It mostly works but there are some hanging issues that should be addressed in that example and are related to the issues in #122
1e-7
instead of1e-8
.0.0
in the symbolic derivation (setting velocities to zero and inertia scalars to zero). If I change these to0
orsympy.S(0)
I get different simulation results (stable to unstable for example). I'm not sure why these would change the behavior.The text was updated successfully, but these errors were encountered: