Samir Khan: New Applications
http://www.maplesoft.com/applications/author.aspx?mid=613
en-us2014 Maplesoft, A Division of Waterloo Maple Inc.Maplesoft Document SystemThu, 24 Apr 2014 07:54:20 GMTThu, 24 Apr 2014 07:54:20 GMTNew applications published by Samir Khanhttp://www.mapleprimes.com/images/mapleapps.gifSamir Khan: New Applications
http://www.maplesoft.com/applications/author.aspx?mid=613
Downloading Stock Prices and Plotting Returns Distributions
http://www.maplesoft.com/applications/view.aspx?SID=153539&ref=Feed
<p>This application:</p>
<ul>
<li>downloads historical stock prices from Yahoo Finance,</li>
<li>calculates the returns,</li>
<li>plots the distribution of the returns in a histogram,</li>
<li>and overlays a normal distribution with the same mean and standard deviation as the historical data.</li>
<li>The application uses Maple 18's improved Internet connectivity; you can now download data from a URL straight into a matrix using <span ><a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=ImportMatrix">ImportMatrix()</a></span>.</li>
</ul><img src="/view.aspx?si=153539/stockreturns.png" alt="Downloading Stock Prices and Plotting Returns Distributions" align="left"/><p>This application:</p>
<ul>
<li>downloads historical stock prices from Yahoo Finance,</li>
<li>calculates the returns,</li>
<li>plots the distribution of the returns in a histogram,</li>
<li>and overlays a normal distribution with the same mean and standard deviation as the historical data.</li>
<li>The application uses Maple 18's improved Internet connectivity; you can now download data from a URL straight into a matrix using <span ><a href="http://www.maplesoft.com/support/help/Maple/view.aspx?path=ImportMatrix">ImportMatrix()</a></span>.</li>
</ul>153539Thu, 03 Apr 2014 04:00:00 ZSamir KhanSamir KhanInteractive Google Maps Component
http://www.maplesoft.com/applications/view.aspx?SID=153537&ref=Feed
<p>This application is a simple demonstration of Maple 18's new HTTP package for communicating with web-based APIs. It has a component-based interface that lets you interact with Google Maps. Simply enter a latitude and longitude, and set your zoom level and desired map type. Maple will then:</p>
<ul>
<li>download map images using the Google Maps API, </li>
<li>and then place those images on a label component</li>
</ul>
<p>The code for the application is located in the Startup code region (Edit > Startup Code).</p>
<p>The Google Maps API limits the number of anonymous queries you can make per day. If you exceed their limit, you'll need to include a Google Maps API key in the startup code.</p>
<p>The default latitude and longitude point to the location of the Maplesoft office in Waterloo, Ontario.</p><img src="/view.aspx?si=153537/Maps_image1.jpg" alt="Interactive Google Maps Component" align="left"/><p>This application is a simple demonstration of Maple 18's new HTTP package for communicating with web-based APIs. It has a component-based interface that lets you interact with Google Maps. Simply enter a latitude and longitude, and set your zoom level and desired map type. Maple will then:</p>
<ul>
<li>download map images using the Google Maps API, </li>
<li>and then place those images on a label component</li>
</ul>
<p>The code for the application is located in the Startup code region (Edit > Startup Code).</p>
<p>The Google Maps API limits the number of anonymous queries you can make per day. If you exceed their limit, you'll need to include a Google Maps API key in the startup code.</p>
<p>The default latitude and longitude point to the location of the Maplesoft office in Waterloo, Ontario.</p>153537Mon, 31 Mar 2014 04:00:00 ZSamir KhanSamir KhanOptimize the Flight Path of a Pan-US Delivery Drone
http://www.maplesoft.com/applications/view.aspx?SID=153536&ref=Feed
<p>You run a pan-US drone delivery service for a popular online retailer. You're given a list of zip codes across the US at which you need to drop off parcels, and want to optimize its journey so it travels the shortest distance.</p>
<p>This application extracts the latitude and longitude of those zip codes from an SQLlite database (the application includes the database, which cross-references US zip codes against their latitude, longitude, city and state). The application then performs a traveling salesman optimization and plots the shortest path on a map of the US.</p>
<p>This application uses background plot images, and SQLLite integration, two new features introduced in Maple 18.</p><img src="/view.aspx?si=153536/pan-us_drone.jpg" alt="Optimize the Flight Path of a Pan-US Delivery Drone" align="left"/><p>You run a pan-US drone delivery service for a popular online retailer. You're given a list of zip codes across the US at which you need to drop off parcels, and want to optimize its journey so it travels the shortest distance.</p>
<p>This application extracts the latitude and longitude of those zip codes from an SQLlite database (the application includes the database, which cross-references US zip codes against their latitude, longitude, city and state). The application then performs a traveling salesman optimization and plots the shortest path on a map of the US.</p>
<p>This application uses background plot images, and SQLLite integration, two new features introduced in Maple 18.</p>153536Mon, 31 Mar 2014 04:00:00 ZSamir KhanSamir KhanAnalysis of a Refrigeration Cycle with CoolProp
http://www.maplesoft.com/applications/view.aspx?SID=153490&ref=Feed
<p>This application analyzes a vapor compression refrigeration cycle for the refrigerant R134a. The application calculates heat changes over the compressor, condenser, throttle and evaporator, together with the coefficient of performance. Additionally, a P-h-T chart illustrating the refrigeration cycle is plotted.</p>
<p>Thermophysical properties are provided by the open source C++ CoolProp library (<a href="http://coolprop.org/">http://coolprop.org</a>). Once compiled and linked to Maple, CoolProp lets you access the properties of pure fluids, pseudo-pure fluids, and humid air with a function call. This application comes with a CoolProp DLL for 64-bit Windows. You may need to compile CoolProp for your own environment for a compatible library. </p><img src="/view.aspx?si=153490/CoolProp_image1.jpg" alt="Analysis of a Refrigeration Cycle with CoolProp" align="left"/><p>This application analyzes a vapor compression refrigeration cycle for the refrigerant R134a. The application calculates heat changes over the compressor, condenser, throttle and evaporator, together with the coefficient of performance. Additionally, a P-h-T chart illustrating the refrigeration cycle is plotted.</p>
<p>Thermophysical properties are provided by the open source C++ CoolProp library (<a href="http://coolprop.org/">http://coolprop.org</a>). Once compiled and linked to Maple, CoolProp lets you access the properties of pure fluids, pseudo-pure fluids, and humid air with a function call. This application comes with a CoolProp DLL for 64-bit Windows. You may need to compile CoolProp for your own environment for a compatible library. </p>153490Fri, 17 Jan 2014 05:00:00 ZSamir KhanSamir KhanSpectogram Generator
http://www.maplesoft.com/applications/view.aspx?SID=144590&ref=Feed
<p>This application lets you load wave files, apply windows and IIR/FIR filters, and view the spectrogram, power spectrum and waveform. You can also set filter cut-off frequencies by clicking on the power spectrum plot.</p><img src="/view.aspx?si=144590/spectogram_thumb.png" alt="Spectogram Generator" align="left"/><p>This application lets you load wave files, apply windows and IIR/FIR filters, and view the spectrogram, power spectrum and waveform. You can also set filter cut-off frequencies by clicking on the power spectrum plot.</p>144590Wed, 13 Mar 2013 04:00:00 ZSamir KhanSamir KhanPricing European Call Options with FFTs
http://www.maplesoft.com/applications/view.aspx?SID=144589&ref=Feed
<p>This application compares the price of a European call option with FFTs (using the approach outlined by Carr & Madan in <em>Option Pricing Using the Fast Fourier Transform</em>) and the analytical approach. The application uses the efficient FFT function offered by Maple 17’s new <a href="/products/maple/new_features/signal_processing.aspx">Signal Processing tools</a>.</p><img src="/applications/images/app_image_blank_lg.jpg" alt="Pricing European Call Options with FFTs" align="left"/><p>This application compares the price of a European call option with FFTs (using the approach outlined by Carr & Madan in <em>Option Pricing Using the Fast Fourier Transform</em>) and the analytical approach. The application uses the efficient FFT function offered by Maple 17’s new <a href="/products/maple/new_features/signal_processing.aspx">Signal Processing tools</a>.</p>144589Wed, 13 Mar 2013 04:00:00 ZSamir KhanSamir KhanPortfolio Optimization with the Omega Ratio
http://www.maplesoft.com/applications/view.aspx?SID=140702&ref=Feed
<P>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. 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.<P>This application implements both approaches, the former using Maple's <A HREF="/products/toolboxes/globaloptimization/">Global Optimization Toolbox</A>, and the latter using Maple's <A HREF="/support/help/AddOns/view.aspx?path=Tour/opt1">linear programming</A> features. For the data set provided in this application, both approaches give comparable results.<img src="/view.aspx?si=140702/140702_thumb.jpg" alt="Portfolio Optimization with the Omega Ratio" align="left"/><P>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. 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.<P>This application implements both approaches, the former using Maple's <A HREF="/products/toolboxes/globaloptimization/">Global Optimization Toolbox</A>, and the latter using Maple's <A HREF="/support/help/AddOns/view.aspx?path=Tour/opt1">linear programming</A> features. For the data set provided in this application, both approaches give comparable results.140702Thu, 22 Nov 2012 05:00:00 ZSamir KhanSamir KhanThe Countdown Numbers Game
http://www.maplesoft.com/applications/view.aspx?SID=4901&ref=Feed
Countdown is a popular numbers and letters quiz program on UK television. In one of the rounds, the contestants must use a range of basic arithmetic operations (addition, subtraction, multiplication and division) to make six seed numbers equal to a random target.
This Maple worksheet automatically provides a solution for the numbers game by searching the solution space.<img src="/view.aspx?si=4901//applications/images/app_image_blank_lg.jpg" alt="The Countdown Numbers Game" align="left"/>Countdown is a popular numbers and letters quiz program on UK television. In one of the rounds, the contestants must use a range of basic arithmetic operations (addition, subtraction, multiplication and division) to make six seed numbers equal to a random target.
This Maple worksheet automatically provides a solution for the numbers game by searching the solution space.4901Mon, 30 Apr 2007 00:00:00 ZDr. Samir KhanDr. Samir KhanOptimising Asset Allocation by Maximising the Sharpe Ratio
http://www.maplesoft.com/applications/view.aspx?SID=4851&ref=Feed
The Sharpe ratio quantifies how effectively a portfolio of risky assets utilises risk to maximise return. It is defined as the effective return per unit of risk. The expected portfolio return is predicted from historic data, and the standard deviation of the asset mix is traditionally used as a proxy for risk (or volatility). A higher Sharpe Ratio essentially signifies a more risk efficient portfolio. This application calculates the optimum asset mix for a portfolio of stocks by maximising its Sharpe ratio.<img src="/view.aspx?si=4851//applications/images/app_image_blank_lg.jpg" alt="Optimising Asset Allocation by Maximising the Sharpe Ratio" align="left"/>The Sharpe ratio quantifies how effectively a portfolio of risky assets utilises risk to maximise return. It is defined as the effective return per unit of risk. The expected portfolio return is predicted from historic data, and the standard deviation of the asset mix is traditionally used as a proxy for risk (or volatility). A higher Sharpe Ratio essentially signifies a more risk efficient portfolio. This application calculates the optimum asset mix for a portfolio of stocks by maximising its Sharpe ratio.4851Fri, 15 Dec 2006 00:00:00 ZDr. Samir KhanDr. Samir KhanInteracting Tank Reservoirs
http://www.maplesoft.com/applications/view.aspx?SID=4828&ref=Feed
This worksheet models the draining of liquid from one tank into into another tank through a connecting pipe. The flow is opposed by pipe friction, and the level of liquid in each tank oscillates to an 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=4828/image.php.gif" alt="Interacting Tank Reservoirs" align="left"/>This worksheet models the draining of liquid from one tank into into another tank through a connecting pipe. The flow is opposed by pipe friction, and the level of liquid in each tank oscillates to an equilibrium. Differential equations that describe the dynamic change in liquid height in each tank and a momentum balance are solved numerically.4828Wed, 18 Oct 2006 00:00:00 ZDr. Samir KhanDr. Samir KhanAutomatic Optimization of Controller
http://www.maplesoft.com/applications/view.aspx?SID=1752&ref=Feed
A cold oil stream is heated in a stirred tank. The dynamic change in temperature in the tank is modelled by an ordinary differential equation, derived via a heat balance
The temperature of the liquid in the tank is driven to a set point via a PI controller, which alters the heat added to the system. The optimium controller gains are found by minimising an objective function that describes how far the actual temperature profile is from a user-defined profile. Additionally, overshoot is attenuated via a penalty multiplier to the objective function.
This application highlights two Maple computational features
- Numeric solution of differential equations
- Non-linear optimisation<img src="/view.aspx?si=1752/AutomaticOptimisationControllerGains_2.gif" alt="Automatic Optimization of Controller" align="left"/>A cold oil stream is heated in a stirred tank. The dynamic change in temperature in the tank is modelled by an ordinary differential equation, derived via a heat balance
The temperature of the liquid in the tank is driven to a set point via a PI controller, which alters the heat added to the system. The optimium controller gains are found by minimising an objective function that describes how far the actual temperature profile is from a user-defined profile. Additionally, overshoot is attenuated via a penalty multiplier to the objective function.
This application highlights two Maple computational features
- Numeric solution of differential equations
- Non-linear optimisation1752Fri, 16 Jun 2006 00:00:00 ZDr. Samir KhanDr. Samir KhanFlow Between Two Tanks Assisted by a Pump
http://www.maplesoft.com/applications/view.aspx?SID=1750&ref=Feed
A pump transfers from one tank to another, with check valves placed on either side of the pump and each tank is open to the atmosphere. This worksheet calculates the flowrate in the pipe by solving the Bernoulli equation for the system, taking into account the head added by the pump, and the head loss due to pipe friction and fittings. Friction factors are calculated using the standard equation for friction in laminar flow, or the Colebrook-White equation for friction in turbulent flow. A number of physical parameters can be specified, including the pipe roughness and the head loss coefficients for the valves.<img src="/view.aspx?si=1750/thumb.gif" alt="Flow Between Two Tanks Assisted by a Pump" align="left"/>A pump transfers from one tank to another, with check valves placed on either side of the pump and each tank is open to the atmosphere. This worksheet calculates the flowrate in the pipe by solving the Bernoulli equation for the system, taking into account the head added by the pump, and the head loss due to pipe friction and fittings. Friction factors are calculated using the standard equation for friction in laminar flow, or the Colebrook-White equation for friction in turbulent flow. A number of physical parameters can be specified, including the pipe roughness and the head loss coefficients for the valves.1750Tue, 13 Jun 2006 00:00:00 ZDr. Samir KhanDr. Samir KhanLiquid Flow Through a Pump
http://www.maplesoft.com/applications/view.aspx?SID=1652&ref=Feed
A pipe receives water from a centrifugal pump. This worksheet will calculate the flowrate through the pipe by balancing the head lost through friction in the pipe against the head produced by the pump.<img src="/view.aspx?si=1652/liquidflow.gif" alt="Liquid Flow Through a Pump" align="left"/>A pipe receives water from a centrifugal pump. This worksheet will calculate the flowrate through the pipe by balancing the head lost through friction in the pipe against the head produced by the pump.1652Fri, 19 Aug 2005 00:00:00 ZDr. Samir KhanDr. Samir KhanBinary Distillation with the McCabe-Thiele Method
http://www.maplesoft.com/applications/view.aspx?SID=1640&ref=Feed
Binary fractional distillation is a means of separating two liquid components via a distillation column (which contains a number of trays, or stages). It's a concept encountered by virtually every Chemical & Process Engineering student. This application calculates the required number of theoretical stages for a set of specified operating parameters via the McCabe-Thiele method. It plots the classic McCabe-Thiele diagram and evaluates the minimum and actual reflux ratio, and the thermodynamic state of the feed.<img src="/view.aspx?si=1640/McCabe-ThieleDistillation_10.gif" alt="Binary Distillation with the McCabe-Thiele Method" align="left"/>Binary fractional distillation is a means of separating two liquid components via a distillation column (which contains a number of trays, or stages). It's a concept encountered by virtually every Chemical & Process Engineering student. This application calculates the required number of theoretical stages for a set of specified operating parameters via the McCabe-Thiele method. It plots the classic McCabe-Thiele diagram and evaluates the minimum and actual reflux ratio, and the thermodynamic state of the feed.1640Wed, 13 Jul 2005 00:00:00 ZDr. Samir KhanDr. Samir Khan