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 07:55:26 +08:00
< link rel = "preload stylesheet" href = "/assets/style.UiSpMRXd.css" as = "style" >
2024-08-28 12:03:02 +08:00
2024-08-31 08:04:13 +08:00
< script type = "module" src = "/assets/app.CXrW177Y.js" > < / script >
< link rel = "modulepreload" href = "/assets/chunks/theme.C6q8dLhO.js" >
2024-08-31 07:55:26 +08:00
< link rel = "modulepreload" href = "/assets/chunks/framework.DpC1ZpOZ.js" >
2024-08-31 08:04:13 +08:00
< link rel = "modulepreload" href = "/assets/api_mp_math_equation.md.ULDUz32s.lean.js" >
2024-08-31 06:08:36 +08:00
< link rel = "icon" type = "image/svg+xml" href = "/mbcp-logo.svg" >
2024-08-31 07:31:49 +08:00
< link rel = "stylesheet" href = "https://fonts.font.im/css?family=Cousine:400,400i,700,700i|Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" >
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 07:55:26 +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 id = "local-search" > < button type = "button" class = "DocSearch DocSearch-Button" aria-label = "打开搜索框" > < span class = "DocSearch-Button-Container" > < span class = "vp-icon DocSearch-Search-Icon" > < / span > < span class = "DocSearch-Button-Placeholder" > 搜索文档< / span > < / span > < span class = "DocSearch-Button-Keys" > < kbd class = "DocSearch-Button-Key" > < / kbd > < kbd class = "DocSearch-Button-Key" > K< / kbd > < / span > < / button > < / div > <!-- ] --> < / 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"
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:57:34 +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 > 或 < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L24" target = "_blank" > 在GitHub上查看< / a > < / summary > < 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:57:34 +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 > 或 < a href = "https://github.com/snowykami/mbcp/tree/main/mbcp/mp_math/equation.py#L42" target = "_blank" > 在GitHub上查看< / a > < / summary > < 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 07:58:16 +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 > <!-- [ --> <!-- ] --> < div class = "edit-info" data-v-a4b38bd6 > < div class = "edit-link" data-v-a4b38bd6 > < a class = "VPLink link vp-external-link-icon no-icon edit-link-button" href = "https://github.com/snowykami/mbcp/tree/main/mbcp//mp_math/equation.py" target = "_blank" rel = "noreferrer" data-v-a4b38bd6 > <!-- [ --> < span class = "vpi-square-pen edit-link-icon" data-v-a4b38bd6 > < / span > 在 GitHub 上编辑此页<!-- ] --> < / a > < / div > <!-- --> < / div > < 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 08:04:13 +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 \ " : \ " B u m p Z u Z u \ " , \ " a p i _ i n d e x . m d \ " : \ " t 5 H j 1 a J 1 \ " , \ " a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " B O k T s i 0 E \ " , \ " a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " C s z O m A y i \ " , \ " a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " U L D U z 3 2 s \ " , \ " a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " e F Y A a D H 0 \ " , \ " a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " D m D p 3 x c y \ " , \ " a p i _ m p _ m a t h _ l i n e . m d \ " : \ " D 5 P P l j Z M \ " , \ " a p i _ m p _ m a t h _ m p _ m a t h . m d \ " : \ " D H V V b - R v \ " , \ " a p i _ m p _ m a t h _ m p _ m a t h _ t y p i n g . m d \ " : \ " 2 N i p b S O G \ " , \ " a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " B 5 s H G m d M \ " , \ " a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " D R v A C z L Y \ " , \ " a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " D 1 _ w U I Y i \ " , \ " a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " B c F V z v I c \ " , \ " a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " C I D 4 v J q L \ " , \ " a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " B x L V u q r y \ " , \ " a p i _ p a r t i c l e _ p a r t i c l e . m d \ " : \ " C i o L G 9 A b \ " , \ " a p i _ p r e s e t s _ i n d e x . m d \ " : \ " C p c x m u 7 p \ " , \ " a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " U 7 _ a D I z q \ " , \ " a p i _ p r e s e t s _ m o d e l _ m o d e l . m d \ " : \ " B z J Y o Z b W \ " , \ " a p i _ p r e s e t s _ p r e s e t s . m d \ " : \ " b R Q 3 m x u k \ " , \ " d e m o _ i n d e x . m d \ " : \ " C V A d l a F I \ " , \ " e n _ a p i _ a p i . m d \ " : \ " B 6 I Q 3 D v 3 \ " , \ " e n _ a p i _ i n d e x . m d \ " : \ " C n G e b p F i \ " , \ " e n _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " B e 0 c P _ h 6 \ " , \ " e n _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " D 5 u g 6 t d d \ " , \ " e n _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " C 8 z h _ 5 r D \ " , \ " e n _ a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " D O 1 f G 1 J w \ " , \ " e n _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " C W A g Z w 9 8 \ " , \ " e n _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " C R r H i R 7 P \ " , \ " e n _ a p i _ m p _ m a t h _ m p _ m a t h . m d \ " : \ " B 7 z A T I 3 - \ " , \ " 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 \ " : \ " Q i j 9 C r u 6 \ " , \ " e n _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " C 0 Q 6 w B E D \ " , \ " e n _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " B i d e D s i r \ " , \ " e n _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " C _ N u E 0 F o \ " , \ " e n _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " C D b S o q M y \ " , \ " e n _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " D r 5 p I K F e \ " , \ " e n _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " N e z C 9 0 n 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 T k 7 x B - d \ " , \ " e n _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " s u X H C l 2 K \ " , \ " e n _ a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " 3 V W c L Z y k \ " , \ " e n _ a p i _ p r e s e t s _ m o d e l _ m o d e l . m d \ " : \ " W 7 P a w S 5 i \ " , \ " e n _ a p i _ p r e s e t s _ p r e s e t s . m d \ " : \ " 8 _ i 3 A 9 g W \ " , \ " e n _ g u i d e _ i n d e x . m d \ " : \ " C 3 k I 8 f 8 A \ " , \ " e n _ i n d e x . m d \ " : \ " D 5 C d d O W - \ " , \ " e n _ r e f e r _ i n d e x . m d \ " : \ " C q 6 G W i 0 V \ " , \ " g u i d e _ i n d e x . m d \ " : \ " B V h Q 0 k P y \ " , \ " i n d e x . m d \ " : \ " D J W B R k U z \ " , \ " j a _ a p i _ a p i . m d \ " : \ " C c T M 3 z B l \ " , \ " j a _ a p i _ i n d e x . m d \ " : \ " B J g z h 7 V s \ " , \ " j a _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " B J 3 F - 1 n s \ " , \ " j a _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " B - r o K d x X \ " , \ " j a _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " A H h 0 f 8 Z r \ " , \ " j a _ a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " C N U P z b p y \ " , \ " j a _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " r k 3 K q M m C \ " , \ " j a _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " D q I P v y Z k \ " , \ " j a _ a p i _ m p _ m a t h _ m p _ m a t h . m d \ " : \ " r u I s q k S q \ " , \ " 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 \ " : \ " r v K S b x c 3 \ " , \ " j a _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " D V D 1 X p v - \ " , \ " j a _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " B V p x g I z g \ " , \ " j a _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " J c X 6 q 9 M r \ " , \ " j a _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " D 3 i C J i E 5 \ " , \ " j a _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " B 4 7 s y H g 3 \ " , \ " j a _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " S X v J H p q E \ " , \ " j a _ a p i _ p a r t i c l e _ p a r t i c l e . m d \ " : \ " D p D q A P A 7 \ " , \ " j a _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " B n l n 2 2 L 2 \ " , \ " 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 3 Z E h C m g \ " , \ " j a _ a p i _ p r e s e t s _ m o d e l _ m o d e l . m d \ " : \ " B Y P T 7 B B j \ " , \ " j a _ a p i _ p r e s e t s _ p r e s e t s . m d \ " : \ " D g k Z I 1 E 7 \ " , \ " j a _ g u i d e _ i n d e x . m d \ " : \ " w 1 T f 2 A d m \ " , \ " j a _ i n d e x . m d \ " : \ " D n s q Z i 7 i \ " , \ " j a _ r e f e r _ i n d e x . m d \ " : \ " D a m U s c s 8 \ " , \ " r e f e r _ f u n c t i o n _ c u r r y . m d \ " : \ " D _ o q R D d 3 \ " , \ " r e f e r _ f u n c t i o n _ f u n c t i o n . m d \ " : \ " B i _ 8 2 l I J \ " , \ " r e f e r _ i n d e x . m d \ " : \ " y F Z W 0 k I 4 \ " , \ " z h t _ a p i _ a p i . m d \ " : \ " C 4 _ 7 Q d _ 0 \ " , \ " z h t _ a p i _ i n d e x . m d \ " : \ " D O g 9 g E H q \ " , \ " z h t _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " D I 1 W 8 l 2 s \ " , \ " z h t _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " B B E b V B n 1 \ " , \ " z h t _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " M w K 2 z 2 J l \ " , \ " z h t _ a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " i 4 T 8 m S P D \ " , \ " z h t _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " a m b P E F j B \ " , \ " z h t _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " T 4 _ O t r P R \ " , \ " z h t _ a p i _ m p _ m a t h _ m p _ m a t h . m d \ " : \ " B N e 9 a n l t \ " , \ " 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 \ " : \ " D R 0 j x i - S \ " , \ " z h t _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " D d 9 w P o t S \ " , \ " z h t _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " B r K H 3 - u U \ " , \ " z h t _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " D y 1 9 j i x Q \ " , \ " z h t _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " L O p 6 F E M F \ " , \ " z h t _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " C E h 9 T l m P \ " , \ " z h t _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " C 8 w v 1 s G B \ " , \ " z h t _ a p i _ p a r t i c l e _ p a r t i c l e . m d \ " : \ " D L x D z J s b \ " , \ " z h t _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " e K U c Z 6 Z V \ " , \ " 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 \ " : \ " D R U B R n e v \ " , \ " 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 \ " : \ " B e K C G m b w \ " , \ " z h t _ a p i _ p r e s e t s _ p r e s e t s . m d \ " : \ " t a U m y d 0 V \ " , \ " z h t _ g u i d e _ i n d e x . m d \ " : \ " B N n M V i C 8 \ " , \ " z h t _ i n d e x . m d \ " : \ " C U R 8 - Q X m \ " , \ " z h t _ r e f e r _ i n d e x . m d \ " : \ " B 7 C Q S 2 U W \ " } " ) ; 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 >