필터 지우기
필터 지우기

How to make this plot?

조회 수: 13 (최근 30일)
Yasmin Marsya
Yasmin Marsya 2023년 6월 10일
편집: Samya 2023년 6월 12일
Develop a program that displays an isotherms profile of hydrogen gas (PV diagram)
at a range of temperature of 30 to 90 °C for 20 °C interval and at a range of pressure
between 1 – 50 bar. The profile must be completed with title, axis labels, and legend.
Make sure to differentiate the series with different markers and different line types only,
the colour of the lines and markers must be black. Assume that the gas behaves as an
Ideal Gas Law and the program should request the user to input the amount of
substance of the hydrogen.
  댓글 수: 1
Star Strider
Star Strider 2023년 6월 10일
Use the hold function to plot all of them on the same axes.
Beyond that, solve this:
for one of them as a function of the other, and plot the result.

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

답변 (1개)

Samya
Samya 2023년 6월 10일
편집: Samya 2023년 6월 12일
Hi @Yasmin Marsya! Below is how you can approach to solve your question.
  1. Input the amount of substance of hydrogen gas (n)
  2. Define temperature range from 30 to 90 °C with 20 °C interval and pressure range from 1 to 50 bar
  3. Create a grid for temperature and pressure
  4. Calculate the volume of hydrogen gas using the Ideal Gas Law formula
% Creating a grid for temperature and pressure
[T, P] = meshgrid(T_range, P_range);
% Calculating the volume of hydrogen gas using Ideal Gas Law
V = (n * 8.314 * (T + 273.15)) ./ (P * 1e5);
5. Plot the isotherm profiles using the temperature and pressure as x and y-axis respectively and volume as a function
6. For each temperature values,
a) Set the marker to 'o', Line style to '-', and lineWidth to 2
b) Plot the isotherm profile, volume (y-axis) vs pressure (x-axis)
7. Add title, axis labels, legend and customize axes display,
a) Title - 'Isotherm Profile of Hydrogen Gas (30 to 90°C)'
b) X-Label - 'Volume (m^3)'
c) Y-Label - 'Pressure (bar)'
d) Legend - Show each temperature with a marker and line style used for the respective isotherm
e) Customize Axes display:
i) Set box on
ii) Set grid on
iii) Set plot background to white
iv) Set axis tick label font size and display precision
v) Set limit for x and y-axis based on the highest and lowest value of volume and pressure, respectively
Hope this helps! For any further clarifications do comment!
  댓글 수: 1
Dyuman Joshi
Dyuman Joshi 2023년 6월 11일
We do not recommended fully solving Homework assignments on MATLAB Answers. If you want to help, give hints (e.g mentioning which functions can be of use or linking some similar question that has been answered before) or provide a pseudocode.

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

카테고리

Help CenterFile Exchange에서 Volume Visualization에 대해 자세히 알아보기

태그

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by