Skip to content

Commit

Permalink
named function instead of anonymous
Browse files Browse the repository at this point in the history
  • Loading branch information
franckgaga committed Sep 16, 2024
1 parent b56977c commit 5621030
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/model/linearization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ function linearize!(
A::Matrix{NT}, Bu::Matrix{NT}, Bd::Matrix{NT} = linmodel.A, linmodel.Bu, linmodel.Bd
C::Matrix{NT}, Dd::Matrix{NT} = linmodel.C, linmodel.Dd
xnext0::Vector{NT}, y0::Vector{NT} = linmodel.buffer.x, linmodel.buffer.y
myf_x0! = (xnext0, x0) -> f!(xnext0, nonlinmodel, x0, u0, d0)
myf_u0! = (xnext0, u0) -> f!(xnext0, nonlinmodel, x0, u0, d0)
myf_d0! = (xnext0, d0) -> f!(xnext0, nonlinmodel, x0, u0, d0)
myh_x0! = (y0, x0) -> h!(y0, nonlinmodel, x0, d0)
myh_d0! = (y0, d0) -> h!(y0, nonlinmodel, x0, d0)
myf_x0!(xnext0, x0) = f!(xnext0, nonlinmodel, x0, u0, d0)
myf_u0!(xnext0, u0) = f!(xnext0, nonlinmodel, x0, u0, d0)
myf_d0!(xnext0, d0) = f!(xnext0, nonlinmodel, x0, u0, d0)
myh_x0!(y0, x0) = h!(y0, nonlinmodel, x0, d0)
myh_d0!(y0, d0) = h!(y0, nonlinmodel, x0, d0)
ForwardDiff.jacobian!(A, myf_x0!, xnext0, x0)
ForwardDiff.jacobian!(Bu, myf_u0!, xnext0, u0)
ForwardDiff.jacobian!(Bd, myf_d0!, xnext0, d0)
Expand Down

0 comments on commit 5621030

Please sign in to comment.