3d plot and optimization

13 ビュー (過去 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 Center および File ExchangeGeometry and Mesh についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by