# Add state noise for discrete dynamic function

Hi I am a new to acados, thanks for your nice frame. I now want to configure MHE for a wind turbine model in python. I already have continuous implicit dynamic equations like 0=f(x, x_dot, u, p) and want to add additional state noise term w. From your MHE example, you seem directly add the noise term behind the continuous function like 0=f(x, x_dot, u, p)+w.
But if it is possible that add this noise term to the discretized equations (after multiple-shooting or use some discrete method based on acados or casadi) to make the function looks like x_k+1 = g(x_k, u_k, p)+w_k
Best regards
Benjamin

Hi Benjamin,

I’m pretty sure the two formulations are equivalent up to scaling. If you have an implicit ODE of the form

0 = \tilde{f}(x, \dot{x}, u, p, w)

where \tilde{f}(x, \dot{x}, u, p, w) = f(x, \dot{x}, u, p) + w the resulting discrete dynamics that you get from the Runge Kutta integrator are of the form

x^+ = x + h\sum_i b_i k_i

where h is the integration interval and

k_i = \tilde{f}(*, *, u, p, w) = f(*, *, u, p) + w.

As the b_i coefficients sum to 1, the discrete dynamics take the form x^+ = g(x, u, p) + hw. Does that help?

Best, Kaethe!

1 Like

Hi kaethe,
Thanks for your quick answer, you are right, I only need to do some scaling for the noise term in the continuous equation to get similar results as in the discrete case. Thanks for your answer, again Best Regards,
Benjamin

1 Like