Re: NSolve problem
- To: mathgroup at smc.vnet.net
- Subject: [mg59325] Re: NSolve problem
- From: Wonseok Shin <wssbus at gmail.com>
- Date: Fri, 5 Aug 2005 01:23:07 -0400 (EDT)
- References: <dcsc67$q0k$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
On 2005-08-03 23:21:59 -0700, Enrique Zeleny <ezeleny at fcfm.buap.mx> said:
>
>
> Hi
> I f I try to solve these equations
>
> Solve[{2 x + 3 y == 8 + I 7,
> 3 x + y == 5 + 7 I, -2 I x + (1 + 3 I) y == 3 + 5 I}]
>
> the result is
>
> {{x -> 1 + 2*I, y -> 2 + I}}
>
> but if I have
>
> Solve[{2 x + 3 y == 8 + I 7,
> 3 x + y == 4.99999999999999 + 7 I, -2 I x + (1 + 3 I) y == 3 + 5 I}]
>
> gives
>
> \!\(\*FormBox[
> RowBox[{\(RowReduce::"luc"\), \(\(:\)\(\ \)\), "\<\"Result for \
> \\!\\(TraditionalForm\\`RowReduce\\) of badly conditioned matrix \
> \\!\\(TraditionalForm\\`\\((\[NoBreak] \\(\[LeftSkeleton] 1 \
> \[RightSkeleton]\\) \[NoBreak])\\)\\) may contain significant numerical \
> errors. \\!\\(\\*ButtonBox[\\\"More\\\",
> ButtonStyle->\\\"RefGuideLinkText\\\
> \", ButtonFrame->None, ButtonData:>\\\"General::luc\\\"]\\)\"\>"}], \
> TraditionalForm]\)
>
>
> {}
>
>
> I need only an aproximate result, say 5 digits of precission, how can I
> override the NSolve behavior?
>
>
> Thanks in advance
The set of equations is composed of three equations of two unknowns.
Therefore it is basically a linearly dependent set of equations. You
can see that (3/7 + 11/7*I) * (1st equation) + (-2/7 -12/7*I) * (2nd
equation) = (3rd equation). It means solving three equations is
equivalent to solving first two equations.
If you change the RHS of second equation as you did 5 --> 4.999999, you
can't generate the 3rd equation with a combination of 1st and 2nd
equation any more, so Mathematica gives no solution.
If you want only approximate solutions, the best way is to use N[expr,
n], where 'n' means 'n-digit precision.'
Try the following:
N[Solve[{2 x + 3 y == 8 + I 7,
3 x + y == 5 + 7 I, -2 I x + (1 + 3 I) y == 3 + 5 I}], 5]
--
Wonseok Shin
wssaca at gmail.com