how to change the integrator initial conditions?

2 次查看(过去 30 天)
In simulink I am using the integrator block. I know that the initial condition defaults to t=0. How would I change that so my initial condition starts at t=9?

回答(1 个)

stozaki
stozaki 2020-2-5
Hello,
ret = find_system(bdroot(gcs),'BlockType','Integrator')
for N = 1:length(ret)
set_param(ret{N},'InitialCondition','9')
end
Please try its script.
  2 个评论
Trevor Hutchinson
This isn't quite the issue I am having. I am trying to solve a 2nd order diff eq using two integrator blocks. The equation is piecewise meaning my initial conditions change with respect to time. For example my first equation has initial conditions at t=0, but then my second equation has initial conditions at t=9. This suggestion tells my code that at t=0 the solution is 9.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Dependency Analysis 的更多信息

产品


版本

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by