Group Abstract Group Abstract

Message Boards Message Boards

0
|
7.8K Views
|
9 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Solve a system of 7 nonlinear equations with 7 variables?

Hello, everyone. I am a learner of Mathematica. I want to solve a CSTR system of 7 nonlinear equations consists of 6 mass balance equations and one energy balance with 7 variables. But NSolve can't solve and findroot doesn't give me realistic solutions. Can someone help me out? thank you.

Attachments:
POSTED BY: Jake Chen
9 Replies
Posted 6 years ago

As an experiment I tried using NMinimize on the sum of the squares of your seven equations with options Method->"RandomSearch" and MaxIterations->1000. That returned estimated parameters and a minima that was far from zero.

I then used the seven reported parameter values as starting locations in FindRoot with option MaxIterations->1000. I then evaluated the left hand side of the seven equations with the revised parameter values that it found and again some of the results were not close to zero.

I then used FindRoot again with the seven revised parameters for starting values and MaxIterations->1000, evaluated the left hand side of the seven equations with the newly estimated parameter values and found that all the results were very close to zero.

Because there is a random element in this the results may vary from one attempt to another.

I also tried adding broad constraints on the ranges of the parameters in NMinimize, to see if I might guide it to finding solutions with smaller parameter values. That was not as successful.

You might try this and see if you get similar results.

This does not deal with local minima or how many solutions there might be or unrealistic parameter values.

POSTED BY: Bill Nelson

Exothermic reactions in Continuously Stir Tank Reactors exhibit multiple steady-states. One way of dealing with these types of problems is to eliminate the steady-state assumption and solve the transient Ordinary Differential Equation out to many residence times using NDSolve. The steady-state that NDSolve will find will depend on your initial and boundary conditions. You could try recasting your equations into a system of ODEs similar to what is on the last page of this PDF.

Prof. Brian Higgins has a website with many downloadable Mathematica notebooks related to chemical engineering. You may want to take a look at the nonisothermalCSTR.nb for additional ideas.

POSTED BY: Tim Laska

Thank you for your help. And I will try to use the transient equation to solve that.

POSTED BY: Jake Chen

Hi Jake,

I took another look at your problem and I think it is fundamentally ill-posed. Your reaction equations need to be linearly independent. You have 5 reactions, but only 3 are independent. You can check my reasoning below.

I am assuming that I can extract a stoichiometric matrix, $\nu$, from you combustion energy equations or

(*combustion energy*)
DELCP1[T_] := CPB[T] + CPD[T] - CPA[T] - 0.5*CPC[T]
DELCP2[T_] := 2*CPE[T] + 3*CPD[T] - CPA[T] - 3.5*CPC[T]
DELCP3[T_] := 2*CPF[T] + 3*CPD[T] - CPA[T] - 2.5*CPC[T]
DELCP4[T_] := 2*CPE[T] + 2*CPD[T] - CPB[T] - 3*CPC[T]
DELCP5[T_] := 2*CPF[T] + 2*CPD[T] - CPB[T] - 2*CPC[T]

This should lead to the following $\nu$ matrix

nu = {
  {-1, 1 , -1/2, 1, 0, 0},
  {-1, 0, -7/2, 3, 2, 0},
  {-1, 0, -5/2, 3, 0, 2},
  {0, -1, -3, 2, 2, 0},
  {0, -1, -2, 2, 0, 2}
  };

The function MatrixRank[] returns the number of linearly independent rows or columns. When applied to $\nu$, we obtain

In[7]:= MatrixRank[nu]

Out[7]= 3

Therefore, only three of you reactions are independent and you have over specified your system with 5 reactions and over constrained systems are not solvable.

POSTED BY: Tim Laska

That’s a really big problem. I have rewrite to 3 equations. You are lifesaver.

POSTED BY: Jake Chen

hey. I found 7 equations won't change even these 5 reaction are not all linearly independent since there are 6 species corresponding to 6 mass balances and 1 energy balance. But I still can reduce my 5 reactions to 3 reactions, simplifying my 7 equations.

POSTED BY: Jake Chen

Can someone help me for this problem? I will really appreciate your help.

POSTED BY: Jake Chen

Did you give FindRoot realistic starting values?

POSTED BY: Frank Kampas

I don’t know what’s the realistic starting values because it is too broad for this system. I only know the range maybe 1000-2000 for T

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