Finding particular solution to 3x3 matrix using undetermined coefficients
4 ビュー (過去 30 日間)
古いコメントを表示
Hi all,
I am trying to find the particular solution to the following system of equations:
function xprime = A(t,x)
eqn1 = - x(1)*(15/4) == -1575;
eqn2 = (15/4)*x(1) - (5/12)*x(2);
eqn3 = (5/12)*x(2) - (5/14)*x(3);
Below I went about finding my general solution:
end
A = sym([-15/4,0,0;15/4,-5/12,0;0,5/12,-5/14]);
>> Id3 = sym([1,0,0;0,1,0;0,0,1]);
>> syms lambda
>> B = lambda*Id3 - A
B =
[ lambda + 15/4, 0, 0]
[ -15/4, lambda + 5/12, 0]
[ 0, -5/12, lambda + 5/14]
>> p=det(B)
p =
lambda^3 + (95*lambda^2)/21 + (1025*lambda)/336 + 125/224
>> evs = solve(p)
evs =
-15/4
-5/12
-5/14
>> null(evs(1)*Id3-A)
ans =
152/21
-57/7
1
And now, since the system is non-homogenous...this would give me
[0,0,0] = [(-15/4), 0, 0 ; (15/4), (-5/12), 0 ; 0, (5/12) , (-5/14)] x [a1, b1, c1] + [1575, 0, 0]
This results in the numbers that I was looking for.... Xp: 420, 3780, 4410.
My question is...how can I go about this above equation by way of undetermined coefficients in matlab?
Thanks for any advice you have
0 件のコメント
採用された回答
madhan ravi
2018 年 12 月 9 日
Roots=vpa(fsolve(@solls,[0;0;0])) %function call
function eqn=solls(x) %function definition
eqn(1) = - x(1)*(15/4) + 1575;
eqn(2) = (15/4)*x(1) - (5/12)*x(2);
eqn(3) = (5/12)*x(2) - (5/14)*x(3);
end
その他の回答 (1 件)
Bruno Luong
2018 年 12 月 9 日
Guys, this is a linear system, why using FSOLVE?
>> [-15/4 0 0; 15/4 -5/12 0; 0 5/12 -5/14]\[-1575; 0; 0]
ans =
420
3780
4410
>>
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!