How do I add initial conditions in dsolve while solving a system of ODEs in matrix form?

1 次查看(过去 30 天)
Here's a simple code
syms x(t) y(t)
A = [1 2; -1 1];
B = [1; t];
Y = [x; y];
S = dsolve(diff(Y) == A*Y + B);
x = S.x
y = S.y
I am trying to implement something like, x(0)=0 and y(0)=0. How do I add these conditions?

采纳的回答

Paul
Paul 2014-3-3
编辑:Paul 2014-3-3
S = dsolve(diff(Y) == A*Y + B, Y(0)==[0;0]);
see:
doc dsolve

更多回答(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