How to solve a system of equations with integrals
14 ビュー (過去 30 日間)
古いコメントを表示
x1, x2 and x3 are variables. Could anyone tell me how to solve the below system of equations? Thanks!
採用された回答
Walter Roberson
2021 年 3 月 8 日
syms x1 x2 x3 t real
assume(x1>=0 & x2>=0 & x3>=0 & t>=0)
eqn1 = simplify(int(x1*x2*t, t, x3, 0.8)) == 0.5
eqn2_part1 = simplify(int(x1*x2*t, t, x3, t))
eqn2_part2 = simplify(x1+x2+t)
eqn2_part3 = simplify(int(eqn2_part1 / eqn2_part2, t, 0.1, x3))
eqn2 = simplify(eqn2_part3 == 0.4)
eqns = (subs([eqn1; eqn2], x3, 1-x1-x2))
sol = solve(eqns, 'returnconditions', true)
sol.x1
sol.x2
sol.conditions
eqnexpr = lhs(eqns)-rhs(eqns);
char(eqnexpr)
Feqns = matlabFunction(eqnexpr, 'vars', {[x1, x2]})
nsol = fsolve(Feqns, [1/2 1/3])
4 件のコメント
Walter Roberson
2021 年 3 月 8 日
There are other approaches as well, but their success depends upon knowing the constraints.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!