the fsurf produce incorrect plotting?

조회 수: 1 (최근 30일)
Chuliang Fu
Chuliang Fu 2019년 9월 27일
편집: Asvin Kumar 2019년 10월 1일
Hi,
When I use [syms]+[fsurf]
it seems not produce correct answer:
syms T P
G=T*log(P);
fsurf(G,[298 500 10^(-10) 10])
20190926210237.png
it can be easily checked that it doesn't produce correct plotting by any analytical calculation
So why is that?

채택된 답변

Asvin Kumar
Asvin Kumar 2019년 9월 30일
편집: Asvin Kumar 2019년 10월 1일
The output by fsurf in the example given is being plotted for P in the range of 298 – 500 and T in the range of 10^(-10) – 10. This behaviour is observed because fsurf maps the values in the xyinterval argument to the symbolic variables in G as listed in:
symvar(G)
One simple workaround for this would be to replace [298 500 10^(-10) 10] with [10^(-10) 10 298 500].
Another approach would be to use symfun as follows:
syms T P
G= symfun(T*log(P),[T P]);
fsurf(G,[298 500 10^(-10) 10]);
For more details have a look at:

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Conversion Between Symbolic and Numeric에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by