Using powers in calculations?
이전 댓글 표시
Good day,
Som insight why there are two different evaluations for “basically” the same calculus…
u=symunit;
V1 = .15*u.m^3;
p1 = 2*u.bar;
V2 = .02*u.m^3;
gma=1.4;
p2=p1*V1^gma/V2^gma
Output for this coud p2 =((2*(0.1500*[m]^3)^1.4000)/(0.0200*[m]^3)^1.4000)*[bar].
And for…
u=symunit;
V1 = .15*u.m^3;
p1 = 2*u.bar;
V2 = .02*u.m^3;
gma=1.4;
p2=p1*(V1/V2)^gma
Is this one - p2 =33.5827*[bar]
How the program is calculating powers? What's the difference between these two cases?
답변 (1개)
Steven Lord
2020년 9월 2일
They give the same results, just in different forms.
u=symunit;
V1 = .15*u.m^3;
p1 = 2*u.bar;
t1 = (12+273)*u.K;
V2 = .02*u.m^3;
gma=1.4;
p2=p1*V1^gma/V2^gma
p3=p1*(V1/V2)^gma
Now check:
isAlways(p2 == p3) % true
simplify(p2)
simplify(p3) % these two simplify calls give the same result
The bottle of soda sitting next to me says it contains 2 liters, 2 quarts 3.6 fluid ounces, or 67.6 fluid ounces. That's three different ways to describe the same amount of soda.
댓글 수: 3
Andrew
2020년 9월 2일
Steven Lord
2020년 9월 2일
My guess is that the symunit functionality in Symbolic Math Toolbox is unwilling to work with fractional dimensions unless you explicitly tell it to simplify the result. (cubic meters)^(1.4) is meters^(4.2) -- what does that represent?
When you divide cubic meters by cubic meters before raising the result to the 1.4 power, you're raising a unitless quantity to that power.
Andrew
2020년 9월 2일
카테고리
도움말 센터 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!