Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd6a1dad

Browse files
committed
update to reflect interface changes
1 parent84f7ac8 commitd6a1dad

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎lectures/05-scipy/scipy-exercises.ipynb‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,14 @@
333333
"cell_type":"markdown",
334334
"metadata": {},
335335
"source": [
336-
"Write a function that takes an initial angle, $\\theta_0$, and integrates the system and returns the solution. For the parameters that are part of the `rhs()` function, you'll need to use the `set_f_params()` method.\n",
336+
"Write a function that takes an initial angle, $\\theta_0$, and integrates the system and returns the solution.\n",
337+
"\n",
338+
"Note, the righthand side function, `rhs`, takes additional arguments that you need to pass through the integrator. The preferred method to do this with the `solve_ivp()` interface appears to be to use `functools.partial()`, as:\n",
339+
"```\n",
340+
"from functools import partial\n",
341+
"\n",
342+
"r = solve_ivp(partial(rhs, q=q, omega_d=omega_d, b=b), ...)\n",
343+
"```\n",
337344
"\n",
338345
"Some values of $b$ will show very non-periodic behavior. To see chaos, integrate two different pendula that are the same except for $\\theta_0$, with only a small difference between then (like 60 degrees and 60.0001 degrees. You'll see the solutions track for a while, but then diverge."
339346
]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp