Samir Khan

1956 Reputation

20 Badges

16 years, 160 days

My role is to help customers better exploit our tools. I’ve worked in selling, supporting and marketing maths and simulation software for all my professional career.

I’m fascinated by the full breadth and range of application of Maple. From financial mathematics and engineering to probability and calculus, I’m always impressed by what our users do with our tools.

However much I strenuously deny it, I’m a geek at heart. My first encounter with Maple was as an undergraduate when I used it to symbolically solve the differential equations that described the heat transfer in a series of stirred tanks. My colleagues brute-forced the problem with a numerical solution in Fortran (but they got the marks because that was the point of the course). I’ve since dramatized the process in a worksheet, and never fail to bore people with the story behind it.

I was born, raised and spent my formative years in England’s second city, Birmingham. I graduated with a degree in Chemical Engineering from The University of Nottingham, and after completing a PhD in Fluid Dynamics at Herriot-Watt University in Edinburgh, I started working for Adept Scientific – Maplesoft’s partner in the UK.

MaplePrimes Activity


These are Posts that have been published by Samir Khan

With Maple, you can create amazing visualizations that go far beyond the standard mathematical plots that you might typically expect (I wince every time I see yet another sine curve).

At your fingertips, you have

  • plotting primitives that can be assembled in new and novel ways
  • precise control over coloring (yay for ColorTools) and placement
  • an interactive coding environment with inline plots, giving you quick visual feedback over aesthetic changes
  • and a comprehensive mathematical programming language to glue everything together

Here, I thought I'd share a few of the visualizations I've really enjoyed creating over the last few years (and I'd like to emphasize 'enjoy' - doing this stuff is fun!)

Let me know if you want any of the worksheets.

 

Psychrometric chart with historical weather data for Waterloo, Ontario.

 

Ternary plot of the color of gold-silver-copper alloys

 

Spectrogram of a violin note played with vibrato

 

Colored zoom of the Mandelbrot set

 

Reporting dashboard for an Organic Rankine Cycle

 

Temperature-entropy plot of an ideal Rankine Cycle

 

Quaternion fractal

 

Historical sunpot data

 

Earthquake data

 

African literacy rates

Maple 2017 has launched!

Maple 2017 is the result of hard work by an enthusiastic team of developers and mathematicians.

As ever, we’re guided by you, our users. Many of the new features are of a result of your feedback, while others are passion projects that we feel you will find value in.

Here’s a few of my favourite enhancements. There’s far more that’s new - see What’s New in Maple 2017 to learn more.

 

MapleCloud Package Manager

Since it was first introduced in Maple 14, the MapleCloud has made thousands of Maple documents and interactive applications available through a web interface.

Maple 2017 completely refreshes the MapleCloud experience. Allied with a new, crisp, interface, you can now download and install user-created packages.

Simply open the MapleCloud interface from within Maple, and a mouse click later, you see a list of user-created packages, continuously updated via the Internet. Two clicks later, you’ve downloaded and installed a package.

This completely bypasses the traditional process of searching for and downloading a package, copying to the right folder, and then modifying libname in Maple. That was a laborious process, and, unless I was motivated, stopped me from installing packages.

The MapleCloud hosts a growing number of packages.

Many regular visitors to MaplePrimes are already familiar with Sergey Moiseev’s DirectSearch package for optimization, equation solving and curve fitting.

My fellow product manager, @DSkoog has written a package for grouping data into similar clusters (called ClusterAnalysis on the Package Manager)

Here’s a sample from a package I hacked together for downloading maps images using the Google Maps API (it’s called Google Maps and Geocoding on the Package Manager).

You’ll also find user-developed packages for exploring AES-based encryption, orthogonal series expansions, building Maple shell scripts and more.

Simply by making the process of finding and installing packages trivially easy, we’ve opened up a new world of functionality to users.

Maple 2017 also offers a simple method for package authors to upload workbook-based packages to the MapleCloud.

We’re engaging with many package authors to add to the growing list of packages on the MapleCloud. We’d be interested in seeing your packages, too!

 

Advanced Math

We’re committed to continually improving the core symbolic math routines. Here area few examples of what to expect in Maple 2017.

Resulting from enhancements to the Risch algorithm, Maple 2017 now computes symbolic integrals that were previously intractable

Groeber:-Basis uses a new implementation of the FGLM algorithm. The example below runs about 200 times faster in Maple 2017.

gcdex now uses a sparse primitive polynomial remainder sequence together.  For sparse structured problems the new routine is orders of magnitude faster. The example below was previously intractable.

The asympt and limit commands can now handle asymptotic cases of the incomplete Γ function where both arguments tend to infinity and their quotient remains finite.

Among several improvements in mathematical functions, you can now calculate and manipulate the four multi-parameter Appell functions.

 

Appel functions are of increasing importance in quantum mechanics, molecular physics, and general relativity.

pdsolve has seen many enhancements. For example, you can tell Maple that a dependent variable is bounded. This has the potential of simplifying the form of a solution.

 

Plot Builder

Plotting is probably the most common application of Maple, and for many years, you’ve been able to create these plots without using commands, if you want to.  Now, the re-designed interactive Plot Builder makes this process easier and better.

When invoked by a context menu or command on an expression or function, a panel slides out from the right-hand side of the interface.

 

Generating and customizing plots takes a single mouse click. You alter plot types, change formatting options on the fly and more.

To help you better learn Maple syntax, you can also display the actual plot command.

Password Protected Content

You can distribute password-protected executable content. This feature uses the workbook file format introduced with Maple 2016.

You can lock down any worksheet in a Workbook. But from any other worksheet, you can send (author-specified) parameters into the locked worksheet, and extract (author-specified) results.

 

Plot Annotations

You can now get information to pop up when you hover over a point or a curve on a plot.

In this application, you see the location and magnitude of an earthquake when you hover over a point

Here’s a ternary diagram of the color of gold-silver-copper alloys. If you let your mouse hover over the points, you see the composition of the points

Plot annotations may seem like a small feature, but they add an extra layer of depth to your visualizations. I’ve started using them all the time!

 

Engineering Portal

In my experience, if you ask an engineer how they prefer to learn, the vast majority of them will say “show me an example”. The significantly updated Maple Portal for Engineers does just that, incorporating many more examples and sample applications.  In fact, it has a whole new Application Gallery containing dozens of applications that solve concrete problems from different branches of engineering while illustrating important Maple techniques.

Designed as a starting point for engineers using Maple, the Portal also includes information on math and programming, interface features for managing your projects, data analysis and visualization tools, working with physical and scientific data, and a variety of specialized topics.

 

Geographic Data

You can now generate and customize world maps. This for example, is a choropleth of European fertility rates (lighter colors indicate lower fertility rates)

You can plot great circles that show the shortest path between two locations, show varying levels of detail on the map, and even experiment with map projections.

A new geographic database contains over one million locations, cross-referenced with their longitude, latitude, political designation and population.

The database is tightly linked to the mapping tools. Here, we ask Maple to plot the location of country capitals with a population of greater than 8 million and a longitude lower than 30.

 

There’s much more to Maple 2017. It’s a deep, rich release that has something for everyone.

Visit What’s New in Maple 2017 to learn more.

We've added a collection of thermal engineering applications to the Application Center. You could think of it as an e-book.

This collection has a few features that I think are pretty neat

  • The applications are collected together in a Workbook; a single file gives you access to 30 applications
  • You can navigate the contents using the Navigator or a hyperlinked table of contents
  • You can change working fluids and operating conditions, while still using accurate thermophysical data

If you don't have Maple 2016, you can view and navigate the applications (and interactive with a few) using the free Player.

The collection includes these applications.

  • Psychrometric Modeling
    • Swamp Cooler
    • Adiabatic Mixing of Air
    • Human Comfort Zone
    • Dew Point and Wet Bulb Temperature
    • Interactive Psychrometric Chart
  • Thermodynamic Cycles
    • Ideal Brayton Cycle
    • Optimize a Rankine Cycle
    • Efficiency of a Rankine Cycle
    • Turbine Analysis
    • Organic Rankine Cycle
    • Isothermal Compression of Methane
    • Adiabatic Compression of Methane
  • Refrigeration
    • COP of a Refrigeration Cycle
    • Flow Through an Expansion Valve
    • Food Refrigeration
    • Rate of Refrigerant Boiling
    • Refrigeration Cycle Analysis 1
    • Refrigeration Cycle Analysis 2
  • Miscellaneous
    • Measurement Error in a Manometer
    • Particle Falling Through Air
    • Saturation Temperature of Fluids
    • Water Fountain
    • Water in Piston
  • Heat Transfer
    • Dittus-Boelter Correlation
    • Double Pipe Heat Exchanger
    • Energy Needed to Vaporize Ethanol
    • Heat Transfer Coefficient Across a Flat Plate
  • Vapor-Liquid Equilibria
    • Water-Ethanol

I have a few ideas for more themed Maple application collections. Data analysis, anyone?

A few people have asked me how I created the sections in the Maple application in this video: https://youtu.be/voohdmfTRn0?t=572

Here's the worksheet (Maple 2016 only). As you can see, the “sections” look different what you would normally expect (I often like to experiment with small changes in presentation!)

These aren't, however, sections in the traditional Maple sense; they're a demonstration of Maple 2016's new tools for programmatically changing the properties of a table (including the visibility of its rows and columns). @dskoog gets the credit for showing me the technique.

Each "section" consists of a table with two rows.

  • The table has a name, specified in its properties.
  • The first row (colored blue) contains (1) a toggle button and (2) the title of each section (with the text in white)
  • The second row (colored white) is visible or invisible based upon the state of the toggle button, and contains the content of my section.

Each toggle button has

  • a name, specified in its properties
  • + and - images associated with its on and off states (with the image background color matching the color of the first table row)
  • Click action code that enables or disables the visibility of the second row

The Click action code for the toggle button in the "Pure Fluid Properties" section is, for example,

tableName:="PureFluidProperties_tb":
buttonName:="PureFluidProperties_tbt":
if DocumentTools:-GetProperty(buttonName, 'value') = "false" then   
     DocumentTools:-SetProperty([tableName, 'visible[2..]', true]);
else
     DocumentTools:-SetProperty([tableName, 'visible[2..]', false]);
end if;

As I said at the start, I often try to make worksheets look different to the out-of-the-box defaults. Programmatic table properties have simply given me one more option to play about with.

When Maple 2016 hit the road, I finally relegated my printed Mollier charts and steam tables to a filing cabinet, and moved my carefully-curated spreadsheets of refrigerant properties to a distant part of my hard drive. The new thermophysical data engine rendered those obsolete.

Other than making my desk tidier, what I find exciting is that I can compute with fluid properties in a tool that has numerical integrators, ODE solvers, optimizers, programmatic visualisation and more.

Here are several small examples that demonstrate how you can use fluid properties with Maple’s math and visualization tools (this worksheet contains the complete examples).

Work Done in Compressing a Gas

The work done (per unit mass) in compressing a fluid at constant temperature is

where V1 and V2 are specific volumes and p is pressure.

You need a relationship between pressure and specific volume (either theoretical or experimental) to calculate the work done.

Assuming the ideal gas law, the work done becomes

where R is the ideal gas constant, T is the temperature (in K) and M is the molecular mass (in kg mol-1), and V is the volume.

 Ideal gas constant

Molecular mass of propane

Hence the work done predicted by the Ideal Gas Law is

Let’s now use real fluid properties instead and numerical integrators to compute the work done.

Here, the work done predicted with the Ideal Gas Law and real fluid properties is similar. This isn’t, however, always the case for all gases (try experimenting with ammonia – its strong intermolecular forces result in non-ideal behavior).

Minimum Specific Heat Capacity of Water

The specific heat capacity of water varies with temperature like so.

Let's find the temperature at which the specific heat capacity of water is the lowest.

The lowest specific heat capacity occurs at 309.4 K; this is the temperature at which water requires the least energy to raise or lower its temperature.

Incidentally, this isn’t that far from the standard human body temperature of 310.1 K (given that the human body is largely water, one might hazard a guess why we have evolved to maintain this temperature).

Temperature-Entropy Plot for Water

Maple 2016 generates pressure-enthalpy-temperature charts and psychrometric charts out of the box. However, you can create your own customized thermodynamic visualizations.

This, for example, is a temperature-entropy chart for water, together with the two-phase vapor dome (the worksheet contains the code to generate this plot).

I'm also working on a lumped-parameter heat exchanger model with fluid properties (and hence heat transfer coefficients) that change with temperature. That'll be more complex than these simple examples, and will use Maple's numeric ODE solver.

3 4 5 6 7 8 9 Page 5 of 12