Samir Khan

1966 Reputation

20 Badges

16 years, 164 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 answers submitted by Samir Khan


 

restart:

with(ThermophysicalData):

with(CoolProp):

with(plots):

 

#I would like to get the heat capacity from this package. Heat capacity is a function of temperature and pressure.

CP:=PropsSI("C", "P", 101325, "T", T1(t), "hydrogen")/10000:

 

#Parameters

UA:=10:T0:=20:TS:=250:W:=100:M:=1000:

 

#The temperature is changing in this system of ODE with time. I would like to have the heat capacity value changing with temperature using the values obtained from the package.

EQ1:=diff(T1(t),t)=(W*CP*(T0-T1(t))+UA*(TS-T1(t)))/M/CP:

EQ2:=diff(T2(t),t)=(W*CP*(T1(t)-T2(t))+UA*(TS-T2(t)))/M/CP:

EQ3:=diff(T3(t),t)=(W*CP*(T2(t)-T3(t))+UA*(TS-T3(t)))/M/CP:

 

sol:=dsolve({EQ1,EQ2,EQ3,T1(0)=25,T2(0)=25,T3(0)=25},[T1(t),T2(t),T3(t)],numeric):

odeplot(sol,[[t,T1(t)],[t,T2(t)],[t,T3(t)]],t=0..140,legend=[T1,T2,T3],labels = ["time [min]", "Ti [C]"],axes=boxed)

 

sol(57.7)

sol(57.7)

(1)

 


 

Download question.mw

I think I can give the definitive answer because I'm the Maple Flow product manager. Maple Flow is very much alive and kicking, and we're on the verge of releasing an update!

Yes, there are far more Maple users than Maple Flow users...but that's because Maple has a far longer history. The first version of Maple Flow was released in 2021.

MaplePrimes tends to be visited by people who are generally outside the target group for Maple Flow. I hope this gradually changes and MaplePrimes develops a thriving Maple Flow subculture.

Let me your questions.

Here's a couple of ways:

If it's more complex than this, then you'll need to provide more detail. Might potentially need to use a Maple-language based procedure in the Edit>Code window

With this option selected, Enter (in addition to Tab) inserts the selected item from command and argument completion lists.

Without this option selected, only tab performs the action.

Select the text you want to format, and then go to Format > Character > Subscript or Format > Character > Superscript

The ThermophysicalData:-Property subpackage is built on top of an open source library called CoolProp. CoolProp natively use SI units, and returns temperatures in K.

For this call…

ThermophysicalData:-Property(T, "IF97::Water", Q = 0.100, P = 1*Unit(psi))

…Maple receives an absolute temperature of 311.9 K from CoolProp.

If the unit system is set to FPS via Units:-UseSystem(FPS), this is converted to 561.1 F (= 311.1 * 9/5), assuming that 311.9K is a temperature difference.

This assumption is incorrect in context, but this context is not known to Units:-UseSystem(). The correct temperature conversion would be (311.9K − 273.15) × 9/5 + 32 = 101.7F

Rather than changing the default unit system to FPS, you could consider

  • Keeping the default unit system to SI

  • Changing the units of individual results manually to FPS

    • via the Context Panel

    • except for absolute temperatures, in which use use convert(temperature_in_kelvin,temperature,degF) instead

Maple Flow doesn't yet support

  • for loops in the canvas (you can, however, enter procedures with for loops in the coding window)
  • print statements in the canvas

Try something like this instead:

Section 6.3 of the User Manual (Help > User Manual) states:

To create a multi-line header or footer, use a newline character.
• On Windows, use \n
• On Mac, use \r

 

The manual also offers an example:

Here's a couple of methods you could try:

The conversion that's closest in spirit to the Mathcad worksheet is this:

But this isn't necessarily the best way to implement this type of calculation in Maple Flow. Here's another approach that you might consider a better use of Maple Flow's functionality:

When resizing an image with the mouse, hold down the Shift key to maintain the aspect ratio.

This is on the roadmap, but not in the product just yet

You can use the Context Panel to rescale Ω to kΩ.

 

 

 

In "Enter Units", write `Omega` for ohms, or `kOmega` for kilo ohms.

You can generate compressibility factor charts with the ThermophysicalData package

with(ThermophysicalData):
fluid := "CH4":
Zc := (p, t) -> Property(Z, fluid, temperature = t, pressure = p):
temps := [200*Unit(K), 300*Unit(K), 600*Unit(K)]:
plots:-display(
    seq(plot(Zc(p, temps[i]), p = 0 * Unit(bar)..600 * Unit(bar)),i = 1..3)
   ,seq(plots:-textplot([640, Zc(600*Unit(bar), temps[i]), temps[i]] ), i = 1..3)
   ,labels = ["Pressure (bar)", "Compressibility Factor"]
   ,labeldirections = [horizontal, vertical]
              )

1 2 3 4 Page 1 of 4