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

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개)

카테고리

도움말 센터File Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

질문:

2014년 3월 3일

편집:

2014년 3월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by