title: Python: Solving Matrix Equation Ax = b where A contains variables
body: <p>I'm hoping to solve a matrix equation of the form Ax = b where </p>
  
  <pre><code>A = [[a,0,0],
       [0,a,0],
       [0,0,a],
       [1,1,0],
       [0,0,1]]
  
  x = [b,c,d]
  
  b = [0.4,0.4,0.2,0.1,0.05]
  </code></pre>
  
  <p>If I knew the value of <code>a</code>, I would do this using the <code>numpy.linalg.lstsq</code> module.
   Similarly, if I thought the solution was exact, I would use the sympy solver. However, the solution will need to be a least square fit to some data, and the sympy solver generally tells me there is no solution. </p>
  
  <p>Basically what I'm looking for is a version of <code>numpy.linalg.lstsq</code> that allows me to declare one or more variables in <code>A</code>. Is there a prebuilt module which deals with these types of problems?</p>