Message Boards Message Boards

GROUPS:

A graphical solution of two equations is possible. Numerically, too?

Posted 10 years ago
5235 Views
|
3 Replies
|
0 Total Likes
|
Hi everyone,

just signed up to the forum after failing to find a solution for quite a while.
Where I am stuck is the following. After a little of plasma physics I end up with two equations which are functions of two variables.

F[nccm, TcineV] == 0
G[nccm, TcineV] == 0

Now I am looking for a pair (nccm, TcineV) which satisfies both equations at the same time.

I hoped this would be straight forward, but it turns out not to be as you can see from the attached notebook;

NSolve does not give an answer (just repeats the question), NMinimize just sticks to a solution at the limit of the physical value. Finding a graphical solution sort of works, but is not very convenient, as I will have to evalute these equations for a large number of parameters.

Is there a more clever way to solve these equations/shuffle them in a more appropriate form for Mathematica?

Help would be very much appreciated!

Cheers,

Niels
 (*Function F named EnEqZeroF as it originates from energy conservation: *)
 EnEqZeroF = -2.46`*^18 -
   1/(nccm3^4 TcineV^2)1.9920982277963014`*^61 E^(
    49.2`/TcineV) (1.` + 0.01` TcineV)^4 (-404771.5405015526` +
      TcineV^(7/2));
 
 (*Function G named partBalZero as it originates from particle balance considerations: *)
 partBalZero =
  200000000000000000 -
  1/(nccm3^3 TcineV^(3/2)) 2.6999484623235618`*^39 E^(
   36.900000000000006`/
    TcineV) (-4000000000000 + nccm3) (1.` +
     0.01` TcineV)^3 \[Sqrt](((-4000000000000 + nccm3) (0.4` +
           TcineV) -
        4.`*^12 TcineV Log[
          1.` + 2.5`*^-13 (-4000000000000 + nccm3)])/(-4000000000000 +
         nccm3));

(* Does not work at all: *)
NSolve[{EnEqZeroF == 0, partBalZero == 0}, {TcineV, nccm3}, Reals]

(* Graphical solution seems to work: *)
ContourPlot[{EnEqZeroF == 0, partBalZero == 0}, {TcineV, 0,
  15}, {nccm3, 1*^12, 1.5*^14},
AxesLabel -> {"\!\(\*SubscriptBox[\(T\), \(c\)]\) in eV",
   "\!\(\*SubscriptBox[\(n\), \(c\)]\) in \
\!\(\*SuperscriptBox[\(cm\), \(-3\)]\)"},
PerformanceGoal -> "Quality"]

(* However, the the graphical solution, Tc~2.5 eV, nc ~ 1.2*10^14 cm^-3 is not found numerically:*)
NMinimize[{Abs[EnEqZeroF - partBalZero], 0 < TcineV < 40,
  nccm3 > 4.0*^12}, {TcineV, nccm3}]
NMinimize[{Abs[EnEqZeroF - partBalZero], 0 < TcineV < 40,
  nccm3 > 4.0*^12}, {TcineV, nccm3}, Method -> "NelderMead"]
NMinimize[{Abs[EnEqZeroF - partBalZero], 0 < TcineV < 40,
  nccm3 > 4.0*^12}, {TcineV, nccm3}, Method -> "DifferentialEvolution"]
NMinimize[{Abs[EnEqZeroF - partBalZero], 0 < TcineV < 40,
  nccm3 > 4.0*^12}, {TcineV, nccm3}, Method -> "SimulatedAnnealing"]
NMinimize[{Abs[EnEqZeroF - partBalZero], 0 < TcineV < 40,
  nccm3 > 4.0*^12}, {TcineV, nccm3}, Method -> "RandomSearch"]
POSTED BY: Niels Nutzer
3 Replies
FindRoot seems to work somewhat, given two starting values for each variable.
In[9]:= FindRoot[{EnEqZeroF==0,partBalZero==0},{{TcineV,2.4,2.6},{nccm3,1.1 10^14, 1.3 10^14}}]
During evaluation of In[9]:= FindRoot::cvmit: Failed to converge to the requested accuracy or precision within 100 iterations. >>Out[9]= {TcineV->2.6472,nccm3->6.18116*10^13}
It would probably help if you scale nccm3 so you don't have such large numbers in your functions.
POSTED BY: Frank Kampas
You may take a look at this discussion
POSTED BY: Shenghui Yang
Posted 10 years ago
Is it possible that the output from ContourPlot is misleading you into thinking it is showing a solution for EnEqZeroF==0 and partBalZero==0?
In[2]:= NMinimize[{Abs[EnEqZeroF]+Abs[partBalZero], 0<TcineV<40, nccm3>4.0*^12},
{TcineV, nccm3}, Method->"RandomSearch", MaxIterations -> 10^4]

Out[2]= {2.*10^17, {TcineV -> 6.30873, nccm3 -> 4.*10^12}}

In[3]:= Plot3D[Abs[EnEqZeroF]+Abs[partBalZero], {TcineV,0,40}, {nccm3,1*^12,1.5*^14}]
(*which because of the vast range isn't showing much information about the minimia of that.*)
POSTED BY: Bill Simpson
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