Message Boards Message Boards

GROUPS:

ComplexExpand_NSolve_Problem

Posted 9 years ago
4665 Views
|
5 Replies
|
3 Total Likes
|

Hello,

I am facing problem in ComplexExpand with NSolve for 3 variables, as shown in the attached file.

Please suggest me . thanks

Attachments:
POSTED BY: Kashif Nazar
5 Replies

Hello Sir,

As you suggested the command , that was really helpful for me but now again facing problem in the case of 5-variables, please see the file in attachment. When i run the file for the case of system of 5 equations with 5 variables, my system gets stuck and stop working, please suggest me.

Thanks

Attachments:
POSTED BY: Kashif Nazar

It's probably outside what NSolve methods can handle. Might try using FindRoot or FindMinimum of a sum of squares to get isolated real roots.

POSTED BY: Daniel Lichtblau

Thanks Sir ,

Your suggestion is really useful and it worked well for my Case.

Once again Thanks a lot

POSTED BY: Kashif Nazar

I am not able to replicate the problem, at least in Mathematica 10.0.2.

exp1 = 
  ComplexExpand[
    Im[(1 + I)/(2 + 3 I - bb) + (1 + I)/(2 + 3 I - cc)] + 
     Im[(1 + I)/(2 + 3 I - dd)]] - 3.5;
exp2 = ComplexExpand[
    Im[(2 + 2 I)/(3 + 4 I - bb) + (2 + 2 I)/(3 + 4 I - cc)] + 
     Im[(2 + 2 I)/(3 + 4 I - dd)]] - 0.75;
exp3 = ComplexExpand[
    Im[(3 + 3 I)/(5 + 7 I - bb) + (3 + 3 I)/(5 + 7 I - cc)] + 
     Im[(3 + 3 I)/(5 + 7 I - dd)]] - 0.75;
eq5s = {exp1, exp2, exp3};
varr2 = {bb, cc, dd};
Timing[solns = NSolve[eq5s, varr2];]

(* Out[20]= {2.727674, Null} *)

In[21]:= Length[solns]

(* Out[21]= 48 *)

Earlier versions used a different mathod and may be slower. One thing that works in version 9 is to clear denominators.

polys = Numerator[Together[eq5s]]

Now NSolve[polys, varr2] will be quite fast.

POSTED BY: Daniel Lichtblau

It looks like there are too many solutions for NSolve to enumerate. Possibly reformulate the problem using FindRoot. You then have to provide rough estimates for the 3 vector solutions.

POSTED BY: S M Blinder
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract