How to make this plot?
조회 수: 7 (최근 30일)
이전 댓글 표시
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
2023년 6월 10일
Beyond that, solve this:
for one of them as a function of the other, and plot the result.
답변 (1개)
Samya
2023년 6월 10일
편집: Samya
2023년 6월 12일
- Input the amount of substance of hydrogen gas (n)
- Define temperature range from 30 to 90 °C with 20 °C interval and pressure range from 1 to 50 bar
- Create a grid for temperature and pressure
- 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
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.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!