Can I use the symbolic math tool box to solve a series of expressions symbolically with respect to specific terms?
2 次查看(过去 30 天)
显示 更早的评论
I would like to solve the following system of symbolic expressions for symbol A with respect to symbols n, K, I, P and D. I have tried using the "solve symbolic equation" task in the live script but I'm unsure how to specificy which symbols I want in the final expression. Below is the code I have thus far:
syms B E A X n K P I D V W
eqn1 = (B*E)/(A^(1/2)*X^n) == K
eqn2 = D + B == E
eqn3 = X + n*B == P
eqn4 = A + B/2 == I
eqn5 = 0.05 == I
eqn6 = (2*I-2*A)/(A^(1/2)*(P-n*(2*I-2*A))^n) == K
eqn7 = (P/n - (E*V)/(n-n*V))/(A^(1/2)*((E*V)/(1-V))^n) == K
eqn8 = (P-n*B)/(D+B+P-n*B) == V
eqn9 = E/(E+X) == W
eqn10 = X/(E+X) == V
eqn11 = V+W == 1
eqn12 = n == 2
eqns = [eqn1 eqn2 eqn3 eqn4 eqn5 eqn6 eqn7 eqn8 eqn9 eqn10 eqn11]
S = solve(eqns,[A])
0 个评论
回答(1 个)
Walter Roberson
2021-11-29
You must solve() for as many variables as the rank of the system.
You have 12 equations in 11 variables. There might not be a solution at all.
If you want to solve in terms of 5 variables then you can solve no more than 12-5=7 of the equations.
I recommend against solving 0.05==I or n==2. Just substitute those into the equations. Well except for the fact that you want to solve in terms of symbol I even though you know its exact value, so maybe leave that equation out.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!