Skip to content

Weird pendulum behavior in Brax Basics notebook #532

Answered by AumGupta
karanprime asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @karanprime,

As far as I understood, you are trying to achieve something like the image below:

Solution:

To achieve this, you just have to play with the parameter of range function used in the loop at the end of the given code.

The existing loop has 100 * substeps as parameter to range():

for i in range(100 * substeps): #Change 100 to larger values
  if i % substeps == 0:
    visualize(ax, state.x.pos, i / (100 * substeps)) #Change 100 to larger values
  state = jax.jit(pipeline.step)(pendulum, state, None)

Update it to 200 * substeps: (For Instance)

for i in range(200 * substeps): 
  if i % substeps == 0:
    visualize(ax, state.x.pos, i / (200 * substeps)) 
  state = jax.jit(pipe…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by btaba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants