How to evaluate a partial derivative.

17 visualizaciones (últimos 30 días)
Tyler Cooper
Tyler Cooper el 30 de Sept. de 2016
Respondida: Walter Roberson el 30 de Sept. de 2016
I am trying to do propagation of uncertainty for an experiment. I am able to define the derivatives, but I cant figure out how to input the actual values of the variables after the differentiation.
Code starts here:
syms P1 P2 P3 T1 T3
Cp=R_air*((log(P2/P1))/(log((T*(P2/P3))/(T))))
DCp_DP1=diff(Cp,P1)
DCp_DP2=diff(Cp,P2)
DCp_DP3=diff(Cp,P3)
DCp_DT1=diff(Cp,T1)
DCp_DT3=diff(Cp,T3)
Now that MATLAB has taken the partial derivatives, I want to evaluate these derivatives at
P1=16.243, P2=11.595, P3=12.575, T1=293.25, and T3=293.25

Respuestas (1)

Walter Roberson
Walter Roberson el 30 de Sept. de 2016
vars = {P1, P2, P3, T1, T3};
vals = {16.243, 11.595, 12.575, 293.25, 293.25};
subs(DCp_DP1, vars, vals)

Categorías

Más información sobre Function Creation en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by