Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- y_arr[i] = y
- x_arr[i] = x
- e_arr[i] = e
- u_arr[i] = u
- if i < int(iterations - iterations* 0.6):
- y_need_arr[i] = y0 + 10
- elif i < int(iterations - iterations * 0.3):
- y_need_arr[i] = y0 + 20
- else:
- y_need_arr[i] = y0 + 30
- e = y_need_arr[i]-y
- e_sum += e*h
- u = kp * e + ki * e_sum
- x = x + h*(y)
- rand = 20* np.random.randn()
- y = y + h*(a * x + u+rand)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement