title: How to plot an equation with no analytical solution in R?
body: <p>I have been trying to plot an equation in R. The variables are fixed at (for this instance) <code>a=0.06</code>, <code>b=-0.01</code>, <code>i=0</code>, <code>t=0.005</code>, <code>r=0.0025</code>, <code>s=0.015</code> while I intend to vary variable <code>e</code>. Some of the functions in the main equations are,</p>
  <p><a href="https://i.stack.imgur.com/SELhd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SELhd.png" alt="functions" /></a></p>
  <p>The equation looks like this,</p>
  <p><a href="https://i.stack.imgur.com/n7ftO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n7ftO.png" alt="enter image description here" /></a></p>
  <p>I'd ideally like a plot between <code>Q</code> and <code>x</code> as <code>e</code> increases.</p>
  <pre><code>t = 0.0005
  A = 0.06
  B = -0.01
  r = 0.00025
  s = 0.015
  i=0
  
  
  M= function(e) e*A - i*B
  N= function(e) t/(1+t*e-t*i)
  P= function(e) (s/t)*(1+N(e)*(r+t))
  </code></pre>
  <p>I don't know how to proceed. I'd like to maybe create a list of (e, Q, x) where x is the root of the equation for a given <code>e</code> and then maybe use interpolation and then plot (Q, x) in R.</p>
  <p>Is there a more direct way of plotting x vs Q? If not, what else could I try? Also, if it's easier to do with Mathematica or MATLAB, I'd be keen to know.</p>