3d plot and optimization

조회 수: 20 (최근 30일)
black_powr
black_powr 2019년 12월 2일
답변: Alan Weiss 2019년 12월 2일
I am attempting to plot a mesh 3D graph that displays how Cost varies with t, T and P. I then want to solve this graph to find the coordinates that gives the minimum value of Cost. This is the equation relation time, pressure, temperature to cost:
C = (t/60) + (0.18*(T-1073)*(t/3600)) + (1.75*(P/6894.76)*(t/3600));
This is the code I currently have and it doesn't seem to work
T=1073:1:1223;
t=1418.4:86.54:14400;
P=533984.04:4254.16:1172108.74;
[tm,Tm,Pm] = meshgrid(t, T, P);
C = (tm./60) + (0.18.*(Tm-1073).*(tm./3600)) + (1.75.*(Pm./6894.76).*(tm./3600));
figure(1)
mesh(t,T,P,C)
grid on
xlabel('t')
ylabel('T')
zlabel('P')
  댓글 수: 1
darova
darova 2019년 12월 2일
  • I then want to solve this graph to find the coordinates that gives the minimum value of Cost
What about min function?

댓글을 달려면 로그인하십시오.

답변 (1개)

Alan Weiss
Alan Weiss 2019년 12월 2일
It is hard to plot a function of three variables. For some approaches, see Plot 3-D Solutions and Their Gradients (this uses PDE Toolbox, but you don't need to have PDE Toolbox to understand or use the plotting ideas).
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation

카테고리

Help CenterFile Exchange에서 Geometry and Mesh에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by