Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Milos Milenkovic

Posts: 155
Registered: 4/4/09
Re: Solve the system of equations III
Posted: Feb 17, 2013 6:16 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.