Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: Solve the system of equations III
Replies: 3   Last Post: Feb 17, 2013 6:16 AM

 Messages: [ Previous | Next ]
 Milos Milenkovic Posts: 185 Registered: 4/4/09
Re: Solve the system of equations III
Posted: Feb 17, 2013 6:16 AM

Dear Bruno,
thanks!!!
Best,
M

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <kfqcub\$lo9\$1@newscl01ah.mathworks.com>...
> A=[2674.015 1007.506 -979.980 673.29 -1332.007 7.506;-5.317 -1.969 1.750 -1.291 2.777 -1.969;-2808.466 -1058.120 1028.797 -707.075 1399.196 -1058.120;-5363.677 -2020.687 1964.589 -1350.219 2672.592 -2020.687;5382.325 2027.684 -1971.321 1354.875 -2681.975 2027.684;-9.889 -3.691 3.424 -2.442 5.055 -3.692]
>
> B=[-1.679 -1.266 -120.123 -0.166 -0.686 -1.266;-0.525 -0.432 -43.874 -0.0375 -0.303 -0.432;4.714 4.857 685.238 -0.057 5.058 4.857;-0.274 -0.255 -28.164 -0.0077 -0.230 -0.255;1.229 0.805 66.092 0.171 0.208 0.805;-0.525 -0.432 -43.874 -0.037 -0.303 -0.432]
>
> C=[9.931 3.696 -12.773 2.510 -5.066 3.696;3.578 1.306 -10.479 0.916 -1.885 1.306;-65.536 -30.400 -1258.341 -14.196 18.926 -30.400;2.334 0.879 -0.849 0.588 -1.163 0.879;-5.592 -2.142 -7.170 -1.383 2.709 -2.142;3.578 1.306 -10.479 0.916 -1.885 1.306];
>
> % Solve
> n=length(A);
> P = zeros(n);
> P(1:end)=1:n^2;
> Q = kron(speye(n),B);
> Q = Q(:,P');
> M = kron(A',speye(n)) + Q;
> X = M \ C(:);
> X = reshape(X,[n n]);
>
> % Check
> norm( X*A+B*X'-C)/norm(X)
>
> % Bruno

Date Subject Author
2/16/13 Milos Milenkovic
2/17/13 Bruno Luong
2/17/13 Bruno Luong
2/17/13 Milos Milenkovic