2024-08-29 13:25:00 +08:00
<!DOCTYPE html>
< html lang = "zh-Hant" 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-29 13:25:00 +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-29 13:25:00 +08:00
2024-08-31 07:58:16 +08:00
< script type = "module" src = "/assets/app.CHPdwxJh.js" > < / script >
< link rel = "modulepreload" href = "/assets/chunks/theme.B1OYTEE9.js" >
2024-08-31 07:55:26 +08:00
< link rel = "modulepreload" href = "/assets/chunks/framework.DpC1ZpOZ.js" >
2024-08-31 07:58:16 +08:00
< link rel = "modulepreload" href = "/assets/zht_api_mp_math_equation.md.Dl4VlL2q.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-29 13:25:00 +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 = "/zht/" 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 = "/zht/guide/" tabindex = "0" data-v-0fb289c1 data-v-ad4a8b64 > <!-- [ --> < span data-v-ad4a8b64 > 指引< / span > <!-- ] --> < / a > <!-- ] --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/zht/refer.html" tabindex = "0" data-v-0fb289c1 data-v-ad4a8b64 > <!-- [ --> < span data-v-ad4a8b64 > 參考< / span > <!-- ] --> < / a > <!-- ] --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/zht/api/" tabindex = "0" data-v-0fb289c1 data-v-ad4a8b64 > <!-- [ --> < span data-v-ad4a8b64 > API引用< / span > <!-- ] --> < / a > <!-- ] --> <!-- [ --> < a class = "VPLink link VPNavBarMenuLink" href = "/zht/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 = "/api/mp_math/equation.html" data-v-79776a7a > <!-- [ --> 简体中文<!-- ] --> < / a > < / div > < 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 > <!-- ] --> <!-- ] --> < / 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" targe
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-29 13:25:00 +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-29 13:25:00 +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-29 13:25:00 +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-29 13:25:00 +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 class = "last-updated" data-v-a4b38bd6 > < p class = "VPLastUpdated" data-v-a4b38bd6 data-v-5cebc0fc > Last updated: < time datetime = "2024-08-29T07:07:35.000Z" data-v-5cebc0fc > < / time > < / p > < / 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 = "/zht/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 = "/zht/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 >
< 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 r p z H y 2 M \ " , \ " a p i _ i n d e x . m d \ " : \ " Q 9 o D v H _ 6 \ " , \ " a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " B C 8 m L T 9 V \ " , \ " a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " C z j B J I j C \ " , \ " a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " D E w n q i M 5 \ " , \ " a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " B O c Z - k 7 E \ " , \ " a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " C g P Z q W k 2 \ " , \ " a p i _ m p _ m a t h _ l i n e . m d \ " : \ " B 9 p r k 9 K j \ " , \ " a p i _ m p _ m a t h _ m p _ m a t h . m d \ " : \ " B M E F q L K u \ " , \ " a p i _ m p _ m a t h _ m p _ m a t h _ t y p i n g . m d \ " : \ " C K m r v j J E \ " , \ " a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " C U v Z 7 j G 1 \ " , \ " a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " B W t m 0 p 2 C \ " , \ " a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " C e 2 D r j t _ \ " , \ " a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " B L A I Q Y J V \ " , \ " a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " B C Y H Q W 5 q \ " , \ " a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " D p b h b Z u Y \ " , \ " a p i _ p a r t i c l e _ p a r t i c l e . m d \ " : \ " B p w 0 M V 0 e \ " , \ " a p i _ p r e s e t s _ i n d e x . m d \ " : \ " C r T H Q D y B \ " , \ " a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " D Y X 4 V z Q J \ " , \ " a p i _ p r e s e t s _ m o d e l _ m o d e l . m d \ " : \ " D N X A L r 2 n \ " , \ " a p i _ p r e s e t s _ p r e s e t s . m d \ " : \ " D 3 v t k 8 s c \ " , \ " 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 \ " : \ " C H 3 w 1 c s g \ " , \ " e n _ a p i _ i n d e x . m d \ " : \ " C c T W W u 9 r \ " , \ " e n _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " y v 5 o r y g X \ " , \ " e n _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " C w N 5 - L S I \ " , \ " e n _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " D w w u R d 9 E \ " , \ " e n _ a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " n 3 _ M F y 8 m \ " , \ " e n _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " C h U I w S I A \ " , \ " e n _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " C s L k F B W 5 \ " , \ " e n _ a p i _ m p _ m a t h _ m p _ m a t h . m d \ " : \ " D J S 2 q f 3 J \ " , \ " 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 \ " : \ " B R 4 P P C j - \ " , \ " e n _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " D j H 7 G w u Z \ " , \ " e n _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " B W V v x L r x \ " , \ " e n _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " B E 8 b o 5 x 9 \ " , \ " e n _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " B T O p 0 U z p \ " , \ " e n _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " B N D _ - H D s \ " , \ " e n _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " _ w U K 3 v 4 2 \ " , \ " e n _ a p i _ p a r t i c l e _ p a r t i c l e . m d \ " : \ " C - m i N 5 a a \ " , \ " e n _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " 9 3 s 9 N T D q \ " , \ " e n _ a p i _ p r e s e t s _ m o d e l _ i n d e x . m d \ " : \ " D c j f 9 y D t \ " , \ " e n _ a p i _ p r e s e t s _ m o d e l _ m o d e l . m d \ " : \ " N e R Z C R e 5 \ " , \ " e n _ a p i _ p r e s e t s _ p r e s e t s . m d \ " : \ " D 2 N L t 3 O v \ " , \ " 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 U i 9 7 z n f \ " , \ " j a _ a p i _ i n d e x . m d \ " : \ " B q - U q h K m \ " , \ " j a _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " C O K T - 3 q 5 \ " , \ " j a _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " B 4 H x 0 P D l \ " , \ " j a _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " B y V C w m o 8 \ " , \ " j a _ a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " D O k B m Q k F \ " , \ " j a _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " 8 L k E w D I J \ " , \ " j a _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " q b P L x e p H \ " , \ " j a _ a p i _ m p _ m a t h _ m p _ m a t h . m d \ " : \ " D K 0 n b 8 o Y \ " , \ " 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 \ " : \ " C W g c 3 o h G \ " , \ " j a _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " B J F p J M 2 I \ " , \ " j a _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " 0 Y s o z w P t \ " , \ " j a _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " B n r D C N W p \ " , \ " j a _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " C l I g A y 7 y \ " , \ " j a _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " B 4 i i s 1 R 2 \ " , \ " j a _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " C F - T 1 D a N \ " , \ " j a _ a p i _ p a r t i c l e _ p a r t i c l e . m d \ " : \ " C V i X N y f B \ " , \ " j a _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " B 7 y g l 0 8 S \ " , \ " 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 Q l i i N _ s \ " , \ " j a _ a p i _ p r e s e t s _ m o d e l _ m o d e l . m d \ " : \ " D o 2 Q S w o B \ " , \ " j a _ a p i _ p r e s e t s _ p r e s e t s . m d \ " : \ " C 1 N N 1 Q P M \ " , \ " 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 2 h N R c u q \ " , \ " z h t _ a p i _ i n d e x . m d \ " : \ " B z a F n M g S \ " , \ " z h t _ a p i _ m p _ m a t h _ a n g l e . m d \ " : \ " _ Y g A K K Z 8 \ " , \ " z h t _ a p i _ m p _ m a t h _ c o n s t . m d \ " : \ " B g 9 y f r e y \ " , \ " z h t _ a p i _ m p _ m a t h _ e q u a t i o n . m d \ " : \ " D l 4 V l L 2 q \ " , \ " z h t _ a p i _ m p _ m a t h _ f u n c t i o n . m d \ " : \ " D C Z G s z h C \ " , \ " z h t _ a p i _ m p _ m a t h _ i n d e x . m d \ " : \ " D K O G J - 3 J \ " , \ " z h t _ a p i _ m p _ m a t h _ l i n e . m d \ " : \ " B a - c p u k S \ " , \ " z h t _ a p i _ m p _ m a t h _ m p _ m a t h . m d \ " : \ " D _ T B b v z i \ " , \ " 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 \ " : \ " B J _ j D c l m \ " , \ " z h t _ a p i _ m p _ m a t h _ p l a n e . m d \ " : \ " B v A 7 i 9 g f \ " , \ " z h t _ a p i _ m p _ m a t h _ p o i n t . m d \ " : \ " D 8 L 5 j _ 3 H \ " , \ " z h t _ a p i _ m p _ m a t h _ s e g m e n t . m d \ " : \ " B A 1 z E c o t \ " , \ " z h t _ a p i _ m p _ m a t h _ u t i l s . m d \ " : \ " B x P b 0 J B p \ " , \ " z h t _ a p i _ m p _ m a t h _ v e c t o r . m d \ " : \ " E O H N - 8 S i \ " , \ " z h t _ a p i _ p a r t i c l e _ i n d e x . m d \ " : \ " J r c a 0 i M X \ " , \ " z h t _ a p i _ p a r t i c l e _ p a r t i c l e . m d \ " : \ " B R E K h h 7 3 \ " , \ " z h t _ a p i _ p r e s e t s _ i n d e x . m d \ " : \ " w h J M V g u T \ " , \ " 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 q P I k H v h \ " , \ " 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 \ " : \ " x 1 H K R u e 1 \ " , \ " z h t _ a p i _ p r e s e t s _ p r e s e t s . m d \ " : \ " B H P z i O m Z \ " , \ " 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-29 13:25:00 +08:00
< / body >
< / html >