2024-08-28 12:03:02 +08:00
<!DOCTYPE html>
< html lang = "zh-Hans" dir = "ltr" >
< head >
< meta charset = "utf-8" >
< meta name = "viewport" content = "width=device-width,initial-scale=1" >
2024-08-31 06:08:36 +08:00
< title > mbcp.mp_math.equation | MBCP 文档< / title >
< meta name = "description" content = "MBCP 粒子计算和生成库文档" >
2024-08-28 12:03:02 +08:00
< meta name = "generator" content = "VitePress v1.3.4" >
2024-08-31 06:39:55 +08:00
< link rel = "preload stylesheet" href = "/assets/style.C6qVLbET.css" as = "style" >
2024-08-28 12:03:02 +08:00
2024-08-30 13:46:30 +08:00
< script type = "module" src = "/assets/app.DSCSdM_3.js" > < / script >
2024-08-28 12:03:02 +08:00
< link rel = "preload" href = "/assets/inter-roman-latin.Di8DUHzh.woff2" as = "font" type = "font/woff2" crossorigin = "" >
2024-08-30 13:46:30 +08:00
< link rel = "modulepreload" href = "/assets/chunks/theme.CIS5wKR_.js" >
< link rel = "modulepreload" href = "/assets/chunks/framework.C94oF1kp.js" >
2024-08-31 06:39:55 +08:00
< link rel = "modulepreload" href = "/assets/api_mp_math_equation.md.hWRUu0yD.lean.js" >
2024-08-31 06:08:36 +08:00
< link rel = "icon" type = "image/svg+xml" href = "/mbcp-logo.svg" >
2024-08-28 12:03:02 +08:00
< script id = "check-dark-mode" > ( ( ) => { const e = localStorage . getItem ( "vitepress-theme-appearance" ) || "auto" , a = window . matchMedia ( "(prefers-color-scheme: dark)" ) . matches ; ( ! e || e === "auto" ? a : e === "dark" ) && document . documentElement . classList . add ( "dark" ) } ) ( ) ; < / script >
< script id = "check-mac-os" > document . documentElement . classList . toggle ( "mac" , /Mac|iPhone|iPod|iPad/i . test ( navigator . platform ) ) ; < / script >
< / head >
< body >
2024-08-31 06:39:55 +08:00
< div id = "app" > < div class = "Layout" data-v-22f859ac > <!-- [ --> <!-- ] --> <!-- [ --> < span tabindex = "-1" data-v-3e86afbf > < / span > < a href = "#VPContent" class = "VPSkipLink visually-hidden" data-v-3e86afbf > Skip to content < / a > <!-- ] --> <!-- --> < header class = "VPNav" data-v-22f859ac data-v-2a4e514e > < div class = "VPNavBar has-sidebar top" data-v-2a4e514e data-v-1303e283 > < div class = "wrapper" data-v-1303e283 > < div class = "container" data-v-1303e283 > < div class = "title" data-v-1303e283 > < div class = "VPNavBarTitle has-sidebar" data-v-1303e283 data-v-10b95b50 > < a class = "title" href = "/" data-v-10b95b50 > <!-- [ --> <!-- ] --> <!-- [ --> < img class = "VPImage logo" src = "/mbcp-logo.svg" alt data-v-f925500d > <!-- ] --> < span data-v-10b95b50 > MBCP 文档< / span > <!-- [ --> <!-- ] --> < / a > < / div > < / div > < div class = "content" data-v-1303e283 > < div class = "content-body" data-v-1303e283 > <!-- [ --> <!-- ] --> < div class = "VPNavBarSearch search" data-v-1303e283 > <!-- --> < / div > < nav aria-labelledby = "main-nav-aria-label" class = "VPNavBarMenu menu" data-v-1303e283 data-v-0fb289c1 > < span id = "main-nav-aria-label" class = "visually-hidden" data-v-0fb289c1 > Main Navigation < / span > <!-- [ --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/guide/" tabindex = "0" data-v-0fb289c1 data-v-ad4a8b64 > <!-- [ --> < span data-v-ad4a8b64 > 快速开始< / span > <!-- ] --> < / a > <!-- ] --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/refer.html" tabindex = "0" data-v-0fb289c1 data-v-ad4a8b64 > <!-- [ --> < span data-v-ad4a8b64 > 参考< / span > <!-- ] --> < / a > <!-- ] --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/api/" tabindex = "0" data-v-0fb289c1 data-v-ad4a8b64 > <!-- [ --> < span data-v-ad4a8b64 > API引用< / span > <!-- ] --> < / a > <!-- ] --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/demo/" tabindex = "0" data-v-0fb289c1 data-v-ad4a8b64 > <!-- [ --> < span data-v-ad4a8b64 > 实例< / span > <!-- ] --> < / a > <!-- ] --> <!-- ] --> < / nav > < div class = "VPFlyout VPNavBarTranslations translations" data-v-1303e283 data-v-cd7b67e8 data-v-ec8c49bc > < button type = "button" class = "button" aria-haspopup = "true" aria-expanded = "false" aria-label = "Change language" data-v-ec8c49bc > < span class = "text" data-v-ec8c49bc > < span class = "vpi-languages option-icon" data-v-ec8c49bc > < / span > <!-- --> < span class = "vpi-chevron-down text-icon" data-v-ec8c49bc > < / span > < / span > < / button > < div class = "menu" data-v-ec8c49bc > < div class = "VPMenu" data-v-ec8c49bc data-v-9990563e > <!-- --> <!-- [ --> <!-- [ --> < div class = "items" data-v-cd7b67e8 > < p class = "title" data-v-cd7b67e8 > 简体中文< / p > <!-- [ --> < div class = "VPMenuLink" data-v-cd7b67e8 data-v-79776a7a > < a class = "VPLink link" href = "/en/api/mp_math/equation.html" data-v-79776a7a > <!-- [ --> English<!-- ] --> < / a > < / div > < div class = "VPMenuLink" data-v-cd7b67e8 data-v-79776a7a > < a class = "VPLink link" href = "/ja/api/mp_math/equation.html" data-v-79776a7a > <!-- [ --> 日本語<!-- ] --> < / a > < / div > < div class = "VPMenuLink" data-v-cd7b67e8 data-v-79776a7a > < a class = "VPLink link" href = "/zht/api/mp_math/equation.html" data-v-79776a7a > <!-- [ --> 繁體中文<!-- ] --> < / a > < / div > <!-- ] --> < / div > <!-- ] --> <!-- ] --> < / div > < / div > < / div > < div class = "VPNavBarAppearance appearance" data-v-1303e283 data-v-2a6692f8 > < button class = "VPSwitch VPSwitchAppearance" type = "button" role = "switch" title = "Switch to dark theme" aria-checked = "false" data-v-2a6692f8 data-v-3a50aa5c data-v-d82e607b > < span class = "check" data-v-d82e607b > < span class = "icon" data-v-d82e607b > <!-- [ --> < span class = "vpi-sun sun" data-v-3a50aa5c > < / span > < span class = "vpi-moon moon" data-v-3a50aa5c > < / span > <!-- ] --> < / span > < / span > < / button > < / div > < div class = "VPSocialLinks VPNavBarSocialLinks social-links" data-v-1303e283 data-v-f3b91b3a data-v-fa18fe49 > <!-- [ --> < a class = "VPSocialLink no-icon" href = "https://github.com/snowykami/mbcp" aria-label = "github" target = "_blank" rel = "noopener" data-v-fa18fe49 data-v-b0526bd7 > < span class = "vpi-social-github" / > < / a > <!-- ] --> < / div > < div class = "VPFlyout VPNavBarExtra extra" data-v-1303e283 data-v-2fc967b6 data-v-ec8c49bc > < button type = "button" class = "button" aria-haspopup = "true" aria-expanded = "false" aria-label = "extra navigation" data-v-ec8c49bc > < span class = "vpi-more-horizontal icon" data-v-ec8c49bc > < / span > < / button > < div class = "menu" data-v-ec8c49bc > < div
2024-08-30 13:46:30 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 曲线方程。< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > x_func: x函数< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > y_func: y函数< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > z_func: z函数< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .x_func < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > x_func< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .y_func < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > y_func< / span > < / span >
2024-08-31 06:39:55 +08:00
< span class = "line" > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .z_func < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > z_func< / span > < / span > < / code > < / pre > < / div > < / details > < h4 id = "def-call-self-t-var-point3-tuple-point3" tabindex = "-1" > < em > < strong > def< / strong > < / em > < code > __call__(self, *t: Var) -> Point3 | tuple[Point3, ...]< / code > < a class = "header-anchor" href = "#def-call-self-t-var-point3-tuple-point3" aria-label = "Permalink to "***def*** `__call__(self, *t: Var) -> Point3 | tuple[Point3, ...]`"" > < / a > < / h4 > < p > < strong > 说明< / strong > : 计算曲线上的点。< / p > < p > < strong > 参数< / strong > :< / p > < blockquote > < ul > < li > *t:< / li > < li > 参数:< / li > < / ul > < / blockquote > < p > < strong > 返回< / strong > : 目标点< / p > < details > < summary > < b > 源代码< / b > < / summary > < p > < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L24" target = "_blank" rel = "noreferrer" > 在GitHub上查看< / a > < / p > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > __call__< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (self, < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > t: Var) -> Point3 < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > |< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > tuple[Point3, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > ...< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ]:< / span > < / span >
2024-08-30 13:46:30 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 计算曲线上的点。< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > *t:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 参数< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 目标点< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > len< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (t) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > ==< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 1< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > Point3(< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .x_func(t[< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 0< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ]), < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .y_func(t[< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 0< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ]), < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .z_func(t[< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 0< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ]))< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > else< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
2024-08-31 06:39:55 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > tuple< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ([Point3(x, y, z) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > for< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > x, y, z < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > in< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > zip< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .x_func(t), < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .y_func(t), < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > self< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > .z_func(t))])< / span > < / span > < / code > < / pre > < / div > < / details > < h3 id = "def-get-partial-derivative-func-func-multivarsfunc-var-int-tuple-int-epsilon-number-epsilon-multivarsfunc" tabindex = "-1" > < em > < strong > def< / strong > < / em > < code > get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc< / code > < a class = "header-anchor" href = "#def-get-partial-derivative-func-func-multivarsfunc-var-int-tuple-int-epsilon-number-epsilon-multivarsfunc" aria-label = "Permalink to "***def*** `get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...], epsilon: Number = EPSILON) -> MultiVarsFunc`"" > < / a > < / h3 > < p > < strong > 说明< / strong > : 求N元函数一阶偏导函数。这玩意不太稳定, 慎用。< / p > < div class = "warning custom-block github-alert" > < p class = "custom-block-title" > WARNING< / p > < p > 目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升< / p > < / div > < p > < strong > 参数< / strong > :< / p > < blockquote > < ul > < li > func: 函数< / li > < li > var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)< / li > < li > epsilon: 偏移量< / li > < / ul > < / blockquote > < p > < strong > 返回< / strong > : 偏导函数< / p > < p > < strong > 引发< / strong > :< / p > < blockquote > < ul > < li > ValueError 无效变量类型< / li > < / ul > < / blockquote > < details > < summary > < b > 源代码< / b > < / summary > < p > < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L42" target = "_blank" rel = "noreferrer" > 在GitHub上查看< / a > < / p > < div class = "language-python vp-adaptive-theme" > < button title = "Copy Code" class = "copy" > < / button > < span class = "lang" > python< / span > < pre class = "shiki shiki-themes github-light github-dark vp-code" tabindex = "0" > < code > < span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > get_partial_derivative_func< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (func: MultiVarsFunc, var: < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > int< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > |< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > tuple[< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > int< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > , < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > ...< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ], epsilon: Number< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > EPSILON< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ) -> MultiVarsFunc:< / span > < / span >
2024-08-28 12:03:02 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 求N元函数一阶偏导函数。这玩意不太稳定, 慎用。< / span > < / span >
2024-08-29 18:31:08 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > > [!warning]< / span > < / span >
2024-08-29 18:52:57 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > > 目前数学界对于一个函数的导函数并没有通解的说法,因此该函数的稳定性有待提升< / span > < / span >
2024-08-29 18:31:08 +08:00
< span class = "line" > < / span >
2024-08-28 12:03:02 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > func: 函数< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > var: 变量位置,可为整数(一阶偏导)或整数元组(高阶偏导)< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > epsilon: 偏移量< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 偏导函数< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Raises:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ValueError: 无效变量类型< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > if< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > isinstance< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (var, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > int< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ):< / span > < / span >
< span class = "line" > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > partial_derivative_func< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > args: Var) -> Var:< / span > < / span >
2024-08-29 19:00:41 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " @litedoc-hide" " " < / span > < / span >
2024-08-28 12:03:02 +08:00
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > args_list_plus < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > list< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (args)< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > args_list_plus[var] < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > +=< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > epsilon< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > args_list_minus < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > list< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (args)< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > args_list_minus[var] < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -=< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > epsilon< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (func(< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > args_list_plus) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > -< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > func(< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > args_list_minus)) < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > /< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > 2< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > epsilon)< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > partial_derivative_func< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > elif< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > isinstance< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (var, < / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > tuple< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > ):< / span > < / span >
< span class = "line" > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > def< / span > < span style = "--shiki-light:#6F42C1;--shiki-dark:#B392F0;" > high_order_partial_derivative_func< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > args: Var) -> Var:< / span > < / span >
2024-08-29 19:00:41 +08:00
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > @litedoc-hide< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 求高阶偏导函数< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Args:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > *args: 参数< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > Returns:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > 高阶偏导数值< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > " " " < / span > < / span >
2024-08-28 12:03:02 +08:00
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > result_func < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > func< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > for< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > v < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > in< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > var:< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > result_func < / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > =< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > get_partial_derivative_func(result_func, v, epsilon)< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > result_func(< / span > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > *< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > args)< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > return< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > high_order_partial_derivative_func< / span > < / span >
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > else< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > :< / span > < / span >
2024-08-31 06:08:36 +08:00
< span class = "line" > < span style = "--shiki-light:#D73A49;--shiki-dark:#F97583;" > raise< / span > < span style = "--shiki-light:#005CC5;--shiki-dark:#79B8FF;" > ValueError< / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > (< / span > < span style = "--shiki-light:#032F62;--shiki-dark:#9ECBFF;" > ' Invalid var type' < / span > < span style = "--shiki-light:#24292E;--shiki-dark:#E1E4E8;" > )< / span > < / span > < / code > < / pre > < / div > < / details > < / div > < / div > < / main > < footer class = "VPDocFooter" data-v-40342069 data-v-a4b38bd6 > <!-- [ --> <!-- ] --> <!-- --> < nav class = "prev-next" aria-labelledby = "doc-footer-aria-label" data-v-a4b38bd6 > < span class = "visually-hidden" id = "doc-footer-aria-label" data-v-a4b38bd6 > Pager< / span > < div class = "pager" data-v-a4b38bd6 > < a class = "VPLink link pager-link prev" href = "/api/mp_math/const.html" data-v-a4b38bd6 > <!-- [ --> < span class = "desc" data-v-a4b38bd6 > 上一页< / span > < span class = "title" data-v-a4b38bd6 > mbcp.mp_math.const< / span > <!-- ] --> < / a > < / div > < div class = "pager" data-v-a4b38bd6 > < a class = "VPLink link pager-link next" href = "/api/mp_math/function.html" data-v-a4b38bd6 > <!-- [ --> < span class = "desc" data-v-a4b38bd6 > 下一页< / span > < span class = "title" data-v-a4b38bd6 > mbcp.mp_math.function< / span > <!-- ] --> < / a > < / div > < / nav > < / footer > <!-- [ --> <!-- ] --> < / div > < / div > < / div > <!-- [ --> <!-- ] --> < / div > < / div > < footer class = "VPFooter has-sidebar" data-v-22f859ac data-v-e3ca6860 > < div class = "container" data-v-e3ca6860 > < p class = "message" data-v-e3ca6860 > 文档由 < a href = "https://vitepress.dev/" > VitePress< / a > 构建 | API引用由 < a href = "https://github.com/LiteyukiStudio/litedoc" > litedoc< / a > 生成< / p > < p class = "copyright" data-v-e3ca6860 > Copyright (C) 2020-2024 SnowyKami. All Rights Reserved< / p > < / div > < / footer > <!-- [ --> <!-- ] --> < / div > < / div >
2024-08-31 06:39:55 +08:00
< script > w i n d o w . _ _ V P _ H A S H _ M A P _ _ = J S O N . p a r s e ( " { \ " a p i _ a p i . m d \ " : \ " D _ B 0 H l c p \ " , \ " a p i _ i n d e x . m d \ " : \ " C _ w E S r r Y \ " , \ " a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " b Q b g L 5 r c \ " , \ " a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " B A f 8 m K 4 W \ " , \ " a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " h W R U u 0 y D \ " , \ " a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " C 9 e B z K g T \ " , \ " a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " B N f 7 b Q q L \ " , \ " a p i _ m p _ m a t h _ l i n e . m d \ " : \ " D D k z T 0 e 0 \ " , \ " a p i _ m p _ m a t h _ m p _ m a t h . m d \ " : \ " G l F M k W i Q \ " , \ " a p i _ m p _ m a t h _ m p _ m a t h _ t y p i n g . m d \ " : \ " D l n J m k o s \ " , \ " a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " D C L 3 l F b z \ " , \ " a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " Y 0 S c 1 9 z U \ " , \ " a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " B - p t C n Q 0 \ " , \ " a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " m U Q 5 6 H G Q \ " , \ " a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " B e A N 7 T k I \ " , \ " a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " C m 3 V k - e s \ " , \ " a p i _ p a r t i c l e _ p a r t i c l e . m d \ " : \ " y D 6 t c N S r \ " , \ " a p i _ p r e s e t s _ i n d e x . m d \ " : \ " C D 6 2 I 2 g v \ " , \ " a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " B G e o O S C d \ " , \ " a p i _ p r e s e t s _ m o d e l _ m o d e l . m d \ " : \ " D 3 4 e F R N H \ " , \ " a p i _ p r e s e t s _ p r e s e t s . m d \ " : \ " 4 R 0 V R b Q o \ " , \ " d e m o _ i n d e x . m d \ " : \ " D - H 9 z R U E \ " , \ " e n _ a p i _ a p i . m d \ " : \ " B S g r C X 1 d \ " , \ " e n _ a p i _ i n d e x . m d \ " : \ " D j _ 5 n F T t \ " , \ " e n _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " C j 4 a y I e t \ " , \ " e n _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " g G p X U S h q \ " , \ " e n _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " B i h I L J C I \ " , \ " e n _ a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " B R 2 9 h v 6 0 \ " , \ " e n _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " B E j L B M p H \ " , \ " e n _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " C I O n k 8 L F \ " , \ " e n _ a p i _ m p _ m a t h _ m p _ m a t h . m d \ " : \ " D 6 i h Y P a v \ " , \ " e n _ a p i _ m p _ m a t h _ m p _ m a t h _ t y p i n g . m d \ " : \ " D n l 2 a J Q 4 \ " , \ " e n _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " C b m y 4 F 0 P \ " , \ " e n _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " s z Y q V N f f \ " , \ " e n _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " C q l c A r a 1 \ " , \ " e n _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " C i g C G g j m \ " , \ " e n _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " C F 4 k C v - W \ " , \ " e n _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " B f y N Q i R g \ " , \ " e n _ a p i _ p a r t i c l e _ p a r t i c l e . m d \ " : \ " B N k f E y J n \ " , \ " e n _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " B W b 2 f p T g \ " , \ " e n _ a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " C n n 4 t _ P 0 \ " , \ " e n _ a p i _ p r e s e t s _ m o d e l _ m o d e l . m d \ " : \ " B Z p Q e 5 L i \ " , \ " e n _ a p i _ p r e s e t s _ p r e s e t s . m d \ " : \ " C C U z s Y o g \ " , \ " e n _ g u i d e _ i n d e x . m d \ " : \ " D r D H T Y C Z \ " , \ " e n _ i n d e x . m d \ " : \ " B S T S O H 3 9 \ " , \ " e n _ r e f e r _ i n d e x . m d \ " : \ " a l w 4 L - b p \ " , \ " g u i d e _ i n d e x . m d \ " : \ " C f m z k 2 I H \ " , \ " i n d e x . m d \ " : \ " C N F 8 L J a 0 \ " , \ " j a _ a p i _ a p i . m d \ " : \ " C P z 5 8 q I w \ " , \ " j a _ a p i _ i n d e x . m d \ " : \ " C n U e u i f x \ " , \ " j a _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " D 0 C h d V 9 L \ " , \ " j a _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " D G X A g D f n \ " , \ " j a _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " k s L z f P H D \ " , \ " j a _ a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " S 4 m l h S E l \ " , \ " j a _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " C T Z Z - p 9 Z \ " , \ " j a _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " C 6 _ h 0 E E F \ " , \ " j a _ a p i _ m p _ m a t h _ m p _ m a t h . m d \ " : \ " D - p r C 0 U O \ " , \ " j a _ a p i _ m p _ m a t h _ m p _ m a t h _ t y p i n g . m d \ " : \ " B N y m g r C T \ " , \ " j a _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " C V f L X 9 s r \ " , \ " j a _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " 2 1 g M 8 9 3 G \ " , \ " j a _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " D j i 9 _ v O I \ " , \ " j a _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " D h v j D s k n \ " , \ " j a _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " D y G g u r m 4 \ " , \ " j a _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " J r 4 1 Y 3 T S \ " , \ " j a _ a p i _ p a r t i c l e _ p a r t i c l e . m d \ " : \ " e x T t 4 6 p q \ " , \ " j a _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " C Q q d Q b I Z \ " , \ " j a _ a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " D b t 3 L F N K \ " , \ " j a _ a p i _ p r e s e t s _ m o d e l _ m o d e l . m d \ " : \ " t i 1 H K Q y Y \ " , \ " j a _ a p i _ p r e s e t s _ p r e s e t s . m d \ " : \ " D w z X d D q R \ " , \ " j a _ g u i d e _ i n d e x . m d \ " : \ " B x G n Z Y w R \ " , \ " j a _ i n d e x . m d \ " : \ " D C W i T E N z \ " , \ " j a _ r e f e r _ i n d e x . m d \ " : \ " C O D W 6 i M X \ " , \ " r e f e r _ f u n c t i o n _ c u r r y . m d \ " : \ " D w K Z a w p 5 \ " , \ " r e f e r _ f u n c t i o n _ f u n c t i o n . m d \ " : \ " D 3 I g f Z X 2 \ " , \ " r e f e r _ i n d e x . m d \ " : \ " C c z Y T l 3 j \ " , \ " z h t _ a p i _ a p i . m d \ " : \ " D y U S H A 0 S \ " , \ " z h t _ a p i _ i n d e x . m d \ " : \ " C g Z H 6 a H Q \ " , \ " z h t _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " B y T 5 H a t c \ " , \ " z h t _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " x w Q v u Y c k \ " , \ " z h t _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " C 9 J J o 8 T j \ " , \ " z h t _ a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " C U i z i A r f \ " , \ " z h t _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " m m e M M r i u \ " , \ " z h t _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " T S J B r H T a \ " , \ " z h t _ a p i _ m p _ m a t h _ m p _ m a t h . m d \ " : \ " C 3 0 2 r x K c \ " , \ " z h t _ a p i _ m p _ m a t h _ m p _ m a t h _ t y p i n g . m d \ " : \ " C N i S n u M w \ " , \ " z h t _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " C O 3 D x q t g \ " , \ " z h t _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " h a h Z S a S v \ " , \ " z h t _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " B V x d 0 3 I I \ " , \ " z h t _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " D z 7 j Y C 2 A \ " , \ " z h t _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " 2 6 f p p i _ c \ " , \ " z h t _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " 8 G a G B 1 u l \ " , \ " z h t _ a p i _ p a r t i c l e _ p a r t i c l e . m d \ " : \ " h u u R T E b 9 \ " , \ " z h t _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " D v O V i S o x \ " , \ " z h t _ a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " B N 6 G z T i L \ " , \ " z h t _ a p i _ p r e s e t s _ m o d e l _ m o d e l . m d \ " : \ " p U t H 2 D s 8 \ " , \ " z h t _ a p i _ p r e s e t s _ p r e s e t s . m d \ " : \ " C s D H j R b K \ " , \ " z h t _ g u i d e _ i n d e x . m d \ " : \ " C s u F V F x u \ " , \ " z h t _ i n d e x . m d \ " : \ " V M j J 0 l p j \ " , \ " z h t _ r e f e r _ i n d e x . m d \ " : \ " B z 6 v o x E Q \ " } " ) ; f u n c t i o n d e s e r i a l i z e F u n c t i o n s ( r ) { r e t u r n A r r a y . i s A r r a y ( r )
2024-08-28 12:03:02 +08:00
< / body >
< / html >