-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linearization #2
Comments
Data driven linearization for stable systems with noisy inputs Linear analysis of noisePropagation of Gaussian noise through linear time-invariant systems is well understood, the stationary covariance of the output can be computed by solving a Lyapunov equation. Unfortunately, ModelingToolkit models that contain both continuous time and discrete time components cannot yet be linearized and linear analysis is thus made slightly harder. Below, we instead use a data-driven linearization approach where we use recorded signals from the simulation and fit a linear model using subspace-based identification. The function We let the angular velocity of the inertia be the output, and the output of the noise block as well as the output of the load disturbance be the inputs. using ControlSystemIdentification, ControlSystemsBase
Tf = 20
prob2 = remake(noise_prob, p=Dict(noisy_model.load_step.height=>0.0), tspan=(0.0, Tf))
noise_sol = solve(prob2, Tsit5())
tv = 0:0.002:Tf
y = noise_sol(tv, idxs=noisy_model.inertia.w) |> vec
un = noise_sol(tv, idxs=noisy_model.noise.y)-y |> vec
ud = noise_sol(tv, idxs=noisy_model.load_step.output.u) |> vec
d = iddata(y', [un ud]', 0.002)
lsys,_ = newpem(d, 4, focus=:simulation, zeroD=false) With an LTI model available, we can ask for the theoretical output covariance we should obtain if we feed a white noise signal with covariance matrix sqrt(covar(lsys[1,1],0.1^2*I)), std(y[[50:648; 750:end]]) |
The options are
The text was updated successfully, but these errors were encountered: