Filter löschen
Filter löschen

use symsum for equation forming and solving

2 Ansichten (letzte 30 Tage)
Arvind
Arvind am 10 Mai 2023
Bearbeitet: Torsten am 10 Mai 2023
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 Kommentare
Arvind
Arvind am 10 Mai 2023
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 am 10 Mai 2023
Bearbeitet: Torsten am 10 Mai 2023
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 = 

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Torsten
Torsten am 10 Mai 2023
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.
  1 Kommentar
Arvind
Arvind am 10 Mai 2023
this is simple method i know but i confused with summation part

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by