Multi formula ode implementation

2 次查看(过去 30 天)
How do i implement an ODE defined by more than one formula.

采纳的回答

Ameer Hamza
Ameer Hamza 2020-10-5
You can define it in the ODE function
IC = 0; % initial conditions
tspan = [0 10]; % initial conditions
ode45(@odefun, tspan, IC)
function dxdt = odefun(t, x)
if x < 0
dxdt = -x;
else
dxdt = x.^2;
end
end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by