All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
1) Integration/Area Under Curve 1.1 PV Diagram In thermodynamics, a PV diagram is a plot which shows the relationship between the pressure and volume for a particular process. We know that dw=p.dv is the small work done by the process at a particular instance. Hence, total work done by a process from…
Adnan Zaib Bhat
updated on 08 Jan 2019
In thermodynamics, a PV diagram is a plot which shows the relationship between the pressure and volume for a particular process. We know that dw=p.dv is the small work done by the process at a particular instance. Hence, total work done by a process from the state a to b is given by: W=∫badw=∫bap.dv, which is also the area under the curve. Thus, in order to find the work done by a thermodynamic process, we simply find the area under the pv curve. If the equation of the curve is explicitly known, the work done can be calculated by analytic or symbolic methods. However, in practical applications, we have to use numeric methods. For example, the pv diagram generated from the data given in the Converge file in Part I of this project was plotted by the various measured values (points) and not by an analytic equation per se. Thus, in order to calculate the area under the curve, numerical integration is employed. There are many numerical integration techniques. The most widely employed methods (esp in python) are the Trapezoidal and the Simpson's rule. Note that indefinite integration is an analytic or symbolic technique. Hence, numerical integration is only applicable to definite integrals. Also, numerical integration (or any numerical technique) is always a close approximation to the true value.
I will discuss briefly the concepts of general integration and two key numerical integration methods in python. It is important to know how numerical integration works before implementing python functions. Otherwise, we could get the wrong results.
In analytical integration (finding integrals), a curve, f(x) is divided into thin rectangular strips and then the area is approximated by the sum of the rectangles. The height of the rectangle is the value of the function at x, i.e., f(x), and the width of the element is the difference between two adjacent x values, i.e., △x=xi-xi-1. The smaller the width of the element, better will be the area estimation. In calculus, we know that, if the width of the element becomes infinitesimal, i.e., △x→zero=dx, the sum of the elements will be equal to the area under the curve. In other words, the integral will be equal to the sum of elements.
∫f(x).dx= lim△x→0∑ f(x)⋅ △x
Figure 2.1, shows how the width of the elements affects the approximation of the area under the curve.
As the width of the elements approaches to zero, the number of elements will tend to infinity. In computing, we cannot use the above method to evaluate an integral. This is because computing infinitely is not a wise thing to do. This is where numerical methods come into play. Numerical methods give us close approximations but practical results.
This method is probably the oldest and the simplest numerical integration method used to calculate areas. In this method, the area under a curve is approximated by a linear function (linear interpolant). In other words, the area is split into small trapeziums. For example, in figure 1.3, the area under the curve (blue line) is approximated by a trapezium (red line shows a linear curve). If we need to integrate the curve (say) f(x) between a and b, then, the heights for the trapezium at a and b are given by f(a) and f(b) respectively. Thus, the area under curve approximated by the trapezium is given by:
∫baf(x)≈12⋅base⋅ [sum of parallel sides]
⇒ ∫baf(x)≈12⋅(b-a)⋅[f(a)+f(b)]
Now, if two trapeziums are put into practice, the area would become closer to the true value. Which means that the error will be lessened. Using the same figure (1.3) we now have 3 base points, say, a, x1 and b. Therefore the area will be given by:
∫baf(x)≈12⋅(x1-a)⋅[f(a)+f(x1)]+ 12⋅(b-x1)⋅[f(x1)+f(b)]
Now, say that if the two bases of the trapeziums are equal, i.e., (x1-a)=(b-x1)=△x, then we can write:
∫baf(x)≈12⋅△x⋅[f(a)+f(x1)]+ 12⋅△x⋅[f(x1)+f(b)]
⇒ ∫baf(x)≈12⋅△x⋅[f(a)+f(x1)+f(x1)+f(b)]
⇒ ∫baf(x)≈12⋅△x⋅[f(a)+2.f(x1)+f(b)]
Equal Spaces
It is quite intivituive to see that greater the number of trapeziums (base points) better will be the approximation. Thus, if we divide a curve into 'n' equal width trapeziums, between the limits [a,b], the area is given by:
∫baf(x)≈12⋅△x⋅[f(a)+2.f(x1)+2.f(x2)+...+2.f(xn-1+f(b)]
⇒ ∫baf(x)≈12⋅△x⋅[f(x0)+2n-1∑i=1f(xi) +f(xn)] where △x=b-an , xi=a+i⋅△x and f(n)=f(b)
Larger the number of trapeziums, smaller will be the sub-intervals (△x), and hence, better will be the approximation.
Simpson's rule is a similar technique which uses a quadratic (parabolic) interpolant to approximate the area under a curve as shown in figure 1.4.
For n equally spaced intervals, the formula for the Simpson's rule is:
⇒ ∫baf(x)≈13⋅△x⋅[f(x0)+4f(x1)+2f(x2)+4f(x3)+2f(x4)+...+f(xn)] where △x=b-an and xi=a+i△x
Both Trapezium and Simpson's rules are, however, essentially used to integrate a curve where both x and y sample points are available. In such a case, it is unlikely that there would be equal bases or spaces between each y points. In such a scenario, the x sample points are used to evaluate individual spacings between each data points. This gives a better approximation than the equally spaced trapezoidal rule. The equation for an irregularly-spaced partition of [a,b], also known as 'chained trapezoidal rule' figure 1.5, is shown below:
⇒ ∫baf(x)≈ n∑i=1f(xi-1)+f(xi)2⋅△xi where △xi=xi-xi-1
In python, to integrate curves when samples are given, i.e., x and y values, two commonly used sub packages (functions) are:
In all of the above functions, the main input arguments are similar i.e., (y, x=None, dx=1.0), where y is the array containing the y-axis values, x is the optional x-sample. If x-sample is not given, then by default, the functions will assume a space of 1.0 units. When x-sample is known, one should always opt for inputting the x-array and not use dx value as it can give false results especially when a curve obtained is not technically a function. Equal spacings can be used only if x-sample data points are unknown and when the curve is strictly a function. Recall that a function is a one-to-one or many to one relation, i.e., mapping of each input (uniquely) to a single output. However, a curve which is closed, like a PV plot of a cyclic process, is definitely not a function. In such cases, integrating using y-sample and width will yield wrong results. More explanation in Section 2.1
Let me just extract the pressure and volume columns from the Converge file, plot the curve and the area using the matplotlib library. Also, using numpy.trapz, scipy.integrate.trapz and scipy.integrate.simps with equally spaced intervals as well as with different spaced (exact) intervals. (For detailed file parsing, check Part I of this project. link: https://projects.skill-lync.com/projects/File-Parsing-and-Data-Analysis-in-Python-Part-I-Interactive-Parsing-and-Data-Visualisation-24878 ).
The PV plot (blue curve) obtained and the area under the curve (red) is shown in figure 2.1 below.
Code For Curve plot, Area Plot and Area Calculation:
import numpy as np
import matplotlib.pyplot as plt
from scipy import integrate
#1) Extracting Volume and Pressure
Pressure = []
Volume = []
for line in open('engine_data.out','r'):
if '#' not in line:
Pressure.append(float(line.split()[1])) #Pressure is in the 2nd column
Volume.append(float(line.split()[7])) #Volume in 8th column of the file
#2) Converting to Numpy Array
Pressure = 1e6 * np.array(Pressure)
Volume = np.array(Volume)
'''
In the file, the units are given in MPa. In order to multiply each element with 10^6
converting, the list into a numpy array is desired
'''
#3) Plotting Curve with Area
plt.plot(Volume,Pressure, linewidth = 3)
plt.fill_between(Volume,Pressure, color = 'r', alpha = 0.5) #filling the area with half opacity
plt.title('Pressure Volume Diagram and Area Under Curve')
plt.xlabel('Volume (m^3)')
plt.ylabel('Pressure (Pa)')
plt.legend(['Plot Curve', 'Area'])
plt.show()
#4) Calculating Area Under Curve
# With Equal Spacings
delta = (max(Volume) - min(Volume))/len(Volume)
print('Interval size, dx = %s' %delta)
print('\nArea, With Equal Intervals \n')
np_trapz_noX = np.trapz(Pressure, dx = delta)
spy_trapz_noX = integrate.trapz(Pressure, dx = delta)
spy_simps_noX = integrate.simps(Pressure, dx = delta)
print(' numpy.trapz (equal) = %s' %np_trapz_noX )
print(' scipy.integrate.trapz (equal) = %s' %spy_trapz_noX )
print(' scipy.integrate.simps (equal) = %s' %spy_simps_noX )
# With Samples, Unequal Interval Sizes
print('\nArea, When Intervals Taken From Sample \n')
np_trapz_sample = np.trapz(Pressure, Volume)
spy_trapz_sample = integrate.trapz(Pressure, Volume)
spy_simps_sample = integrate.simps(Pressure, Volume)
print(' numpy.trapz with (unequal/sample) = %s' %np_trapz_sample)
print(' scipy.integrate.trapz with (unequal/sample) = %s' %spy_trapz_sample)
print(' scipy.integrate.simps with (unequal/sample) = %s' %spy_simps_sample)
Output Display:
From the output results, it is clear that there is a significant difference between the two areas calculated with equal and unequal intervals. In order to understand why there is such a difference, and which area is more accurate, one needs to understand the working of the python integral functions along with the concept of the Otto cycle process.
An Otto cycle is a (idealised) thermodynamic cycle in which the heat is added and removed at constant volumes. This cycle is used in a petrol/gasoline engine. In an idealised version, there are four processes involved in an Otto cycle viz isentropic compression, isochoric (constant volume) heat addition, isentropic expansion, and isochoric heat rejection. Thus, ideally, the work done in an Otto cycle is the difference between the work output during isentropic expansion and the work input during isentropic compression.
Check out: https://projects.skill-lync.com/projects/Otto-Cycle-Plot-Generator-Using-Python-40641 to know more about the generation of an ideal Otto Cycle.
In an ideal cycle, there is no work done or extracted during the intake and exhaust stroke. However, practically, due to friction and other factors, there is some work done/extracted during the intake and exhaust strokes. Also, the expansion and compression strokes deviate from the isentropic trend and become more or less adiabatic. Lastly, the heat addition and rejection do not completely occur at constant volumes. Figure 2.2 shows an actual otto cycle.
It can be clearly seen in figure 2.1 and especially 2.2 that not only is work involved during compression and power (expansion) strokes, but during intake, exhaust, heat addition as well as heat removal processes. Also, it is followed from the characteristics of a graph that a process which is in the first (positive) quadrant and that is heading forward along the positive X-axis gives a positive area under it. On the other hand, if a curve, which is in the first quadrant and is heading towards or along the negative X-axis, the area under it is negative. To illustrate this example, suppose a function f(x) has values f(x1) and f(x2) at points x1 and x2 respectively. Also, let f(x1),f(x2)>0 and x1<x2. Now, when we numerically calculate the area from the trapezoidal rule, we use the formula:
△ area =12⋅(x2-x1)(f(x1)+f(x2)) =12(positive term)⋅(positive term)=positive
Thus, in this case, the area will be positive and the successive x values will be increasing. On the other hand, if we have x1>x2, the area will be:
△ area =12⋅(x2-x1)(f(x1)+f(x2)) =12(negative term)⋅(positive term)=negative
Now, in the PV plot, the curve is moving forward along the positive X-axis for some values of the volume, while at other points it is not. Thus, some area must be positive and some negative. To illustrate this, let me divide the process into 6 constituents: intake, compression, heat addition, expansion, heat removal and exhaust. The key point to examine here is that from the beginning of the data points of volume column to the maximum value of volume (when the piston is at BDC), the cycle is intaking air-fuel mixture. Now, from the BDC (Bottom Dead Centre), the piston will move and compress the gas and reach TDC (top dead centre) where the volume will be minimum. After that, heat addition will take place until the pressure is maximum. After that, the volume will again reach its maximum value (BDC) followed by the exhaust stroke. However, the data points given in the Converge file are not complete for a full engine cycle. In the fig. 2.2, it can be seen that the curve doesn't progress further along the compression stroke. Thus, we have only four processes in the data: intake, compression, heat addition and expansion.
Now to get the indices where maximum volume, minimum volume and maximum pressure occur, the following codes can be used:
#elementary method (slower):
print('Elementary Method\n')
for i in range(len(Pressure)):
if Pressure[i] == max(Pressure):
print(' Loop got max pressure of', Pressure[i],'(MPa), at index = ',i)
if Volume[i] == max(Volume):
print(' Loop got max volume of', Volume[i],'(m^3), at index = ',i)
if Volume[i] == min(Volume):
print(' Loop got min volume of', Volume[i],'(m^3), at index = ',i)
#indices from lists with function
v_high = Volume.index(max(Volume)) #max value in Volume
v_low = Volume.index(min(Volume)) #min value in Volume
p_high = Pressure.index(max(Pressure)) #max value in Pressure
print('\nUsing .index()\n')
print(' The maximum Volume point is', Volume[v_high], '(m^3), at index =', v_high)
print(' The minimum Volume point is', Volume[v_low], '(m^3), at index =', v_low)
print(' The maximum Pressure point is', Pressure[p_high], '(MPa), at index =', p_high)
#Numpy Search
v_high_np = np.argmax(Volume) #converts the list into array automatically
v_low_np = np.argmin(Volume)
p_high_np = np.argmax(Pressure)
print('\nNumpy Search\n')
print(' The maximum Volume point is', Volume[v_high_np], '(m^3), at index =', v_high_np)
print(' The minimum Volume point is', Volume[v_low_np], '(m^3), at index =', v_low_np)
print(' The maximum Pressure point is', Pressure[p_high_np], '(MPa), at index =', p_high_np)
Output:
>>>
Now, let me break the plot into four processes, fill the graph and calculate the area (with trapezium rule) under each process with the following code:
'''
Volume and Pressures are lists containing Volume and Pressure Data points
v_low, v_high and p_high are the indexes where minimum volume, maximum volume and maximum pressure occur
'''
## Process-Wise Graph
Pressure = 1e6*np.array(Pressure) #converting Mpa to Pa. Done only after getting the index first
plt.plot(Volume[:v_high],Pressure[:v_high],'r',linewidth = 3) #plot intake curve
plt.fill_between(Volume[:v_high],Pressure[:v_high],color='r') #fill intake area
plt.plot(Volume[v_high:v_low],Pressure[v_high:v_low],'g',linewidth = 3)
plt.fill_between(Volume[v_high:v_low],Pressure[v_high:v_low],color='g',alpha= 0.5)
plt.plot(Volume[v_low:p_high],Pressure[v_low:p_high],'b',linewidth = 3)
plt.fill_between(Volume[v_low:p_high],Pressure[v_low:p_high],color='b',alpha= 0.7)
plt.plot(Volume[p_high:],Pressure[p_high:],'k',linewidth = 3)
plt.fill_between(Volume[p_high:],Pressure[p_high:],color='k',alpha= 0.6)
plt.title('Pressure Volume Diagram')
plt.legend(['Intake', 'Compression', 'Heat Addition', 'Expansion'])
plt.xlabel('Volume (m^3)')
plt.ylabel('Pressure (Pa)')
plt.show()
##Area Values
work_general = np.trapz(Pressure, Volume)
work_intake = np.trapz(Pressure[:v_high], Volume[:v_high])
work_compression = np.trapz(Pressure[v_high:v_low], Volume[v_high:v_low])
work_heat_addition = np.trapz(Pressure[v_low:p_high], Volume[v_low:p_high])
work_expansion = np.trapz(Pressure[p_high:], Volume[p_high:])
works_sum = sum([work_intake,work_compression,work_heat_addition,work_expansion])
print('Area/work under curve with all points together = ',work_general,'\n')
print('Area/work during intake = ', work_intake)
print('Area/work during compression = ', work_compression)
print('Area/work during heat addition = ', work_heat_addition)
print('Area/work during expansion = ', work_expansion,'\n')
print('Sum of the areas of the four processes = ', works_sum)
Area Values:
It is clear from the above area values that the area under the given curve is around 500 units and not the value (around 282.9 units) that was calculated with equal interval width. The reason is explained in the following section (2.1.3).
When equal interval widths are chosen for the integration, a width of △x=5.96⋅10-8 is obtained, which is small but positive. (Recall that width, △=xn-x0n. Also, all the y values are positive. This means that for all iterations, the area calculated by the Trapezium rule must be positive which is confirmed by Output 2.3 below. Apparently, it seems that the area under curve must be positive and larger than the area calculated with unequal widths because there are some negative areas involved in the unequal intervals. However, from the calculations, the area calculated with equal widths is smaller than the one calculated with the unequal widths.
##Area Values With Equal Interval Widths
#Volume and Pressure are lists containing volume and pressure data points
delta = (max(Volume) - min(Volume))/len(Volume) #interval width
work_general = np.trapz(Pressure, dx = delta)
work_intake = np.trapz(Pressure[:v_high], dx = delta )
work_compression = np.trapz(Pressure[v_high:v_low], dx = delta)
work_heat_addition = np.trapz(Pressure[v_low:p_high], dx = delta)
work_expansion = np.trapz(Pressure[p_high:], dx = delta)
works_sum = sum([work_intake,work_compression,work_heat_addition,work_expansion])
print('Area/work under curve with all points together = ',work_general,'\n')
print('Areas With Equal Interval Widths\n')
print('Area/work during intake = ', work_intake)
print('Area/work during compression = ', work_compression)
print('Area/work during heat addition = ', work_heat_addition)
print('Area/work during expansion = ', work_expansion,'\n')
print('Sum of the areas of the four processes = ', works_sum)
Clearly, all areas are positive but very small in comparison to the values in Output 2.2.
Explanation:
In order to explain the difference in the areas calculated by the two methods, let me plot interval widths and the trapezium area for the sample (unequal/distinct) for each iteration using the code given below. It is obvious that the equal width remains the same.
##Plotting Interval Widths and Areas With Equal, Unequal Widths
#Pressure and Volume are lists containing pressure and volume data points
#delta is the equal interval width = (last volume - first volume)/no of volume points
widths = []
d_areas = []
d_delta_areas =[]
for i in range(len(Volume) - 1): #for n points, there are n-1 intervals
#widths
dif = Volume[i+1] - Volume[i]
#areas
product = 1/2* dif*(Pressure[i]+Pressure[i+1])
p_delta = 1/2* delta*(Pressure[i]+Pressure[i+1])
#areas lists
widths.append(dif)
d_areas.append(product)
d_delta_areas.append(p_delta)
delta_line = [delta]*(len(Volume)-1) #list with all points = delta
#Plotting Widths:
plt.plot(widths)
plt.plot(delta_line)
plt.title('Exact/Unequal and Equal Interval Widths')
plt.legend(['Exact/Unequal','Equal'])
plt.xlabel('Iteration')
plt.ylabel('Interval Width')
plt.grid()
plt.show()
#Plotting Areas:
plt.plot(d_areas)
plt.plot(d_delta_areas)
plt.title('Variation of Areas with Exact/Unequal and Equal Intervals')
plt.legend(['Exact/Unequal','Equal','Average'])
plt.xlabel('Iteration')
plt.ylabel('Interval Area')
plt.grid()
plt.show()
From figure 2.4, it is evident that the equal interval width deviates a lot from the sample widths. For some iterations, the actual interval width is greatly negative (compression stroke) and for some iterations, the actual interval width is greatly positive (expansion stroke). Thus, the equal interval width, which is very close to zero, contribute to a lesser overall area (even though all areas are positive) and the sample widths contribute to greater negative and positive areas (compare Output 2.2 and 2.3). This is illustrated in figure 2.5 below:
From the above discussion, it is clear that when non-uniform intervals widths are given, i.e., both X-axis and Y-axis samples/data points are given, one should not use equal width intervals.
It is quite clear that the Converge file has the data points only up to (may be up to the end of) the expansion stroke and that the data points for heat removal and the exhaust strokes are missing. Therefore, the data points don't represent the true area/work done in a cycle. This is because just like there is some positive work done during the intake and the heat addition stroke, there must be some (negative) work done during the heat removal and the exhaust strokes as well. Ideally, the work done in the cycle is equal to the difference of the expansion and the compression strokes only. However, it is obvious that the intake and exhaust works will almost balance each other and that they are less as compared to the expansion/compression stroke. Therefore, four cases arise.
##Displaying Various Case Work Values:
print('Work done in Joules during various cases')
#Case1
print('Case 1, Ideal: Work = ', work_expansion + work_compression) #compression work is already negative
#cAse2
print('Case 2, Actual: Work = ',work_expansion + work_heat_addition + work_intake + work_compression, '- Heat Removal - Exhaust Work')
#Case3
print('Case 3, Intake/Exhaust/Heat-Rem Neglected: Work = ', work_expansion + work_heat_addition + work_compression)
#case4
print('Case 4, Data Bound: Work = ', work_general )
output:
For further calculations, I will select the Data Bound Case (CASE4). This way, one doesn't need to break the plot into parts as done in previous sections. Also, the code will be simple and short. Lastly, the processes can't be broken if a 'complete' Converge file is provided as for then, there will be two max(Volume) points (one during the start of compression, another at the end of the expansion) so that breaking the curve into parts won't work with the logic that I gave in section 1.2.2.
Thus, work output = 500.6 Joules per cycle.
The power output of an engine can be calculated with the formula:
P=Ws where P is the power output, Ws is the work done per second.
There are four strokes in one Otto cycle. One cycle corresponds to two crank revolutions. Therefore, one revolution of crank corresponds to two strokes of the engine. Also, there is only one working stroke (power stroke) in one cycle, which means that two revolutions of crank correspond to one working-stroke. Thus:
1 crank revolution ⇒ 2 strokes
2 crank revolutions ⇒ 1 working-stroke, or
1 crank revolution ⇒12⋅ working stroke, and
1 cycle = 2 crank revolutions
∴ 1 rev =12 cycle =12 working stroke =2 strokes
Thus, if the RPM of an engine is N, then there are 2N strokes per minute or N2 working-strokes per minute and N2 cycles per minute. Also, if W is the work output per revolution, then power will be W⋅RPS (rev per second).
Converting the work output in terms of revolutions, we have:
work output = 500.6Jcyc=500.64Jstroke=500.62Jrev=500.6Jwstroke
⇒ work output = 500.6Jcyc=125.15Jstroke=250.3Jrev=500.6Jwstroke
Note: From the units of volume given in the Converge file, it is clear that it is not specific volume. This means that the work done in a cycle will be with absolute units and not specific (per kg). If the volume was specific, then the mass of the gas had to be calculated using the ideal gas equation PV=mRT where P and T are the standard pressure and temperature at which the gas enters (1atm,20 oC), R is the gas constant and m is the mass of the gas.atm
At an RPM of 1500, there are 3000 strokes per minute, 750 cycles per minute and 750 working-strokes per minute. Dividing each quantity by 60 will result in per-second dimensions. As such, we have a speed of 25 RPS, 50 strokes per second, 12.5 cycles per second and 12.5 working-strokes per second.
Thus, Power, P=250.3Jrev⋅25 revs= 6257.5Js≈6.3 kW
Note: The Power calculated above is derived for a single cylinder. An n-cylinder engine would produce n times the power.
Brake-specific fuel consumption (BSFC) is a measure of the fuel efficiency of any prime mover that burns fuel and produces rotational or shaft power. It is typically used for comparing the efficiency of internal combustion engines with a shaft output. It is the rate of fuel consumption divided by the power produced. It may also be thought of as power-specific fuel consumption, for this reason. BSFC allows the fuel efficiency of different engines to be directly compared. (Wikipedia)
If, r is the fuel consumption rate in grams per second (g/s) and P is the power output in watts, then
BSFC=rPgW.s=3.6⋅106rPgkW.h {BSFC is commonly expressed in g/(kW.h)}
Now, for a fuel consumption of 20 μg per cycle and a power output of 500.6 J per cycle, we have:
BSFC=20⋅10-6500.6gcycJcyc= 20500.6⋅10-6gsJs=3.99⋅10-8gW.s≈4⋅10-8gW.s
BSFC=3.6⋅106⋅4⋅10-8gkW.h=0.144gkW.h≈0.14gkW.h
Thus, the brake specific fuel consumption of the engine (given in the Converge file) at 1500 RPM and with a fuel consumption rate of 20μg per 4-stroke cycle is 0.14 g/(kW.h)
***END***
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...
File Parsing and Data Analysis in Python Part I (Interactive Parsing and Data Visualisation)
1) File Parsing Definition: Parse essentially means to ''resolve (a sentence) into its component parts and describe their syntactic roles''. In computing, parsing is 'an act of parsing a string or a text'. [Google Dictionary]File parsing in computer language means to give a meaning to the characters of a text file as per…
15 Jan 2019 02:28 PM IST
File Parsing and Data Analysis in Python Part I (Interactive Parsing and Data Visualisation)
1) File Parsing Definition: Parse essentially means to ''resolve (a sentence) into its component parts and describe their syntactic roles''. In computing, parsing is 'an act of parsing a string or a text'. [Google Dictionary]File parsing in computer language means to give a meaning to the characters of a text file as per…
09 Jan 2019 02:59 AM IST
File Parsing and Data Analysis in Python Part II (Area Under Curve and Engine Performance)
1) Integration/Area Under Curve 1.1 PV Diagram In thermodynamics, a PV diagram is a plot which shows the relationship between the pressure and volume for a particular process. We know that dw=p.dv is the small work done by the process at a particular instance. Hence, total work done by a process from…
08 Jan 2019 06:07 AM IST
Constrained Optimisation Using Lagrange Multipliers
Problem: Minimize: 5-(x-2)2-2(y-1)2; subject to the following constraint: x+4y=3 1) Lagrange Multipliers Lagrange multipliers technique is a fundamental technique to solve problems involving constrained problems. This method is utilised to find the local minima and maxima subjected to (at least one) equality…
22 Dec 2018 06:32 PM IST
Related Courses
0 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.