MATLAB: Matlab systems of differential equations solution using syms

laplacesymbolic

Hi guys, I am trying to solve the following equations in terms of X(s) and Y(s). However, its says cannot find an explicit solution. What am I doing wrong? Hope anybody could help me. Thank you.
%Time domain equations:
%eq1 = x'+4y'-x = cos(t)
%eq2 = 3x' + y' = 0
syms X(s) Y(s) s
%Laplace transform
eq1 = s*X(s)+4*s*Y(s)-X(s)==s/((s^2)+1);
eq2 = 3*s*X(s)+s*Y(s)==0;
solve([eq1 eq2])

Best Answer

syms X Y s
%Laplace transform
eq1 = s*X+4*s*Y-X==s/(s^2+1);
eq2 = 3*s*X+s*Y==0;
[solX solY] = solve([eq1 eq2],[X Y])
Related Question