Python Lab Tutorials: Lab 8
In order to noninvasively assess the stability of medical implants, Westover et al. devised a technique by which the implant is struck using a hand-piece while measuring the acceleration response.

In order to assess the stability, the acceleration
data as a function of time
has to be fit to a model of the form:
![Rendered by QuickLaTeX.com \[\begin{split}y(t)&=a_1\sin{(a_2t+\phi_1)}+a_3e^{-a_4a_5t}\sin{\left(\sqrt{\left(1-a_4^2\right)}a_5t+\phi_2\right)}\\a(t)&=\frac{\mathrm{d}^2y(t)}{\mathrm{d}t^2}\end{split}\]](https://engcourses-uofa.ca/wp-content/ql-cache/quicklatex.com-d1ff35d16667998bab1c97498fd356c6_l3.png)
where
is the position,
is the acceleration,
,
,
,
,
,
, and
are the model parameters. Initial guesses for the model parameters can be taken as:
respectively.
The following text file OneStrike.txt contains the acceleration data collected by striking one of the implants. Download the data file and use Scipy’s built-in “curve_fit” function to calculate the parameters for the best-fit model along with the value of R^2. Plot the data overlapping the model.
Hint: for “curve_fit", set p0=[...] to pass initial guesses and set max iterations to 10,000: maxfev=10000
Reference: L. Westover, W. Hodgetts, G. Faulkner, D. Raboud. 2015. Advanced System for Implant Stability Testing (ASIST). OSSEO 2015 5th International Congress on Bone Conduction Hearing and Related Technologies, Fairmont Chateau Lake Louise, Canada, May 20 – 23, 2015.
