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

Please bear with me as I am a beginner at Mathematica.

In the following system, all variables on the right hand side are known, except for w1, w2 and w3, for which we are trying to solve. enter image description here

I am trying to solve this system in Mathematica, but I am not sure where to start. Also, in my real example, the system is composed of 10 equations instead of three: we are trying to solve for w1, w2 and w3 where FA = FB = FC = FD = .... = Fj.

Please let me know if the explanation is a bit confusing, and I will try to explain better! Thanks!

share|improve this question
You will have to post actual Mathematica code for readers to have much chance of offering assistance. – Daniel Lichtblau Jun 19 '14 at 19:53
Sure, I will try doing that soon. Thanks. – Mayou Jun 19 '14 at 20:13
Please note that the numerator results in scalar quantity (1x3.3x3.3.1=1x1). you can not equate vector quantity {FA,FB,FC} with scalar quantity. – Algohi Jun 19 '14 at 20:53
@Algohi Yes you are right. There is a typo.. I will fix this – Mayou Jun 19 '14 at 21:01
Just type out the equation(s) in plain ascii. I doubt anyone will want to enter, from scratch, what you've shown in an image. But readers might be willing to convert actual ascii equations, that can be cut and pasted, into proper Mathematica syntax. – Daniel Lichtblau Jun 20 '14 at 15:13
up vote 3 down vote accepted

This will show you how to write the equations. Execute each step to see the result

sigma = Thread[Subscript[\[Sigma], {A, B, C}]]

(cov = Outer[Times, sigma, sigma] /.
    Subscript[\[Sigma], x_] * Subscript[\[Sigma], y_] :>
     Subscript[\[Sigma], x] * Subscript[\[Sigma], y]  * 
      Subscript[\[Rho], ToString[x] <> ToString[y]]) // MatrixForm

weights = Thread[Subscript[w, Range[3]]]

(m = Table[Subscript[\[Beta], i]^j, 
       {j, {A, B, C}}, {i, 3}].weights) //

denom = (Total[
      Table[Subscript[w, n]*Subscript[\[Sigma], n], {n, 3}]]^2 //
    Expand) /. 
  Subscript[\[Sigma], x_] * Subscript[\[Sigma], y_] :>
   Subscript[\[Sigma], x] * Subscript[\[Sigma], y]  * 
    Subscript[\[Rho], Sequence[x, y]]

f = Thread[Subscript[F, {A, B, C}]]

eqns = Thread[f == cov.m/denom];

constraints = {Total[weights] == 1, Equal @@ (m.f)}

sol = Solve[Join[eqns, constraints], weights]

This last statement will not be solved in any reasonable amount of time (ever?). However, if the "known" values are given numeric values it might be doable.

sol = With[{***"assign numeric values here"***}, 
  Solve[Join[eqns, constraints], weights]]
share|improve this answer
I can't thank you enough for this! – Mayou Jun 20 '14 at 17:01
Note with a little manipulation the denom quantity can be eliminated from the system. If you do that Solve will have an easier time of it. (Still highly unlikely to get a symbolic solution, but given all the symmetry it is worth a shot. ) – george2079 Jun 20 '14 at 17:54
Actually all the known values have a numerical value assigned to them, so it is definitely solvable! – Mayou Jun 20 '14 at 19:36

This is simple way of writing the equations

Though no solution is found.

enter image description here

if you want to use the symbols as seen the image you can use the Mathematica Palettes which you can find at the main menu.

enter image description here

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.