Message Boards Message Boards


Solving symbolically a system of 3 (complicated) equations

Posted 7 months ago
12 Replies
4 Total Likes

Hello, I am trying to solve the following system of three equations with three variables, pd, pf and lambda. When I impose the parameters a and cf, for instance (a=1/3 and cf=1), I can solve numerically the system with NSolve (very quickly). My problem is that I want to solve it symbolically (more specifically without imposing any a and cf) and in this case Mathematica runs for a very long time (I aborted the results after 14 hours). Any idea what I should do ?

dfl=D[f[lambda ],lambda]


  (1+fl)^3/dfl ==10*pn^3*pd^(-3)*(pd-cd)*pf^(-2)

sol = Solve[eqns1,{pd,pf,lambda}]
12 Replies

Since a appears as a power you have a transcendental system in that parameter. So it is unlikely to lend itself to known methods for solving.

Thank you for your answer. I understand your argument, but if I try to declare a=2/3 and let cf unknown it shouldn't be the case anymore. The three (simplified) equations to solve become

5 pd + 18/5 (-2 + 1/(8 + (5 (1 + lambda^(2/3))^2 pf^2)/pd^2)) == 0, 
 pf + cf (-(3/2) + 1/(-2 (1 + 4 lambda^(2/3) + 2 lambda^(4/3)) - (4 (1 + lambda^(2/3))^4 pf^2)/pd^2)) == 0, 
 3/2 (1 + lambda^(2/3))^3 lambda^(1/3) == (10 (-(6/5) + pd))/(pd^3 (1/pd^2 + 1/((1 + lambda^(2/3))^2 pf^2))^(3/2) pf^2)

but still, it seems Mathematica keeps running without finding a solution...

The first two equations can be solved in terms of lambda^a, then you can replace into the other equations:

sol1 = Solve[eqns[[1]] /. lambda^a -> la, la]
sol1 /. la -> lambda^a
Simplify[eqns[[2]] /. lambda^a -> la /. sol1] // Union
Simplify[eqns[[3]] /. lambda^a -> la /. sol1 /. 
   la -> lambda^a] // Simplify

Hello Olimpia, why do you want to have a symbolic solution?

If it exists at all it will be terribly complicated ( I got intermediate expressions of third order and accordingly three solutions, some with complex terms) and I suppose you won't "see" anything with it.

Posted 7 months ago

Thank you Gianluca for your answer! I have tried following your way, and the problem now seems to be that I have lambda^(1-a) in the third equation. Therefore, I have tried
1) solving the first equation in term of lambda^a, as you suggested 2) solving the third one in terms of lambda^(1-a) 3) replacing into the second equation. I don't yet whether it is working because it is still running... This way however I only reduce my system into a system of two equations...

Dear Hans, thank you for your message. I have the hope that I will be able to interpret in some general ways the effect of the parameters. As I said, the model is easy to solve numerically (even in a much more complex version) but my choices of parameters remain very arbitrary...

Once you have the value for lambda^a from the first equation and for lambda^(1-a) from the third, you can replace them into lambda^a*lambda^(1-a)=lambda and get the value of lambda.

Dear Olimipia, thanks for your answer.

But what exactly do you want? Look at the code below. Mma solved the 1st equation quite quickly for pd, but you get three (already complicated) solutions, and each should be inserted to the remaining equations to be solved further. The result is not really convenient.

Of couse one can solve the 1st equation for pf, giving only two solutions to be inserted in the rest, but is this easier? Not really.

f[x_] := x^a
fl = f[lambda];
dfl = D[f[lambda], lambda];
cd = 12/10;

pn = ((pf*(1 + fl))^(-2) + (pd^(-2)))^(-1/2);
sf = (pf*(1 + fl)/pn)^(-2);
sd = (pd/pn)^(-2);

eqns = {pd == (3*(1 - sd) + 6)/(3*(1 - sd) + 5)*cd, 
  pf == (3*(1 - sf*(1 + fl)^(-2)) + 
       2*sf*(1 + fl)^(-2))/(3*(1 - sf*(1 + fl)^(-2)) + 
       2*sf*(1 + fl)^(-2) - 1)*cf, (1 + fl)^3/dfl == 
   10*pn^3*pd^(-3)*(pd - cd)*pf^(-2)}

eq11 = eqns[[1]] // Simplify
solpd = Solve[eq11, pd]

solpf = Solve[eq11, pf]

Good morning Olimpia,

...some further steps (with the code from above). And of course you could choose other approaches. Use the first solution of solpf and an abbreviation for the lambda-term

eq21 = (eqns[[2]] /. solpf[[1, 1]] // Simplify) /. lambda^a -> lam /.   lambda^(2 a) -> lam^2

Bring everything on one side of the equation and get rid of the denominator (which must be checked for being non-zero. hmmm complicated)

eq21a = Together /@ ((# - eq21[[1]]) & /@ eq21)
eq21b = Numerator[#] & /@ eq21a

And now solve for pd (or lam) , which both don't give expressions which I would call convenient

Solve[eq21b, pd]

And we are not at the end, there is another equation to be dealt with.

I think here one gets an idea why Mathematica works for hours.......

Posted 6 months ago

Dear Hans, thank you very much for your message and work. What I am looking for is mainly to be able to compare pd and pf in function of a and cf (or their ranges). I admit this way seems very complicated... I have now solved for lambda using Gianluca's way, but Mathematica is still not able to solve for pd and pf the system made of the two first equations in a reasonable amount of time. I will let you know if I find some other easier way to do it...

Thank you for your answer Gianluca! I have tried this way but Mathematica still doesn't solve for pd and pf (it has been running for a couple of days..) In a first time I have tried replacing lambda in equations 1 and 2 to solve, and then in equations 1 and 3. I will now try with equations 2 and 3 but I guess the problem remains too complicated...

With these calculations you get lambda and cf as functions of a,pd,pf plus a compatibility condition between a,pd,pf:

(solLa = Solve[eqns1[[1 ;; 2]] /. lambda^a -> la, {la, cf}]) /. 
 la -> lambda^a
solLambda1 = 
    eqns1[[3]] /.
      { lambda^a -> la, 
       lambda^(1 - a) -> lambda/la} /. solLa[[1]]], lambda]]
solLambda2 = 
    eqns1[[3]] /.
      { lambda^a -> la, 
       lambda^(1 - a) -> lambda/la} /. solLa[[2]]], lambda]]
(la /. solLa[[1]]) == (lambda /. solLambda1)^a
(la /. solLa[[2]]) == (lambda /. solLambda2)^a

The compatibility condition a,pd,pf is not algebraic, because the variable a appears at the exponent. I doubt you can solve it explicitly.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract