Samir Khan

1894 Reputation

19 Badges

15 years, 326 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 replies submitted by Samir Khan

@Christopher2222 Here's a rough cut of an analysis.



This function gives the coldest possible temperature (i.e. the wet bulb temperature) in a Zeer as a function of the air temperature

and the relative humidity

Twb_val := (Tdb_val, R_val) -> Property(Twb, HumidAir, Tdb = Tdb_val, R = R_val,

pressure = 101325):

Range of relative humidities to plot:

R_val := [0.3, 0.4, 0.5, 0.6, 0.7]:

p1 := seq(plot(Twb_val(temp, R_val[i]), temp = 280 .. 310, adaptive = false,

numpoints = 20), i = 1 .. 5):

p2 := seq(textplot([310, Twb_val(310, R_val[i]), sprintf("R = %.1f",R_val[i])]),

i = 1 .. 5):

display(p1, p2, labels = ["Air Temperature (K)", "Coldest Possible Temperature in Zeer (K)"],

labeldirections = [horizontal, vertical])


At a constant air temperature, the coldest possible temperature (i.e. the wet bulb temperature) increases as the relative humidity

(i.e. water in air) increases.


This makes sense because


If there is more water in the air, less water will evaporate from the wet sand between the two pots in the Zeer


and hence less latent heat will be removed



This MapleSim model contains a Modelica custom component that reads the CoolProp DLL. You'll need to change the path in the code to point to the location of the DLL on your computer.



@Thomas Richard

  • Those techniques are not appropriate for the typical home user (e.g. ISPs that block port 25, Windows OS etc)
  • MailGun works also on the MapleCloud. I have Cloud applications that email results to the user (after the user has entered their email in a text area). Let me know if you want access.


@Axel Vogt 

Here's the full email header


The header of Sample.txt implies that the data is generated by an oscilliscope. 

Can your oscilloscope generate binary data files? Then you could attempt to use ?FileTools[Binary] to import the data.

In addition to the other responses, I find that changing the default 2D math font from Times New Roman to a sans-serif font (like Calibri or equivalent) helps with clarity.

@madruga1155 Right now, viscosity is taken into account when calculating the friction factor (i.e. viscosity is used to calculate the Reynolds number, and the Reynolds number is used to calculate the friction factor).

You could also model non-Newtonian or power law liquids etc. This would need a new pipe model (not difficult) with equations describing the viscosity / bulk shear rate relationship.

In Settings tab, set Compiler=false.

If you install a compiler (as described here), you can simulate the model with Compiler=true.


As an addendum, here's a Maple 15 worksheet that discretizes the Water Hammer PDEs along the spatial dimension, and solves the resulting set of ODEs numerically.

For a given set of inputs, the results are consistent with those of the MapleSim model. There are a few small differences which can be explained by differences in how boundary conditions are set in MapleSim (i.e. the closure characteristics of the valve) and Maple (i.e. the velocity profile at the end of the pipeline)

@acer Go ahead with the Application.

When I first wrote the worksheet, I spoke to experts at Maplesoft about the visualization (the responsiveness of pointplots for large numPoints, or other methods of visualization) but no workable result was presented.

I started writing a 3d convex hull routine to remove the interior points (to make the pointplots more responsive), but I never finished...might have to brush the dust off it.



Here's an archive of the worksheet plus screengrabs of plots being produced in situ. I haven't touched the worksheet in over two years because I found it too resource intensive for wider consumption. Use at your own risk :)

@acer The Maple 15 version removed a bug in the string manipulation code. There were no other changes apart from that (i.e. the URLs they call are the same).

I can't remember trying the application on Maple 12 (nor do I have this version installed)



This worksheet is in better shape



This worksheet is in better shape


There are multiple typos in the worksheet I posted.  Bear with me while I clear them up...

4 5 6 7 8 Page 6 of 8