All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
AIM:- Parsing NASA thermodynamic data Writing MATLAB coding for reading a NASA thermodynamic data file. Coding of extracting the coefficient from the file. Coding of calculating thermodynamic properties with the help of extracting co-efficient for a particular species. Calculate the molecular weight of each species…
Arun Gupta
updated on 18 Oct 2022
AIM:- Parsing NASA thermodynamic data
Molecular mass Function Codding:
function [M]=molecular_mass(molecule_name);
fprintf('Molecular weight of ');
fprintf(molecule_name);
fprintf(' : ');
atoms=['h','C','N','O','R'];
%R is for argon molecule and not use ()these small brackets.
atom_weight=[1 12 14 16 40];
M=0;
for i=1:length(molecule_name);
for j=1:length(atoms)
if strcmpi(molecule_name(i),atoms(j));
%strcmp means string comparision .it is used for checking that both elements are same or not. and by use strcmpi here,it take doesn't matter about elements are capital letter or small Example'h' =='H'means case insensitive condition.
M=M+atom_weight(j);
position=j;
% here, we are storing the position of corrected match molecule characters to the atoms
end
end
n= str2num(molecule_name(i));
%this all proces is doing for a number multiplier in molecule name.so the value of n will be come same as a number value present in that string name
if n > 1
M=M+atom_weight(position)*(n-1);
%here we are taking (n-1) in multiply instead of n because we are input second time coding M=M+atom_weight.so by this two times mass add so to over come this we are reducing n to n-1 time
end
end
fprintf('%d',M);%d is for digit
disp(' ')
%it is not necessary command disp which refers to display, space (' ').But it for second time running the program because it separates the molecular weight statements to additional matlab warning statements like directory is already exist.
end
Plots of O2:
Plots of N2:
Plots of CO2:
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Project 1 : Flow over Ahmed Body
Flow over Ahmed's Body The Ahmed body represents a simplified, ground vehicle geometry of a bluff body type. Its shape is simple enough to allow for accurate flow simulation but retains some important practical features relevant to automobile bodies. This model describes how to calculate the turbulent flow field around…
24 Nov 2023 05:24 AM IST
Project 1 : CFD Meshing for Tesla Cyber Truck
Objective : To Identify & clean up all the topological errors in the given Tesla Cyber Truck Car model. To create a surface mesh. To Create a wind tunnel around Tesla Cyber Truck Car. To create a volumetric mesh to perform an external flow CFD analysis simulation. Introduction : ANSA : ANSA is a Computer-aided engineering tool…
09 Sep 2023 11:52 AM IST
Project 1 - Meshing of Floor Panel
AIM:- To mesh the given floor panel for the given quality criterias without any failure in the elements. Project description:- FLOOR PANEL GIVEN:- Procedures for Meshing a 2D component:- i) Importing the CAD model into ANSA:- The cad model is imported into the Ansa software by clicking File ---> New command. ii) Geometry…
04 Mar 2023 05:12 AM IST
Project 1 : CFD Meshing for Tesla Cyber Truck
Objective : To Identify & clean up all the topological errors in the given Tesla Cyber Truck Car model. To create a surface mesh. To Create a wind tunnel around Tesla Cyber Truck Car. To create a volumetric mesh to perform an external flow CFD analysis simulation. Introduction : ANSA : ANSA is…
04 Mar 2023 05:05 AM IST
Related Courses
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.