|
191 | 191 | "cell_type": "markdown",
|
192 | 192 | "metadata": {},
|
193 | 193 | "source": [
|
194 |
| - "## Partial Estimation" |
| 194 | + "## Finite Difference Estimators" |
| 195 | + ] |
| 196 | + }, |
| 197 | + { |
| 198 | + "cell_type": "markdown", |
| 199 | + "metadata": {}, |
| 200 | + "source": [ |
| 201 | + "### Partial Estimation" |
195 | 202 | ]
|
196 | 203 | },
|
197 | 204 | {
|
|
248 | 255 | "cell_type": "markdown",
|
249 | 256 | "metadata": {},
|
250 | 257 | "source": [
|
251 |
| - "## Complete Estimation" |
| 258 | + "### Complete Estimation" |
252 | 259 | ]
|
253 | 260 | },
|
254 | 261 | {
|
|
294 | 301 | "cell_type": "markdown",
|
295 | 302 | "metadata": {},
|
296 | 303 | "source": [
|
297 |
| - "## Convenience Classes" |
| 304 | + "### Convenience Classes" |
298 | 305 | ]
|
299 | 306 | },
|
300 | 307 | {
|
|
312 | 319 | "outputs": [],
|
313 | 320 | "source": [
|
314 | 321 | "differ = opinf.ddt.UniformFiniteDifferencer(t, scheme=\"fwd1\")\n",
|
| 322 | + "print(differ)" |
| 323 | + ] |
| 324 | + }, |
| 325 | + { |
| 326 | + "cell_type": "code", |
| 327 | + "execution_count": null, |
| 328 | + "metadata": {}, |
| 329 | + "outputs": [], |
| 330 | + "source": [ |
315 | 331 | "differ.verify(plot=True)"
|
316 | 332 | ]
|
317 | 333 | },
|
|
329 | 345 | "cell_type": "markdown",
|
330 | 346 | "metadata": {},
|
331 | 347 | "source": [
|
332 |
| - "## Custom Estimators\n", |
333 |
| - "\n", |
| 348 | + "## Interpolatory Estimators" |
| 349 | + ] |
| 350 | + }, |
| 351 | + { |
| 352 | + "cell_type": "markdown", |
| 353 | + "metadata": {}, |
| 354 | + "source": [ |
| 355 | + "The {class}`InterpolationDerivativeEstimator` interpolates the state data using classes from {mod}`scipy.interpolate` and evaluates the derivative of the interpolant." |
| 356 | + ] |
| 357 | + }, |
| 358 | + { |
| 359 | + "cell_type": "code", |
| 360 | + "execution_count": null, |
| 361 | + "metadata": {}, |
| 362 | + "outputs": [], |
| 363 | + "source": [ |
| 364 | + "estimator = opinf.ddt.InterpolationDerivativeEstimator(t, \"cubic\")\n", |
| 365 | + "print(estimator)" |
| 366 | + ] |
| 367 | + }, |
| 368 | + { |
| 369 | + "cell_type": "code", |
| 370 | + "execution_count": null, |
| 371 | + "metadata": {}, |
| 372 | + "outputs": [], |
| 373 | + "source": [ |
| 374 | + "estimator.verify(plot=True)" |
| 375 | + ] |
| 376 | + }, |
| 377 | + { |
| 378 | + "cell_type": "markdown", |
| 379 | + "metadata": {}, |
| 380 | + "source": [ |
| 381 | + "## Custom Estimators" |
| 382 | + ] |
| 383 | + }, |
| 384 | + { |
| 385 | + "cell_type": "markdown", |
| 386 | + "metadata": {}, |
| 387 | + "source": [ |
334 | 388 | "New time derivative estimators can be defined by inheriting from {class}`DerivativeEstimatorTemplate`.\n",
|
335 | 389 | "Once implemented, the [`verify()`](opinf.ddt.DerivativeEstimatorTemplate.verify) method may be used to compare the results of [`estimate()`](opinf.ddt.DerivativeEstimatorTemplate.estimate) with true derivatives for a limited number of test cases."
|
336 | 390 | ]
|
|
387 | 441 | "cell_type": "markdown",
|
388 | 442 | "metadata": {},
|
389 | 443 | "source": [
|
390 |
| - "The following class wraps {class}`scipy.interpolate.CubicSpline` and uses its `derivative()` method to compute the derivative." |
| 444 | + "The following class wraps {class}`scipy.interpolate.CubicSpline` and uses its `derivative()` method to compute the derivative.\n", |
| 445 | + "This is a simplified version of {class}`DerivativeEstimatorTemplate`." |
391 | 446 | ]
|
392 | 447 | },
|
393 | 448 | {
|
|
407 | 462 | "\n",
|
408 | 463 | " # Required methods --------------------------------------------------------\n",
|
409 | 464 | " def estimate(self, states, inputs=None):\n",
|
410 |
| - " \"\"\"Estimate the first time derivatives o’f the states.\"\"\"\n", |
| 465 | + " \"\"\"Estimate the first time derivatives of the states.\"\"\"\n", |
411 | 466 | " spline = spinterpolate.CubicSpline(\n",
|
412 | 467 | " x=self.time_domain,\n",
|
413 | 468 | " y=states,\n",
|
|
425 | 480 | "metadata": {},
|
426 | 481 | "outputs": [],
|
427 | 482 | "source": [
|
428 |
| - "t = np.linspace(0, 1, 200)\n", |
429 | 483 | "spline_estimator = CubicSplineEstimator(t)\n",
|
430 |
| - "\n", |
431 | 484 | "print(spline_estimator)"
|
432 | 485 | ]
|
433 | 486 | },
|
|
0 commit comments