# Solve equation including parameters dependent on main variable

3 vues (au cours des 30 derniers jours)
Dhruv Borda le 21 Jan 2022
Modifié(e) : Yongjian Feng le 21 Jan 2022
% Temperature
T_C=300;
T_E=linspace(0,300);
tau=T_C./T_E;
% Phase angle
X=0;
% Heat lifted
Q_max=0.085377;
Analysis
S=(2*X*tau)./(tau+1);
% Heat lifted and Work done
A=sqrt(tau.^2 + k^2 + 2*tau*k*cos(alpha));
B=tau + k + 2*S;
delta=A./B;
theta=(atan((k*sin(alpha))./(tau + k*cos(alpha))));
For range of values of tau, I want to have 'k'. But the problem is there are variables in Q_max equation such as delta and theta which are dependant on k by themselves. What should I do?
ratio=solve('Q_max==(pi*sqrt(1-delta).*delta.*sin(theta))./((1+k).*sqrt(1+delta).*(1+sqrt(1-delta.^2)))','k');
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponses (1)

Yongjian Feng le 21 Jan 2022
Modifié(e) : Yongjian Feng le 21 Jan 2022
1. k shall be a symbol, once you do this before it is used, then this will take care of the dependency of delta and theta.
syms k;
2. solve takes function and symbol(s), not char array
ratio=solve(Q_max==(pi*sqrt(1-delta).*delta.*sin(theta))./((1+k).*sqrt(1+delta).*(1+sqrt(1-delta.^2))), k);
3. There are some issues of your script, for example, T_E starts with 0, so tau = T_C/T_E is infinity. You might need to clean those up.
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Calculus dans Help Center et File Exchange

R2020a

### Community Treasure Hunt

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

Start Hunting!

Translated by