Solve an equation with matrices

Rh=0.0282
Tc its my variable
Too - matrix 1x200
Tii - matrix 1x200
q - matrix 1x200
dTlm=(((Tc-Too)-(Tc-Tii))./(log((Tc-Too)./(Tc-Tii))));
solve=solve(q=dTlm./Rh);
I wanto top know the value of:
Tc(1) for q(1), Tii(1), Too(1).
Tc(2) for q(2), Tii(2), Too(2).
.
.
Tc(200) for q(200), Tii(200), Too(200).
Someone knows how this works?

Réponses (1)

Torsten
Torsten le 27 Avr 2022
syms tii too tc q rh
eqn = (tii-too) == q*rh*log((tc-too)/(tc-tii));
tc = solve(eqn,tc);
Tc = double(subs(tc,[tii,too,q,rh],[Tii,Too,Q,Rh]))
where Tii, Too, Tc, Q, Rh are your numerical objects (4 matrices of size 1x200 (Tii,Too,Tc,Q) and one scalar (Rh))

3 commentaires

Miguel Fernandes
Miguel Fernandes le 27 Avr 2022
Thanks a lot for the help!
Miguel Fernandes
Miguel Fernandes le 27 Avr 2022
Oh isn´t working, the coomand window give me this:
Warning: Solutions are valid under the following conditions: -pi < imag((tii - too)/(qq*rh)) & imag((tii - too)/(qq*rh)) <= pi. To include
parameters and conditions in the solution, specify the 'ReturnConditions' value as 'true'.
> In solve>warnIfParams (line 482)
In solve (line 357)
In Teste_Otim_2 (line 142)
If you change the equation to
eqn = (tc-tii)*exp((tii-too)/(q*rh)) == tc-too;
the warning messages should vanish.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Symbolic Math Toolbox dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by