Azzera filtri
Azzera filtri

use symsum for equation forming and solving

2 visualizzazioni (ultimi 30 giorni)
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 Commenti
Arvind
Arvind il 10 Mag 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 il 10 Mag 2023
Modificato: Torsten il 10 Mag 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 = 

Accedi per commentare.

Risposta accettata

Torsten
Torsten il 10 Mag 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 Commento
Arvind
Arvind il 10 Mag 2023
this is simple method i know but i confused with summation part

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by