LMCAS
Lamina Computer Algebra System
载入中...
搜索中...
未找到
vector_calculus_theorems.hpp
浏览该文件的文档.
1#pragma once
2
4
5namespace LMCAS {
6
7/**
8 * @brief 格林定理:计算 ∬_R (∂Q/∂x - ∂P/∂y) dA。
9 *
10 * 等价于闭合曲线积分 ∮_C P dx + Q dy。
11 * region 以积分区间表示:x ∈ [x_lo, x_hi], y ∈ [y_lo(x), y_hi(x)]。
12 *
13 * @param[in] P 向量场 x 分量
14 * @param[in] Q 向量场 y 分量
15 * @param[in] vars 变量名列表 {x_var, y_var}
16 * @param[in] x_bounds x 的积分区间 {下界, 上界}
17 * @param[in] y_bounds y 的积分区间 {下界(可含x), 上界(可含x)}
18 * @return 格林定理计算的二重积分结果
19 */
21 const std::shared_ptr<SymbolicExpr>& P,
22 const std::shared_ptr<SymbolicExpr>& Q,
23 const std::vector<std::string>& vars,
24 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& x_bounds,
25 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& y_bounds,
27
28/**
29 * @brief 使用默认计算上下文计算格林定理面积分,并显式报告无效输入和未覆盖域。
30 */
32 const std::shared_ptr<SymbolicExpr>& P,
33 const std::shared_ptr<SymbolicExpr>& Q,
34 const std::vector<std::string>& vars,
35 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& x_bounds,
36 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& y_bounds);
37
38LMCAS_API std::shared_ptr<SymbolicExpr> greens_theorem(
39 const std::shared_ptr<SymbolicExpr>& P,
40 const std::shared_ptr<SymbolicExpr>& Q,
41 const std::vector<std::string>& vars,
42 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& x_bounds,
43 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& y_bounds);
44
45/**
46 * @brief 利用格林定理计算封闭曲线围成的面积 A = (1/2)∮(x dy - y dx)。
47 *
48 * @param[in] parametrization 曲线参数化 r(t) = (x(t), y(t))
49 * @param[in] t 参数变量名
50 * @param[in] a 参数下界
51 * @param[in] b 参数上界
52 * @return 面积表达式
53 */
56 const std::string& t,
57 const std::shared_ptr<SymbolicExpr>& a,
58 const std::shared_ptr<SymbolicExpr>& b,
60
61/**
62 * @brief 使用默认计算上下文计算格林面积公式,并显式报告无效输入和未覆盖域。
63 */
66 const std::string& t,
67 const std::shared_ptr<SymbolicExpr>& a,
68 const std::shared_ptr<SymbolicExpr>& b);
69
70LMCAS_API std::shared_ptr<SymbolicExpr> greens_theorem_area(
72 const std::string& t,
73 const std::shared_ptr<SymbolicExpr>& a,
74 const std::shared_ptr<SymbolicExpr>& b);
75
76/**
77 * @brief 散度定理(高斯定理):计算 ∭_V ∇·F dV。
78 *
79 * 等价于封闭曲面上的通量积分 ∬_S F·dS。
80 * volume_bounds 以迭代积分区间表示。
81 *
82 * @param[in] F 三维向量场
83 * @param[in] vars 变量名列表 {x, y, z}
84 * @param[in] x_bounds x 的积分区间
85 * @param[in] y_bounds y 的积分区间(可含 x)
86 * @param[in] z_bounds z 的积分区间(可含 x, y)
87 * @return 散度定理计算的三重积分结果
88 */
90 const VectorField& F,
91 const std::vector<std::string>& vars,
92 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& x_bounds,
93 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& y_bounds,
94 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& z_bounds,
96
97/**
98 * @brief 使用默认计算上下文计算散度定理体积分,并显式报告无效输入和未覆盖域。
99 */
101 const VectorField& F,
102 const std::vector<std::string>& vars,
103 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& x_bounds,
104 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& y_bounds,
105 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& z_bounds);
106
107LMCAS_API std::shared_ptr<SymbolicExpr> divergence_theorem(
108 const VectorField& F,
109 const std::vector<std::string>& vars,
110 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& x_bounds,
111 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& y_bounds,
112 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& z_bounds);
113
114/**
115 * @brief 斯托克斯定理:计算 ∬_S (∇×F)·dS。
116 *
117 * 等价于边界曲线上的环量积分 ∮_C F·dr。
118 * 通过参数化曲面计算 ∬(∇×F)·(r_u × r_v) du dv。
119 *
120 * @param[in] F 三维向量场
121 * @param[in] vars 变量名列表 {x, y, z}
122 * @param[in] parametrization 曲面参数化 r(u,v) = (x(u,v), y(u,v), z(u,v))
123 * @param[in] u 第一参数变量名
124 * @param[in] v 第二参数变量名
125 * @param[in] u_bounds u 的积分区间
126 * @param[in] v_bounds v 的积分区间
127 * @return 斯托克斯定理计算的曲面积分结果
128 */
130 const VectorField& F,
131 const std::vector<std::string>& vars,
133 const std::string& u, const std::string& v,
134 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& u_bounds,
135 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& v_bounds,
137
138/**
139 * @brief 使用默认计算上下文计算斯托克斯定理曲面积分,并显式报告无效输入和未覆盖域。
140 */
142 const VectorField& F,
143 const std::vector<std::string>& vars,
145 const std::string& u, const std::string& v,
146 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& u_bounds,
147 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& v_bounds);
148
149LMCAS_API std::shared_ptr<SymbolicExpr> stokes_theorem(
150 const VectorField& F,
151 const std::vector<std::string>& vars,
153 const std::string& u, const std::string& v,
154 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& u_bounds,
155 const std::pair<std::shared_ptr<SymbolicExpr>, std::shared_ptr<SymbolicExpr>>& v_bounds);
156
157}
#define LMCAS_API
__attribute__((visibility("default"))) VectorCalculusExprResult surface_integral_scalar_checked(const std __attribute__((visibility("default"))) VectorCalculusExprResult surface_integral_scalar_checked(const std __attribute__((visibility("default"))) std const VectorField const std::string const std::string & v
const std::vector< Polynomial< BigInt > > const BigInt ComputationContext & context
__attribute__((visibility("default"))) VectorCalculusFieldResult gradient_checked(const std __attribute__((visibility("default"))) VectorCalculusFieldResult gradient_checked(const std __attribute__((visibility("default"))) VectorField gradient(const std const std::vector< std::string > & vars
std::shared_ptr< SymbolicExpr > divergence_theorem(const VectorField &F, const std::vector< std::string > &vars, const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > &x_bounds, const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > &y_bounds, const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > &z_bounds)
std::shared_ptr< SymbolicExpr > greens_theorem(const std::shared_ptr< SymbolicExpr > &P, const std::shared_ptr< SymbolicExpr > &Q, const std::vector< std::string > &vars, const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > &x_bounds, const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > &y_bounds)
VectorCalculusExprResult greens_theorem_area_checked(const VectorField &parametrization, const std::string &t, const std::shared_ptr< SymbolicExpr > &a, const std::shared_ptr< SymbolicExpr > &b, ComputationContext &context)
const MultiPoly & b
std::shared_ptr< SymbolicExpr > stokes_theorem(const VectorField &F, const std::vector< std::string > &vars, const VectorField &parametrization, const std::string &u, const std::string &v, const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > &u_bounds, const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > &v_bounds)
VectorCalculusExprResult greens_theorem_checked(const std::shared_ptr< SymbolicExpr > &P, const std::shared_ptr< SymbolicExpr > &Q, const std::vector< std::string > &vars, const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > &x_bounds, const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > &y_bounds, ComputationContext &context)
__attribute__((visibility("default"))) std const std::vector< std::string > const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > & z_bounds
VectorCalculusExprResult divergence_theorem_checked(const VectorField &F, const std::vector< std::string > &vars, const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > &x_bounds, const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > &y_bounds, const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > &z_bounds, ComputationContext &context)
__attribute__((visibility("default"))) std const std::vector< std::string > const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > & x_bounds
__attribute__((visibility("default"))) VectorCalculusExprResult curve_integral_scalar_checked(const std __attribute__((visibility("default"))) VectorCalculusExprResult curve_integral_scalar_checked(const std __attribute__((visibility("default"))) std const VectorField const std::string const std::shared_ptr< SymbolicExpr > & a
std::vector< std::shared_ptr< SymbolicExpr > > VectorField
向量场由标量表达式组成。
std::shared_ptr< SymbolicExpr > greens_theorem_area(const VectorField &parametrization, const std::string &t, const std::shared_ptr< SymbolicExpr > &a, const std::shared_ptr< SymbolicExpr > &b)
__attribute__((visibility("default"))) std const std::vector< std::string > const VectorField const std::string const std::string const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > & u_bounds
__attribute__((visibility("default"))) std const std::vector< std::string > const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > & y_bounds
__attribute__((visibility("default"))) VectorCalculusExprResult curve_integral_scalar_checked(const std __attribute__((visibility("default"))) VectorCalculusExprResult curve_integral_scalar_checked(const std __attribute__((visibility("default"))) std const VectorField & parametrization
Result< std::shared_ptr< SymbolicExpr > > VectorCalculusExprResult
VectorCalculusExprResult stokes_theorem_checked(const VectorField &F, const std::vector< std::string > &vars, const VectorField &parametrization, const std::string &u, const std::string &v, const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > &u_bounds, const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > &v_bounds, ComputationContext &context)
__attribute__((visibility("default"))) std const std::vector< std::string > const VectorField const std::string const std::string const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > const std::pair< std::shared_ptr< SymbolicExpr >, std::shared_ptr< SymbolicExpr > > & v_bounds
__attribute__((visibility("default"))) VectorCalculusExprResult curve_integral_scalar_checked(const std __attribute__((visibility("default"))) VectorCalculusExprResult curve_integral_scalar_checked(const std __attribute__((visibility("default"))) std const VectorField const std::string & t
__attribute__((visibility("default"))) VectorCalculusExprResult surface_integral_scalar_checked(const std __attribute__((visibility("default"))) VectorCalculusExprResult surface_integral_scalar_checked(const std __attribute__((visibility("default"))) std const VectorField const std::string & u