LMCAS
Lamina Computer Algebra System
载入中...
搜索中...
未找到
symbolic_implicit_diff.cpp
浏览该文件的文档.
3
4namespace LMCAS {
5
6std::shared_ptr<SymbolicExpr> implicit_diff(
7 std::shared_ptr<SymbolicExpr> expression,
8 const std::string& independent_variable,
9 const std::string& dependent_variable) {
11 detail::RewriteBudget transform_budget(context, (context).limits().max_recursion_depth,
12 (context).limits().max_ast_nodes, "transform");
13 if (!expression || independent_variable.empty() || dependent_variable.empty()) {
14 return nullptr;
15 }
16
17 auto numerator = SymbolicExpr::multiply(
18 SymbolicExpr::number(-1),
19 detail::make_expression_ptr(detail::differentiate_node(detail::node(expression), independent_variable, transform_budget)));
20 auto denominator = detail::make_expression_ptr(detail::differentiate_node(detail::node(expression), dependent_variable, transform_budget));
21 return SymbolicExpr::divide(numerator, denominator);
22}
23
24} // namespace LMCAS
SymbolicNodePtr differentiate_node(const SymbolicNodePtr &node, const std::string &variable, RewriteBudget &budget, const FactsQuery &facts, Domain domain)
std::shared_ptr<::LMCAS::SymbolicExpr > make_expression_ptr(SymbolicNodePtr root)
const SymbolicNodePtr & node(const ::LMCAS::SymbolicExpr &expression) noexcept
const std::vector< Polynomial< BigInt > > const BigInt ComputationContext & context
const ExprPtr & denominator
std::shared_ptr< SymbolicExpr > implicit_diff(std::shared_ptr< SymbolicExpr > expression, const std::string &independent_variable, const std::string &dependent_variable)
隐函数微分 dy/dx = -F_x / F_y。