Samir Khan: New Applications
http://www.maplesoft.com/applications/author.aspx?mid=613
en-us2016 Maplesoft, A Division of Waterloo Maple Inc.Maplesoft Document SystemSat, 28 May 2016 22:11:45 GMTSat, 28 May 2016 22:11:45 GMTNew applications published by Samir Khanhttp://www.mapleprimes.com/images/mapleapps.gifSamir Khan: New Applications
http://www.maplesoft.com/applications/author.aspx?mid=613
Thermal Efficiency of the combined (binary) cycle with T-s and h-s charts
http://www.maplesoft.com/applications/view.aspx?SID=154050&ref=Feed
This application calculates the thermal efficiency of a steam turbine (based on a Rankine cycle), combined with a gas turbine based on the Brayton Cycle) with the creating a T-s and h-s (Mollier) live charts.<img src="/view.aspx?si=154050/Gas-Steam-Cycle-T-s-h-s-charts.png" alt="Thermal Efficiency of the combined (binary) cycle with T-s and h-s charts" align="left"/>This application calculates the thermal efficiency of a steam turbine (based on a Rankine cycle), combined with a gas turbine based on the Brayton Cycle) with the creating a T-s and h-s (Mollier) live charts.154050Mon, 21 Mar 2016 04:00:00 ZProf. Valery OchkovProf. Valery OchkovWorking with Thermophysical Data: Dew-Point and Wet-Bulb Temperature of Air
http://www.maplesoft.com/applications/view.aspx?SID=154054&ref=Feed
Maple can perform calculations and generate visualizations involving thermophysical properties of pure fluids, humid air, and mixtures. Using the dew-point and web-bulb temperature of air as an example, this Tips and Techniques application demonstrates how to access thermophysical properties data, perform calculations that include units, and visualize the results on a psychrometric chart.
<BR><BR>
Atmospheric air contains varying levels of water vapor. Weather reports often quantify the water content of air with its relative humidity; this is the amount of water in air, divided by the maximum amount of water air can hold at the same temperature.
<BR><BR>
Given the temperature and the relative humidity of air, you can calculate:
<UL>
<LI>the temperature below which water condenses out of air - this is known as the dew-point
<LI>the coldest temperature you can achieve through evaporative cooling - this is known as the wet-bulb temperature
</UL><img src="/view.aspx?si=154054/webbulb.PNG" alt="Working with Thermophysical Data: Dew-Point and Wet-Bulb Temperature of Air" align="left"/>Maple can perform calculations and generate visualizations involving thermophysical properties of pure fluids, humid air, and mixtures. Using the dew-point and web-bulb temperature of air as an example, this Tips and Techniques application demonstrates how to access thermophysical properties data, perform calculations that include units, and visualize the results on a psychrometric chart.
<BR><BR>
Atmospheric air contains varying levels of water vapor. Weather reports often quantify the water content of air with its relative humidity; this is the amount of water in air, divided by the maximum amount of water air can hold at the same temperature.
<BR><BR>
Given the temperature and the relative humidity of air, you can calculate:
<UL>
<LI>the temperature below which water condenses out of air - this is known as the dew-point
<LI>the coldest temperature you can achieve through evaporative cooling - this is known as the wet-bulb temperature
</UL>154054Wed, 09 Mar 2016 05:00:00 ZSamir KhanSamir KhanEngine Noise Spectogram
http://www.maplesoft.com/applications/view.aspx?SID=153978&ref=Feed
This application plots the spectrogram and power spectrum of the sound of an engine changing gears.<img src="/view.aspx?si=153978/Engine_Noise_Spectrogram.png" alt="Engine Noise Spectogram" align="left"/>This application plots the spectrogram and power spectrum of the sound of an engine changing gears.153978Wed, 02 Mar 2016 05:00:00 ZSamir KhanSamir KhanVehicle Ride and Handling Analysis
http://www.maplesoft.com/applications/view.aspx?SID=153980&ref=Feed
This tool lets you experiment with the steer- and camber-by-roll coefficients of a 3-DOF vehicle model, and simulate the effect on the yaw gain curve and the understeer coefficient.<img src="/view.aspx?si=153980/Vehicle_Ride.png" alt="Vehicle Ride and Handling Analysis" align="left"/>This tool lets you experiment with the steer- and camber-by-roll coefficients of a 3-DOF vehicle model, and simulate the effect on the yaw gain curve and the understeer coefficient.153980Wed, 02 Mar 2016 05:00:00 ZSamir KhanSamir KhanAnalysis of a Vapor Compression Refrigeration Cycle
http://www.maplesoft.com/applications/view.aspx?SID=153982&ref=Feed
This application analyzes the heat flows across a vapor compression refrigeration cycle, and calculates its coefficient of performance.
<BR><BR>
Additionally, the thermodynamic cycle will be plotted on a pressure-enthalpy-temperature chart.
<BR><BR>
The compressor, condenser, throttle and evaporator are analyzed in sequence with this equation, a statement of the conservation of energy,
<BR><BR>
q - w= Δh + ΔKE + ΔPE
<BR><BR>
where
<UL>
<LI>w is the work done by the component
<LI>ΔKE and ΔPE are the changes in kinetic and potential energy
<LI>Δh is the change in specific enthalpy
<LI>q is the heat transferred to the system
</UL><img src="/view.aspx?si=153982/Analysis_VCRC.png" alt="Analysis of a Vapor Compression Refrigeration Cycle" align="left"/>This application analyzes the heat flows across a vapor compression refrigeration cycle, and calculates its coefficient of performance.
<BR><BR>
Additionally, the thermodynamic cycle will be plotted on a pressure-enthalpy-temperature chart.
<BR><BR>
The compressor, condenser, throttle and evaporator are analyzed in sequence with this equation, a statement of the conservation of energy,
<BR><BR>
q - w= Δh + ΔKE + ΔPE
<BR><BR>
where
<UL>
<LI>w is the work done by the component
<LI>ΔKE and ΔPE are the changes in kinetic and potential energy
<LI>Δh is the change in specific enthalpy
<LI>q is the heat transferred to the system
</UL>153982Wed, 02 Mar 2016 05:00:00 ZSamir KhanSamir KhanChemical Kinetics Reaction Rate Estimation
http://www.maplesoft.com/applications/view.aspx?SID=153983&ref=Feed
This application estimates the rate parameters for a reversible reaction with dimerization of an intermediate.
<BR><BR>
It does this by
<UL>
<LI>parameterizing (with respect to the rate parameters) the numerical solution of the different equations that describe the reaction kinetics
<LI>calculating the sum of the square of the errors between the model predictions and experimental data
<LI>minimizing the sum of the square of the errors to find the best fit values of the rate parameters
</UL><img src="/view.aspx?si=153983/CKRR_Estimation.png" alt="Chemical Kinetics Reaction Rate Estimation" align="left"/>This application estimates the rate parameters for a reversible reaction with dimerization of an intermediate.
<BR><BR>
It does this by
<UL>
<LI>parameterizing (with respect to the rate parameters) the numerical solution of the different equations that describe the reaction kinetics
<LI>calculating the sum of the square of the errors between the model predictions and experimental data
<LI>minimizing the sum of the square of the errors to find the best fit values of the rate parameters
</UL>153983Wed, 02 Mar 2016 05:00:00 ZSamir KhanSamir KhanDouble Pipe Heat Exchanger
http://www.maplesoft.com/applications/view.aspx?SID=153984&ref=Feed
This application models the temperature dynamics of a countercurrent double pipe heat exchanger. Three partial differential equations describe
<UL>
<LI>heat balances across the tube- and shell-side liquids,
<LI>and a heat balance across the tube-wall (taking into account the heat flow from the shell- and tube-side liquids, and conduction along the length of the tube)
</UL>
The equations are solved numerically, and the temperature profiles are plotted. The heat exchanger is assumed to be perfectly insulated. Densities, specific heat capacities, heat transfer coefficients, and thermal conductivities are assumed to be constant.<img src="/view.aspx?si=153984/Double_Pipe.png" alt="Double Pipe Heat Exchanger" align="left"/>This application models the temperature dynamics of a countercurrent double pipe heat exchanger. Three partial differential equations describe
<UL>
<LI>heat balances across the tube- and shell-side liquids,
<LI>and a heat balance across the tube-wall (taking into account the heat flow from the shell- and tube-side liquids, and conduction along the length of the tube)
</UL>
The equations are solved numerically, and the temperature profiles are plotted. The heat exchanger is assumed to be perfectly insulated. Densities, specific heat capacities, heat transfer coefficients, and thermal conductivities are assumed to be constant.153984Wed, 02 Mar 2016 05:00:00 ZSamir KhanSamir KhanEconomic Pipe Sizer
http://www.maplesoft.com/applications/view.aspx?SID=153985&ref=Feed
Pipework is a large part of the cost of a process plant. Plant designers need to minimize the total cost of this pipework across the lifetime of the plant. The total overall cost is a combination of individual costs relating to the
<UL>
<LI>pipe material,
<LI>installation,
<LI>maintenance,
<LI>depreciation,
<LI>energy costs for pumping,
<LI>liquid parameters,
<LI>required flowrate,
<LI>pumping efficiencies,
<LI>taxes,
<LI>and more.
</UL>
This application uses the approach described in the reference to find the pipe diameter that minimizes the total overall cost. The method involves the iterative solution of an empirical equation using Maple’s fsolve() function (the code is in the Startup code region)
<BR><BR>
Bear in mind that the empirical parameters vary as economic conditions change. Those used in this application are correct for 1998 and 2008 (as given in the reference)
<BR><BR>
Reference: "Updating the Rules for Pipe Sizing", Durand et al., Chemical Engineering, January 2010<img src="/view.aspx?si=153985/EPS.png" alt="Economic Pipe Sizer" align="left"/>Pipework is a large part of the cost of a process plant. Plant designers need to minimize the total cost of this pipework across the lifetime of the plant. The total overall cost is a combination of individual costs relating to the
<UL>
<LI>pipe material,
<LI>installation,
<LI>maintenance,
<LI>depreciation,
<LI>energy costs for pumping,
<LI>liquid parameters,
<LI>required flowrate,
<LI>pumping efficiencies,
<LI>taxes,
<LI>and more.
</UL>
This application uses the approach described in the reference to find the pipe diameter that minimizes the total overall cost. The method involves the iterative solution of an empirical equation using Maple’s fsolve() function (the code is in the Startup code region)
<BR><BR>
Bear in mind that the empirical parameters vary as economic conditions change. Those used in this application are correct for 1998 and 2008 (as given in the reference)
<BR><BR>
Reference: "Updating the Rules for Pipe Sizing", Durand et al., Chemical Engineering, January 2010153985Wed, 02 Mar 2016 05:00:00 ZSamir KhanSamir KhanInteracting Tank Resevoirs
http://www.maplesoft.com/applications/view.aspx?SID=153986&ref=Feed
This worksheet models liquid flow between three tanks connected by two pipes (the first pipe connecting Tank 1 and 2, and the second pipe connecting Tank 2 and 3).
<BR><BR>
The flow is opposed by pipe friction, and the level of liquid in each tank oscillates to equilibrium. Differential equations that describe the dynamic change in liquid height in each tank and a momentum balance are solved numerically.<img src="/view.aspx?si=153986/itr.png" alt="Interacting Tank Resevoirs" align="left"/>This worksheet models liquid flow between three tanks connected by two pipes (the first pipe connecting Tank 1 and 2, and the second pipe connecting Tank 2 and 3).
<BR><BR>
The flow is opposed by pipe friction, and the level of liquid in each tank oscillates to equilibrium. Differential equations that describe the dynamic change in liquid height in each tank and a momentum balance are solved numerically.153986Wed, 02 Mar 2016 05:00:00 ZSamir KhanSamir KhanAmplifier Gain
http://www.maplesoft.com/applications/view.aspx?SID=153987&ref=Feed
In this application, we will plot the gain of an amplifier circuit, for both the ideal and non-ideal response.<img src="/view.aspx?si=153987/Amplifier_Gain.png" alt="Amplifier Gain" align="left"/>In this application, we will plot the gain of an amplifier circuit, for both the ideal and non-ideal response.153987Wed, 02 Mar 2016 05:00:00 ZSamir KhanSamir KhanAmplifier Gain Application
http://www.maplesoft.com/applications/view.aspx?SID=153988&ref=Feed
This application provides an interface that lets you experiment with amplifier parameters, and plot the ideal and non-ideal gain.<img src="/view.aspx?si=153988/AGA.png" alt="Amplifier Gain Application" align="left"/>This application provides an interface that lets you experiment with amplifier parameters, and plot the ideal and non-ideal gain.153988Wed, 02 Mar 2016 05:00:00 ZSamir KhanSamir KhanPV Diode Parameter Estimation
http://www.maplesoft.com/applications/view.aspx?SID=153990&ref=Feed
The behavior of a photovoltaic diode is often modeled with an equivalent circuit and described by an implicit diode equation.
<BR><BR>
This application
<UL>
<LI>will rearrange the diode equation to give the current in terms of the LambertW equation
<LI>find the best-fit parameters against experimental data
</UL><img src="/view.aspx?si=153990/PV_Diode_Estimation.png" alt="PV Diode Parameter Estimation" align="left"/>The behavior of a photovoltaic diode is often modeled with an equivalent circuit and described by an implicit diode equation.
<BR><BR>
This application
<UL>
<LI>will rearrange the diode equation to give the current in terms of the LambertW equation
<LI>find the best-fit parameters against experimental data
</UL>153990Wed, 02 Mar 2016 05:00:00 ZSamir KhanSamir KhanDownloading Stock Prices and Plotting Returns Distributions
http://www.maplesoft.com/applications/view.aspx?SID=153991&ref=Feed
This application:
<UL>
<LI>downloads historical stock prices from Yahoo Finance,
<LI>calculates the returns,
<LI>plots the distribution of the returns in a histogram,
<LI>and overlays a normal distribution with the same mean and standard deviation as the historical data.
</UL><img src="/view.aspx?si=153991/Stock_Prices.png" alt="Downloading Stock Prices and Plotting Returns Distributions" align="left"/>This application:
<UL>
<LI>downloads historical stock prices from Yahoo Finance,
<LI>calculates the returns,
<LI>plots the distribution of the returns in a histogram,
<LI>and overlays a normal distribution with the same mean and standard deviation as the historical data.
</UL>153991Wed, 02 Mar 2016 05:00:00 ZSamir KhanSamir KhanDrawdown of Historical Stock Prices
http://www.maplesoft.com/applications/view.aspx?SID=153992&ref=Feed
The drawdown of a stock indicates how much time it's spent "underwater" - it's essentially the percentage drop of its price from a peak to a trough, with the drawdown resetting to zero if a previous high is reached. The drawdown of a stock is a valuable risk measure and is employed by traders to gauge volatility.
<BR><BR>
This application:
<UL>
<LI>downloads historical stock prices from Yahoo Finance for a chosen ticker symbol,
<LI>defines a procedure that calculates the drawdown of the historical stock price,
<LI>and plots the drawdown against the adjusted close price of the asset.
</UL>
By changing the ticker and the dates, you can examine drawdown of any stock between your chosen dates.<img src="/view.aspx?si=153992/Drawdown.png" alt="Drawdown of Historical Stock Prices" align="left"/>The drawdown of a stock indicates how much time it's spent "underwater" - it's essentially the percentage drop of its price from a peak to a trough, with the drawdown resetting to zero if a previous high is reached. The drawdown of a stock is a valuable risk measure and is employed by traders to gauge volatility.
<BR><BR>
This application:
<UL>
<LI>downloads historical stock prices from Yahoo Finance for a chosen ticker symbol,
<LI>defines a procedure that calculates the drawdown of the historical stock price,
<LI>and plots the drawdown against the adjusted close price of the asset.
</UL>
By changing the ticker and the dates, you can examine drawdown of any stock between your chosen dates.153992Wed, 02 Mar 2016 05:00:00 ZSamir KhanSamir KhanIs a Stock Overvalued or Undervalued?
http://www.maplesoft.com/applications/view.aspx?SID=153993&ref=Feed
This application calculates the fair value of a stock, given the current market prices and several growth assumptions. Simply pick an industry, stock exchange, and then a company.
<BR><BR>
Maple then downloads the current market share price, EPS (for the trailing 12 months) and dividends (for the trailing 12 months) from Yahoo Finance (hence a connection to the web is needed). Given a series of growth assumptions, a fair value is then calculated. The valuation process is described at the bottom of this application, and is most appropriate for stable companies with a history of dividend payments.
<BR><BR>
The stock is undervalued if the fair value is greater than the current market price, and vice-versa.
<BR><BR>
This application comes with an Excel spreadsheet with a list of over 25000 companies across multiple industries and international exchanges, and their corresponding ticker symbols.<img src="/view.aspx?si=153993/stock_overvalued.png" alt="Is a Stock Overvalued or Undervalued?" align="left"/>This application calculates the fair value of a stock, given the current market prices and several growth assumptions. Simply pick an industry, stock exchange, and then a company.
<BR><BR>
Maple then downloads the current market share price, EPS (for the trailing 12 months) and dividends (for the trailing 12 months) from Yahoo Finance (hence a connection to the web is needed). Given a series of growth assumptions, a fair value is then calculated. The valuation process is described at the bottom of this application, and is most appropriate for stable companies with a history of dividend payments.
<BR><BR>
The stock is undervalued if the fair value is greater than the current market price, and vice-versa.
<BR><BR>
This application comes with an Excel spreadsheet with a list of over 25000 companies across multiple industries and international exchanges, and their corresponding ticker symbols.153993Wed, 02 Mar 2016 05:00:00 ZSamir KhanSamir KhanPortfolio Optimization with the Omega Ratio
http://www.maplesoft.com/applications/view.aspx?SID=153994&ref=Feed
Traditional investment performance benchmarks, like the Sharpe Ratio, approximate the returns distribution with mean and standard deviation. This, however, assumes the distribution is normal. Many modern investments vehicles, like hedge funds, display fat tails, and skew and kurtosis in the returns distribution. Hence, they cannot be adequately benchmarked with traditional approaches.
<BR><BR>
One solution, proposed by Shadwick and Keating in 2002 is the Omega Ratio. This divides the returns distribution into two halves the area below a target return, and the above a target return. The Omega Ratio is simply the former divided by the latter. A higher value is better.
<BR><BR>
This application finds the asset weights that maximize the Omega Ratio of a portfolio of ten investments, given their simulated monthly returns and a target return.
<BR><BR>
This is a non-convex problem, and requires global optimizers for a rigorous solution. However, a transformation of the variables (only valid for Omega Ratios of over 1) converts the optimization into a linear program.
<BR><BR>
This application implements both approaches, the former using Maple's Global Optimization Toolbox, and the latter using Maple's linear programming features. For the data set provided in this application, both approaches give comparable results.<img src="/view.aspx?si=153994/omega_ratio.png" alt="Portfolio Optimization with the Omega Ratio" align="left"/>Traditional investment performance benchmarks, like the Sharpe Ratio, approximate the returns distribution with mean and standard deviation. This, however, assumes the distribution is normal. Many modern investments vehicles, like hedge funds, display fat tails, and skew and kurtosis in the returns distribution. Hence, they cannot be adequately benchmarked with traditional approaches.
<BR><BR>
One solution, proposed by Shadwick and Keating in 2002 is the Omega Ratio. This divides the returns distribution into two halves the area below a target return, and the above a target return. The Omega Ratio is simply the former divided by the latter. A higher value is better.
<BR><BR>
This application finds the asset weights that maximize the Omega Ratio of a portfolio of ten investments, given their simulated monthly returns and a target return.
<BR><BR>
This is a non-convex problem, and requires global optimizers for a rigorous solution. However, a transformation of the variables (only valid for Omega Ratios of over 1) converts the optimization into a linear program.
<BR><BR>
This application implements both approaches, the former using Maple's Global Optimization Toolbox, and the latter using Maple's linear programming features. For the data set provided in this application, both approaches give comparable results.153994Wed, 02 Mar 2016 05:00:00 ZSamir KhanSamir KhanEl Centro Earthquake Data Analysis
http://www.maplesoft.com/applications/view.aspx?SID=153995&ref=Feed
This application analyzes the response of a SDOF to the 1940 El Centro earthquake using acceleration data recorded from a seismograph located near the fault line. Additionally, a spectrogram and a power spectrum of the earthquake data are generated.<img src="/view.aspx?si=153995/El_Centro.png" alt="El Centro Earthquake Data Analysis" align="left"/>This application analyzes the response of a SDOF to the 1940 El Centro earthquake using acceleration data recorded from a seismograph located near the fault line. Additionally, a spectrogram and a power spectrum of the earthquake data are generated.153995Wed, 02 Mar 2016 05:00:00 ZSamir KhanSamir KhanFitting Wave Height Data to a Probability Distribution
http://www.maplesoft.com/applications/view.aspx?SID=153996&ref=Feed
The University of Maine records real-time accelerometer data from buoys deployed in the Gulf of Maine and the Caribbean (http://gyre.umeoce.maine.edu/buoyhome.php). The data can be downloaded from their website, and includes the significant wave height recorded at regular intervals for the last few months.
<BR><BR>
This application:
<UL>
<LI>downloads accelerometer data for Buoy PR206 (located just off the coast of Puerto Rico at a latitude of 18° 28.46' N and a longitude of 66° 5.94' W),
<LI>fits the significant wave height to a Weibull distribution via two methods: maximum likelihood estimation and moment matching,
<LI>and plots the fitted distributions on top of a histogram of the experimental data.
</UL><img src="/view.aspx?si=153996/Fitting_Wave_Height.png" alt="Fitting Wave Height Data to a Probability Distribution" align="left"/>The University of Maine records real-time accelerometer data from buoys deployed in the Gulf of Maine and the Caribbean (http://gyre.umeoce.maine.edu/buoyhome.php). The data can be downloaded from their website, and includes the significant wave height recorded at regular intervals for the last few months.
<BR><BR>
This application:
<UL>
<LI>downloads accelerometer data for Buoy PR206 (located just off the coast of Puerto Rico at a latitude of 18° 28.46' N and a longitude of 66° 5.94' W),
<LI>fits the significant wave height to a Weibull distribution via two methods: maximum likelihood estimation and moment matching,
<LI>and plots the fitted distributions on top of a histogram of the experimental data.
</UL>153996Wed, 02 Mar 2016 05:00:00 ZSamir KhanSamir KhanVisualizing Live Earthquake Data from the Internet
http://www.maplesoft.com/applications/view.aspx?SID=153997&ref=Feed
This application plots the location of all earthquakes of magnitude M1 or greater in the US over the last 2.5 days.
<BR><BR>
The data is compiled by the U.S. Geological Survey and downloaded from http://earthquake.usgs.gov/earthquakes/feed/v1.0/csv.php<img src="/view.aspx?si=153997/visualizing_earthquake.png" alt="Visualizing Live Earthquake Data from the Internet" align="left"/>This application plots the location of all earthquakes of magnitude M1 or greater in the US over the last 2.5 days.
<BR><BR>
The data is compiled by the U.S. Geological Survey and downloaded from http://earthquake.usgs.gov/earthquakes/feed/v1.0/csv.php153997Wed, 02 Mar 2016 05:00:00 ZSamir KhanSamir KhanFuel Pod Design Optimization
http://www.maplesoft.com/applications/view.aspx?SID=153998&ref=Feed
A manufacturer has designed a fuel pod in NX. The fuel pod has a hemispherical and conical end, and a cylindrical midsection.
<BR><BR>
To minimize material costs, the manufacturer wants to minimize the surface area of the fuel pod while maintaining the existing volume.
<BR><BR>
This application:
<UL>
<LI>pulls the current dimensions of the fuel pod (radius of the hemispherical end, length of the cylindrical midsection, and height of the conical end) from the NX CAD model,
<LI>calculates the current volume of the fuel pod,
<LI>optimizes the dimensions to minimize the surface area while maintaining the existing volume,
<LI>and pushes the optimized dimensions back into the NX CAD model.
</UL><img src="/view.aspx?si=153998/fuel_pod.png" alt="Fuel Pod Design Optimization" align="left"/>A manufacturer has designed a fuel pod in NX. The fuel pod has a hemispherical and conical end, and a cylindrical midsection.
<BR><BR>
To minimize material costs, the manufacturer wants to minimize the surface area of the fuel pod while maintaining the existing volume.
<BR><BR>
This application:
<UL>
<LI>pulls the current dimensions of the fuel pod (radius of the hemispherical end, length of the cylindrical midsection, and height of the conical end) from the NX CAD model,
<LI>calculates the current volume of the fuel pod,
<LI>optimizes the dimensions to minimize the surface area while maintaining the existing volume,
<LI>and pushes the optimized dimensions back into the NX CAD model.
</UL>153998Wed, 02 Mar 2016 05:00:00 ZSamir KhanSamir Khan