フィルターのクリア

Solve ODE in different time intervals

1 回表示 (過去 30 日間)
maro
maro 2013 年 3 月 27 日
I want to solve ODE as a function over three different intervals [0,1],[1,1.2] and [1.2,3].
My function to solve my ODE is "solveODE" as following:
function [x, tinter, xinter] = solveODE(xdot, T, t0, ...
x0, u)
[tinter,xinter] = ode45(xdot, ...
[t0, t0+T], x0,u);
x = xinter(size(xinter,1),:);
end
where: "xdot" is my ODE function here k1 is constant has different valuesaccording to each of three intervals.
ODE function to be solved is as following:
function xprime = xdot(t, x, u, T)
xprime =[x(2);...
-k1*x(2)+k4*u(1)];
end

回答 (1 件)

maro
maro 2013 年 3 月 27 日
up

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by