MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Help! 6 equation non-linear system

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99714] Re: [mg99681] Help! 6 equation non-linear system
  • From: Daniel Lichtblau <danl at wolfram.com>
  • Date: Tue, 12 May 2009 03:07:44 -0400 (EDT)
  • References: <200905111023.GAA06881@smc.vnet.net>

Marc wrote:
> I'm very new to Mathematica, and I'm trying to solve a fairly complex
> system involving 3 non-linear implicit equations (Colebrook
> equations). I've tried just doing a Solve and NSolve function, but my
> Core 2 Duo @ 2.2GHz with 3 GB ram running on XP runs out of memory and
> can't produce anything.
> 
> Here are my equations:
> 
> 190200=999*V3^2/2-999*V1^2/2+33266.7*f3*V3^2+166533*f1*V1^2+14185.2*V3^2
> 
> 180400=999*V2^2/2-999*V1^2/2+199800*f2*V2^2+166533*f1*V1^2+25874.1*V2^2
> 
> V1=V2+V3
> 
> 1/sqrt(f1)=-2*log(2.7*10^-5+1.88*10^-4/(V1*sqrt(f1)))
> 
> 1/sqrt(f2)=-2*log(2.7*10^-5+1.88*10^-4/(V2*sqrt(f2)))
> 
> 1/sqrt(f3)=-2*log(2.7*10^-5+1.88*10^-4/(V3*sqrt(f3)))
> 
> 
> Variables:
> 
> V1: should be in the range 0 < V1 < 20
> V2: should be in the range 0 < V2 < 10
> V3: should be in the range 0 < V3 < 10
> f1: should be in the range 0 < f1 < 0.1
> f2: should be in the range 0 < f2 < 0.1
> f3: should be in the range 0 < f3 < 0.1
> 
> 
> Any help would be greatly appreciated, I'm stuck!!

Main suggestions:

(1) Use actual Mathematica syntax.

(2) Use FindRoot, with starting points inside the domain of interest. 
You will not be able to use NSolve because you do not have a polynomial 
system of equations in the variables of interest (due to presence of logs).

c1 = 27*10^(-6);
c2 = 188*10^(-6);
exprs = {
   999*V3^2/2-999*V1^2/2+332667/10*f3*V3^2+166533*f1*V1^2+
   141852/10*V3^2-190200,
  999*V2^2/2-999*V1^2/2+199800*f2*V2^2+166533*f1*V1^2+
   258741/10*V2^2-180400,
  V2+V3-V1,
  -2*Log[c1+c2/(V1*Sqrt[f1])] - 1/Sqrt[f1],
  -2*Log[c1+c2/(V2*Sqrt[f2])] - 1/Sqrt[f2],
  -2*Log[c1+c2/(V3*Sqrt[f3])] - 1/Sqrt[f3]};

I'll use Chop to get rid of small imaginary parts.

In[44]:= InputForm[solns = Chop[FindRoot[exprs==0,
  {V1,10}, {V2,5}, {V3,5}, {f1,1/20}, {f2,1/20}, {f3,1/20}]]]

Out[44]//InputForm=
{V1 -> 6.009425355323082, V2 -> 2.506571958922738, V3 -> 3.502853396400344,
  f1 -> 0.00433243520465387, f2 -> 0.005321604673945427,
  f3 -> 0.004904934117761941}

Check result:

In[45]:= InputForm[exprs/.solns]
Out[45]//InputForm=
{2.9103830456733704*^-11, 0., 0., 0., 1.7763568394002505*^-15, 0.}

I could get higher precision results by use of higher working precision:

solns = Chop[FindRoot[exprs==0, {V1,10}, {V2,5}, {V3,5},
   {f1,1/20}, {f2,1/20}, {f3,1/20}, WorkingPrecision->20]]

Note that there may be other roots in the range of interest. Indeed, 
tehre must be others, due to the input equation symmetry {V2,V3,f2,f3} 
<--> {V3,V2,f3,f2}.

Daniel Lichtblau
Wolfram Research




  • Prev by Date: Re: Help! 6 equation non-linear system
  • Next by Date: Re: Re: ColorFunction on a linux system (xorg) loses graphics
  • Previous by thread: Help! 6 equation non-linear system
  • Next by thread: Re: Help! 6 equation non-linear system