use symsum for equation forming and solving

2 次查看(过去 30 天)
I want to make a equation to slolve for variable Kd and write a code
l is index as s & c
p & and Tiijj are function of r where r is define as r_s and r_c
syms alpha s b c phi
Eq = a-b== (c-b)*(3*a+4*b)*symsum(phi_l*Tiijj(alpha_l),l,s,c) eq(1)
a = solve(Eq,a)
  2 个评论
Arvind
Arvind 2023-5-10
i am confused with the expression in summation and use of symsum because Tiijj are function of Kma,Kd,K*,mu_d,mu_ma,mu* and alpha
and phi is function of alpha
alpha = [0.1 0.18 0.3];, Kma,K*,mu_ma,mu* all are constant value
and here calculate the value of Kd
Torsten
Torsten 2023-5-10
编辑:Torsten 2023-5-10
Don't use "symsum" in the case of only two terms in the sum.
Just write something like
syms alpha T(alpha,a) phi(alpha) a b c d
alpha_s = 1;
alpha_c = 5;
phi(alpha) = alpha^2;
T(alpha,a) = alpha^4 + a^2;
eqn = a-b==1/3*(c-b)*(3*a+4*d)/(3*b+4*d)*(phi(alpha_s)*T(alpha_s,a)+phi(alpha_c)*T(alpha_c,a));
sol = solve(eqn,a,'MaxDegree',3)
sol = 

请先登录,再进行评论。

采纳的回答

Torsten
Torsten 2023-5-10
The equation is linear in k_d.
So collect all terms containg k_d on the left hand side, all other terms on the right-hand side. Then factor out k_d and divide by the multiplicative factor.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by