|
"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <gqdfoj$es8$1@fred.mathworks.com>...
> "Shane " <black.gentz@hotmail.de> wrote in message <gqde7a$lr6$1@fred.mathworks.com>...
> > "Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <gqd7sp$9t2$1@fred.mathworks.com>...
> > > "Shane " <black.gentz@hotmail.de> wrote in message <gqd6us$7m9$1@fred.mathworks.com>...
> > >
> > > >
> > > >
> > > > Thanks for the clearings.
> > > > I tried to built the A Matrix in another way. So the new equation is A*x=B.
> > > > But when I try to solve this problem with x=A\B or x=inv(A)*B, then the results is not quite correct.
> > >
> > > Why you think it is not correct? Usually Matlab always gives a (numerically) consistent result: least-square, and least-norm when using PINV.
> > >
> > > It might not what you are expecting, but you have not told us why.
> > >
> > > >I guess it must be a rounding error or something like that.
> > > > Is it possible solve this problem in another way, e.g. an iteration method??
> > > >
> > >
> > > You could provide a tolerance in PINV, that cut the rank, or using the iterative method and let it not totally converging.
> > >
> > > But again, keep in mind that you are dealing with ill-posed linear system, and there are an infinity number of solutions. Matlab pick a result that you don't like, but because you had not tell it what you really want.
> > >
> > > Bruno
> >
> >
> > The right solution of the my problem is:
> > x=(149,344; 149,004; 156,321; 157,021; 156,568; 155,871; 155,049; 153,96; 151,631; 142,069].
>
> And what indicated this is "more" right?
> >
> > But with the command x=b'/A I get for x:
> > x=[149,465; 149,995; 154,4257; 154,8244; 154,5465; 154,1209; 153,5739; 152,5583; 148,8012; 127,751]
> >
> > and with the command x=inv(A)*b or x=pinv(A)*b the result is:
> > x=[149.292; 149.852; 154.273; 154.670; 154.386; 153.916; 153.086; 150.276; 135.100; 143.012]
>
> I fail to see why they are not right? Both solutions satisfy A*x = b, and that's the only target of a linear inversion.
>
> >
> > so you can see that there is a difference between each solution.
>
> Yes, and I'm not surprised.
>
>
> >My Question is if the is anothe method so solve the equation. I guess the problem is the A-Matrix, because the condition is not really good, cond(A)=49,0233.
>
> You can even take any combination of the three above solutions
> x = c1*x1 + c2*x2 + c3*x3, with sum ci = 1
>
> And you still have
> A*x = b.
>
> Allow me to repeat one more time: there are an infinity of solutions. If you cannot clearly *formulate* what solution is right for you, you might spend a lot of time chasing forever the algorithm that gives the "right" solution.
>
> Second alternative: you just have to accept that the solutions given by an algorithm can be also "right".
>
> Bruno
Hi Bruno,
now I clearly understand what you mean. Thats the point, how can I say to Matlab, which solution he had to pick or rather what kind of options I have to say which solution is right for me??
|