Completing a curve using a function
<p>I have developed a model in Python to simulate something physical. This model outputs angular velocity over a distance range.  For various reasons the model does not give results for small distance values, but it has been suggested to me that I complete the curve using a function which we believe approximates the small distance regime.  </p>

<p>My question is, how can I actually implement this?  It is not obvious to me how to tie together the curve that results from the model with the known analytic function.</p>

<p>You can make a piecewise function. For example if you know that your angular velocity function is valid for <code>r &gt; 10</code>, then you could do something like</p>

<pre><code>def angular_velocity(r):
    if r &gt; 10:
        your_analytical_function(r)
    else:
        some_alternative_for_small_distance(r)
</code></pre>

<p>If your question is more of how to determine an equation for small ranges, then that would really depend on your data and model. There are ways you can <a href="https://stackoverflow.com/questions/2745329/how-to-make-scipy-interpolate-give-an-extrapolated-result-beyond-the-input-range">extrapolate</a> your data, but in general you should be <a href="https://xkcd.com/605/" rel="nofollow">wary of extrapolation</a>.</p>

python plot model