How to evaluate a partial derivative.

조회 수: 16 (최근 30일)
Tyler Cooper
Tyler Cooper 2016년 9월 30일
답변: Walter Roberson 2016년 9월 30일
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

답변 (1개)

Walter Roberson
Walter Roberson 2016년 9월 30일
vars = {P1, P2, P3, T1, T3};
vals = {16.243, 11.595, 12.575, 293.25, 293.25};
subs(DCp_DP1, vars, vals)

카테고리

Help CenterFile Exchange에서 Function Creation에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by