Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let me first explain what I am doing and then I will explain the problem that I can't figure out. I am basically trying to solve 2 equations for 2 unknowns (a1 and a2) with some given definitions such as GL1 GL2 GC1 and GC2. With the given code below, I solved the unknowns in terms of some parameters and (C1 and C2). However, I want to substitute the equations of C1 and C2 in the solutions. I tried to put the equations first like given GL1 GL2 GC1... But I didn't get any answers then I tried to solve it without putting C1 and C2 and I got an answer. I now try to substitute those by using Simplify, but I don't get any answers again. I need some help to solve these equations. Please check my code below.

GL1 = fd a1 t Y1;
GL2 = fd a2 t Y2;
GC1 = (Y1 + Y2) (1 - fd) t p;
GC2 = (Y1 + Y2) (1 - fd) t q;

  Solve[((GC1 - GL1) q / (GC2 - GL2) p) (a2/a1) - (C2/Y1)/(C2/Y2) == 0 && 
    a ((GC1/(1 -    fd) - GL1/fd)/C1 + (GC2/(1 - fd) - GL2/fd)/C2) + 
    2 b (1 - 2 fd)/fd (1 - fd) == 0, 
  {a1, a2}] ] 

Solutions: (2 roots for a1 and a2)
{{a1 -> 1/(2 a C2 fd^2 t Y1 (p q Y1^2 - ...,
  a2 -> 1/(2 a C1 fd^2 t Y2 (-p q Y1^2 + ...
 {a1 -> 1/(2 a C2 fd^2 t Y1 (p q Y1^2 - ..., 
  a2 -> 1/(2 a C1 fd^2 t Y2 (-p q Y1^2 + ..}}

Now as we see solutions are in terms of C1 and C2, I want to substitute these two equations:

   C1 =  (1 - t (fd a1 + (1 - fd))) Y1;
   C2 =  (1 - t (fd a2 + (1 - fd))) Y2;

When I substitute these equations and try to Simplify I don't get any answers, I think the kernel goes into a infinite loop. Any suggestions.

share|improve this question
I edited your question a bit. Remember: inline code can be made with `` code `` anywhere in the text. When you give code-blocks, try to make them copy- and pastable by including only valid Mathematica code and putting output into comments. In general, if the code is too large, than people will most likely not look at your question. Since it was only output here, I shortened it! – halirutan Jun 11 '13 at 0:12
To your problem: What you want is just sol/.{C1 -> (1 - t (fd a1 + (1 - fd))) Y1, C2 -> (1 - t (fd a2 + (1 - fd))) Y2}, where sol is just a variable containing your solutions for a1 and a2: sol=Solve[((GC1 - GL1)...,{a1, a2}] – halirutan Jun 11 '13 at 0:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.