d.partush
d.partush

Reputation: 9

Solve equation with known variables and one unknown

I'm trying to solve this equation in Matlab

dT=((-A-B*C+D*./E)

where C=sin(dT). dT is unknown. A, B, D, and E are known variables. Using Matlab's solve function:

Ans=solve(dT==((-gra-H_vap*m_lg+grb*./ro_cp),dT);

But I receive an error message. How do I solve this equation?

Upvotes: 0

Views: 466

Answers (1)

dfrib
dfrib

Reputation: 73186

You haven't given us any specifics on the values of your known parameters, and I also believe that D*/E in your example were intended to be a more valid expression.

Anyway, here is an example of how you make use of the symbolic solver solve:

syms dT

A = 1
B = 2
D = [1 2]
E = [3 4]
eqn = -A - B*sin(dT) + D/E - dT == 0

soldT = solve(eqn,dT)

which produces the following output

% ...

eqn =

- dT - 2*sin(dT) - 14/25 == 0

% ... 

soldT =

-0.18739659458654612052194305796251

See also the language docs for solve.

Upvotes: 1

Related Questions