Skip to content

State observer #309

May 17, 2024 · 3 comments · 19 replies
Discussion options

You must be logged in to vote

@ValentinKaisermayer I decided to play with your model a bit to also infer the p parameter and employ @bvdmitri's suggestion to remove the g function. For me, the inference now runs for 20 seconds, taking 1 second per iteration.

using RxInfer
using Random
using LinearAlgebra
using CairoMakie

function f(x, u, p, t, tS)
    return x   tS*[
        x[2]
        -p[1] / p[3] * x[1] - p[2] / p[3] * x[2] - 1 / p[3] * u[1]
    ]
end

g(x, u, p, t) = [x[1]]

tS = 1/100
t_sim = 0:tS:120
u_sim = reduce(
    hcat,
    map(t -> [exp(-0.1t) * sin(1 / 10 * 2 * pi * t)   sin(1 / 20 * 2 * pi * t)], t_sim),
)
x0 = [0, 0]

function generate_data(rng, f, g, tS, x0, u, t, Q, R, p)
    x_prev = x0

    x = V…

Replies: 3 comments 19 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
18 replies
@albertpod
Comment options

@bvdmitri
Comment options

@bvdmitri
Comment options

@Nimrais
Comment options

Answer selected by ValentinKaisermayer
@bvdmitri
Comment options

@bvdmitri
Comment options

@Nimrais
Comment options

@Nimrais
Comment options

Comment options

You must be logged in to vote
1 reply
@bvdmitri
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants