Message Boards Message Boards

0
|
5909 Views
|
12 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Solve a system of non-linear equations?

Posted 3 years ago

Hello Everyone! I'm trying to solve a system of non-linear equations using the 'Solve' function in Mathematica 10.0 (code and code file of which are attached herewith). However, the function is not able to solve them. It is running for 2 hours and nothing happened. I have double-checked my equations and I have used space for multiplication.

e1 = Subscript[k, 1] po2^(1/2) cv - Subscript[k, -1] cos - 
    Subscript[k, 7] ccs cos == 0;
e2 = Subscript[k, 2] pch4 cv - Subscript[k, -2] cch4s - 
    Subscript[k, 3] cch4s cv + Subscript[k, -3] cch3s chs == 0;
e3 = Subscript[k, 3] cch4s cv - Subscript[k, -3] cch3s chs - 
    Subscript[k, 4] cch3s cv + Subscript[k, -4] cch2s chs == 0;
e4 = Subscript[k, 4] cch3s cv - Subscript[k, -4] cch2s chs - 
    Subscript[k, 5] cch2s cv + Subscript[k, -5] cchs chs == 0;
e5 = Subscript[k, 5] cch2s cv - Subscript[k, -5] cchs chs - 
    Subscript[k, 6] cchs cv + Subscript[k, -6] ccs chs == 0; 
e6 = Subscript[k, 6] cchs cv - Subscript[k, -6] ccs chs - 
    Subscript[k, 7] ccs cos == 0;
e7 = Subscript[k, 7] ccs cos - Subscript[k, 9] ccos + 
    Subscript[k, -9] pco cv == 0;
e8 = Subscript[k, 8] chs^2 - Subscript[k, 10] ch2s + 
    Subscript[k, -10] ph2 cv == 0;
e9 = Subscript[k, 3] cch4s cv - Subscript[k, -3] cch3s chs + 
    Subscript[k, 4] cch3s cv - Subscript[k, -4] cch2s chs + 
    Subscript[k, 5] cch2s cv - Subscript[k, -5] cchs chs + 
    Subscript[k, 6] cchs cv - Subscript[k, -6] ccs chs - 
    Subscript[k, 8] chs^2 == 0;
e10 = 6 cv + cos + cch4s + cch3s + cch2s + cchs + ccs + 4 chs + 
    2 ch2s + ccos == ct;

Solve[{e1, e2, e3, e4, e5, e6, e7, e8, e9, e10}, {cos, cch4s, cch3s, 
  cch2s, cchs, ccs, ccos, ch2s, chs, cv}]
Attachments:
12 Replies
Posted 3 years ago

Have you noticed that solving your first nine equations for your first nine variables happens very quickly? And your tenth equation is just the sum of the previous nine variables? Then you can substitute the nine solutions into your tenth equation which should eliminate most of the variables and leave you with one large equation to study.

Most of those solutions appear as Roots. Using InputForm on those solutions might enable you to see the details. This might give you some insight into the form of the tenth equation as a sum of nine roots. Using Simplify on this may or may not help you.

You might be able to force some of those roots into algebraic form, but the results would likely be much larger and more complicated and make understanding the structure more difficult.

Hopefully this will give you another way of looking at your problem.

POSTED BY: Bill Nelson

Thank you so much @ Bill Nelson. I noticed that the first nine equations are solving quickly and are giving a very long analytical solution.

However, I am confused about how these are getting solved because these are 10 simultaneous dependent equations containing 10 dependent variables and in order to get a unique solution, one has to solve them simultaneously. The first 9 equations already contain all these 10 variables.

Also, I am not able to understand the solution in terms of Root and #.

Posted 3 years ago

Notice all your first nine equations include cv which is your tenth variable. Thus all those solutions to the first nine equations will depend on that tenth variable. When you substitute those nine solutions into the tenth equation I believe all variables except cv will be eliminated. Your goal was to eliminate those nine variables and I believe this quickly accomplishes the first step. If you then find the solution to this resulting equation you will have eliminated all ten variables and satisfied all ten equations.

The solution to this may be too complicated to explicitly solve in terms of square roots and powers of variables. Hopefully if you study the result carefully it might provide you with some understanding of your problem.

If you carefully read all the documentation for the Mathematica function named "Function" then this might help you a little in understanding the meaning of # and & inside the Root expressions. I understand this can be somewhat confusing for a new user of this.

POSTED BY: Bill Nelson

Thank you Bill for this much help. I have successfully eliminated the first 9 variables and substituted those 9 solutions in the 10th equation. Solve function is unable to eliminate the 10th variable i.e. cv. It keeps on running for hours.

Solve a system of non-linear equations?

What is ct? It's only used in E10 but is not used as to be calculated variable. So could be anything?

POSTED BY: l van Veen

Yes. It could be anything.

Why do you need an analytical solution for this equation, probably solution is several hundred pages long. Of course if symbolic solution exists.With numeric I have solution in few seconds.

See atthached file.

Attachments:
POSTED BY: Mariusz Iwaniuk

Because I need all those variables written in the 'Solve' function to be in terms of other unknowns. These equations are kinetic equations of a reaction. I can only evaluate those unknowns, but not the variables in the solve function.

I am still looking for help on this. If anyone could give his suggestions, it will be really helpful.

Thank you for your reply. I want to eliminate all these 10 variables coming under the 'solve' function. I want to solve them in terms of the remaining unknowns in the equations, like in the following example, 'x' and 'y' are solved in terms of 'a' and 'c'.

In[10]:= Solve[{x - cy == 0, ax^2 + y^2 == 1}, {x, y}]

Out[10]= {{x -> cy, y -> -Sqrt[1 - ax^2]}, {x -> cy, 
  y -> Sqrt[1 - ax^2]}}

Now it has been 2 days and it is still unsolved. I have even tried without subscripts but not worked.

It's a nonlinear system and well might hang. Also you won't be able to eliminate all those variables and then solve for the rest. Do you want to eliminate that set, or do you want to solve for one set in terms of the other?

POSTED BY: Daniel Lichtblau
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