# 3d plot and optimization

18 ビュー (過去 30 日間)
black_powr 2019 年 12 月 2 日
Answered: 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 2019 年 12 月 2 日
• I then want to solve this graph to find the coordinates that gives the minimum value of Cost

サインイン to comment.

### 件の回答 (1)

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

#### 0 件のコメント

サインイン to comment.

サインイン してこの質問に回答します。