Group Abstract Group Abstract

Message Boards Message Boards

Solving non-linear system of equations with 2 parameters?

Posted 9 years ago

Hello

I have a system of 3 equations and 3 variables (a,b,L) which depends on 2 parameters (c,g). Hence I need three expressions who relate them (i.e. a(c,g), b(c,g) and L(c,g) ). I just started trying Mathematica so i am not sure I am proceeding in the best possible way to solve the system:

eqns = {(3 Pi*a*c*L) + 
    g*a*b^0.5 + (3/8)*(a^2 + b^2 + 4*a*b) + 99.53*b + 24.13*a == 0, 
  1/L + L*c*Pi - g*b^0.5 + 1 - (3/4)*(a + 2*b) == 0, 
  8/L - 2*b + g*a*b^0.5 + 3/8*(4*b^2 + 8*a*b) == 0}

SolveAlways[eqns, {a, b, L}]

I am getting no output from Mathematica. Is there a better way to solve this system?

Thanks in advance,

Attachments:
POSTED BY: Juan Orozco
4 Replies

I don't recommend decimal exponents mixed with Solve. Or fractional, for that matter. Also there is some confusion as to what exactly is wanted; I'm assuming Solve rather than SolveAlways since that latter would be overdetermined in this instance. If so, might proceed as below.

exprs = {(3 Pi*a*c*L) + 
    g*a*b^(1/2) + (3/8)*(a^2 + b^2 + 4*a*b) + 99.53*b + 24.13*a, 
   1/L + L*c*Pi - g*b^(1/2) + 1 - (3/4)*(a + 2*b), 
   8/L - 2*b + g*a*b^(1/2) + 3/8*(4*b^2 + 8*a*b)};
exprs2 = Rationalize[PowerExpand[exprs /. b -> sqrtb^2]]

(* Out[21]= {(2413 a)/100 + 3 a c L \[Pi] + a g sqrtb + (9953 sqrtb^2)/
  100 + 3/8 (a^2 + 4 a sqrtb^2 + sqrtb^4), 
 1 + 1/L + c L \[Pi] - g sqrtb - 3/4 (a + 2 sqrtb^2), 
 8/L + a g sqrtb - 2 sqrtb^2 + 3/8 (8 a sqrtb^2 + 4 sqrtb^4)} *)

It's not a small result.

Timing[soln = Solve[exprs2 == 0, {a, sqrtb, L}];]
Length[soln]
LeafCount[soln]

(* Out[22]= {8.985855, Null}

Out[23]= 16

Out[24]= 19332689 *)
POSTED BY: Daniel Lichtblau
Posted 9 years ago

Indeed I am aware it would not be small result, but I still wonder if I can expect Mathematica giving me a symbolic relation as the one I aim to have (the example I posted some mins ago). In your post i also see a numerical solution.

Does Mathematica provide a symbolic result for a system of equations like the one I am dealing with?

POSTED BY: Juan Orozco
Posted 9 years ago

Maybe an example of what I am looking for will make my task more clear for the discussion. If b=0, a solution for the system is something like:

L=(2*c)^(-0.5)
a = (8/3)*(0.5-c^0.5)

In this case there is no dependency on g, because it vanishes from the system when b =0. So what I need to find is those expressions (L(c,g) and a(c,g) ) for all the possible values of b (i.e. another expression of b as a function of c and g).

So yes, I can try a numerical approach as Frank suggests, but then I would know how to get the general expression out of the numerical values (and how many should I try !?).

POSTED BY: Juan Orozco

If you pick values for b and c and starting values for a,b and L, you can get a solution.

In[14]:= FindRoot[eqns /. {c -> 1, g -> 1}, {{a, 1}, {b, 1}, {L, 1}}]

Out[14]= {a -> 3.83643 - 2.65186 I, b -> -1.10697 + 0.44379 I, 
 L -> 0.0626543 + 0.521649 I}
POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard