Tags: ascend, chemical, emgineeringflowsheeting, matlab, modelling, notsuitable, one-liner, package, pages, process, programming, simulink, wiki

Chemical process modelling

On Programmer » Matlab

21,136 words with 8 Comments; publish: Wed, 07 May 2008 10:03:00 GMT; (200389.65, « »)

On the Ascend IV Wiki pages (Ascend IV is a chemical emgineering

flowsheeting package) there is the one-liner that Matlab/Simulink is not

suitable for chemical process engineering. I haven't managed to find any

other information as to what lies behind this statement (I am likely to have

to review Simulink versus Fortran versus other alternatives). Can anyone

shed any light on this statement?

TIA.

All Comments

Leave a comment...

  • 8 Comments
    • max wrote:

      >

      > On the Ascend IV Wiki pages (Ascend IV is a chemical emgineering

      > flowsheeting package) there is the one-liner that Matlab/Simulink

      > is not

      > suitable for chemical process engineering. I haven't managed to

      > find any

      > other information as to what lies behind this statement (I am

      > likely to have

      > to review Simulink versus Fortran versus other alternatives). Can

      > anyone

      > shed any light on this statement?

      I couldn't find that one-liner. I had a good look around the Wiki,

      using the search etc and even Google to search the site. However...

      I have experience of chemical process modelling using Simulink and

      also using custom code. The problem with Simulink is that you do not

      have enough control over the solution method.

      Modelling a single reaction is fine - you just select your favourite

      stiff solver and off you go. The timestep shrinks during the "bang"

      as the reaction starts to kick off and then relaxes again in the

      aftermath. But most chemical problems aren't that simple. You

      normally have many coupled equations: flow, thermal, diffusion,

      reaction. And then you'll probably have a discretized system with

      many cells. If you try to solve all this lot with a stiff solver,

      you'll find it grinds to a halt as soon as the first reaction starts

      to kick off. And the only way to prevent it is to put in all sorts

      of lags to try to decouple the equations a bit. Getting it to

      actually run is a big task.

      If you write your own solver, you can manually decouple the equations

      and only solve the stiff bits in isolation. You can also solve

      different equations on different timescales. Maybe this is possible

      in Simulink these days? I never found how to do it.

      #1; Wed, 07 May 2008 10:04:00 GMT
    • In article <IAnLf.43486$Q22.30347.matlab.todaysummary.com.fe1.news.blueyonder.co.uk>, Max wrote:

      > On the Ascend IV Wiki pages (Ascend IV is a chemical emgineering

      > flowsheeting package) there is the one-liner that Matlab/Simulink is not

      > suitable for chemical process engineering. I haven't managed to find any

      > other information as to what lies behind this statement (I am likely to ha

      ve

      > to review Simulink versus Fortran versus other alternatives). Can anyone

      > shed any light on this statement?

      I can't shed light on this particular statement; but, as someone who work wi

      th Chem.Engrs.

      doing modelling and simulation in Matlab/Simulink, in general:

      Matlab/Simulink is a general-purpose simulation software package, and can th

      erefore be used

      to simulate anything, including (as we do here) Oil,Gas.Petrochemical and Ch

      emical

      Processes.

      However, sometimes in Chemical Process simulation it is especially useful to

      have an

      equation-oriented and equation-solving simulation package, rather than a seq

      uential-solving

      package like Simulink - but each approach has its advantages and divantag

      es. Furthermore,

      because Simulink is general purpose it is not specifically aimed at Chem.Eng

      . Simulation,

      and therefore does not come with the features built-in that Chem Engineers l

      ike to see - in

      other words, it requires more modelling skills and up-front engineering inpu

      t to tailor it

      to Chem.Eng. simulation, plus some add-ons like thermodynamics and physical

      properties. But

      the same could be said of the use of any general-purpose simulation package

      to any

      engineering speciality. However, because Simulink *is* general-purpose, it c

      an do lots of

      things you just can't do in a Chem.Eng. package - such as build models incor

      porating

      elements of MEch.Eng, Elec.Eng. Chem.Eng, Control Eng. etc. in one model for

      simulation.

      That's why our Chem.Eng. colleagues prefer their Chem.Eng. packages for proc

      ess design; but

      we prefer Simulink for doing the combined process and process control-system

      design. There

      is no difference in the equations or mathematical or modelling rigour in the

      models we each

      use; but they are just solved numerically in different ways, and we have to

      be better

      modellers because nothing is pre-configured for us.

      Kelvin B. Hales

      Kelvin Hales Associates Limited

      Consulting Control Engineers

      Web: www.khace.com

      #2; Wed, 07 May 2008 10:05:00 GMT
    • Kelvin Hales wrote:

      >

      > I can't shed light on this particular statement; but, as someone

      > who work with Chem.Engrs.

      > doing modelling and simulation in Matlab/Simulink, in general:

      > Matlab/Simulink is a general-purpose simulation software package,

      > and can therefore be used

      > to simulate anything, including (as we do here)

      > Oil,Gas.Petrochemical and Chemical

      > Processes.

      <snip>

      Sorry. I immediately added the word "reaction" when I read the first

      post. My post concerns only chemical reaction modelling.

      #3; Wed, 07 May 2008 10:06:00 GMT
    • "Steve Amphlett" <Firstname.Lastname.matlab.todaysummary.com.where_I_work.com> wrote in message

      news:ef29f57.3.matlab.todaysummary.com.webx.raydaftYaTP...

      > Kelvin Hales wrote:

      > <snip>

      > Sorry. I immediately added the word "reaction" when I read the first

      > post. My post concerns only chemical reaction modelling.

      What type of chemical reactions? I admit I don't work with this product

      very much, but I'm wondering if SimBiology has general enough functionality

      to do what you want.

      http://www.mathworks.com/products/simbiology/index.html

      Only one of the demos deals with what I generally think of when I think of

      biology; the others seem to be modeling general reactions (if you consider

      rabbits, coyotes, and food to be 'reacting' with one another):

      http://www.mathworks.com/products/simbiology/demos.html

      Of course, if you're working with biochemical reactions, the "bio" part of

      SimBiology may be useful to you.

      Steve Lord

      slord.matlab.todaysummary.com.mathworks.com

      #4; Wed, 07 May 2008 10:07:00 GMT
    • "Steven Lord" <slord.matlab.todaysummary.com.mathworks.com> wrote in message

      news:dtngpo$14p$1.matlab.todaysummary.com.fred.mathworks.com...

      > "Steve Amphlett" <Firstname.Lastname.matlab.todaysummary.com.where_I_work.com> wrote in message

      > news:ef29f57.3.matlab.todaysummary.com.webx.raydaftYaTP...

      > What type of chemical reactions? I admit I don't work with this product

      > very much, but I'm wondering if SimBiology has general enough

      functionality

      > to do what you want.

      > http://www.mathworks.com/products/simbiology/index.html

      >

      Thanks. I'll have a look.

      As I said, flowsheeting - certainly CSTrs, maybe PDEs, maybe 10 components,

      maybe 4 unit processes, a few recycle loops, multiple units to study what

      happens as tanks are taken out of service/brought back online, all within a

      dynamic modelling framework.

      > Only one of the demos deals with what I generally think of when I think of

      > biology; the others seem to be modeling general reactions (if you consider

      > rabbits, coyotes, and food to be 'reacting' with one another):

      > http://www.mathworks.com/products/simbiology/demos.html

      > Of course, if you're working with biochemical reactions, the "bio" part of

      > SimBiology may be useful to you.

      >

      This job should not have any biological reactions. However, follow-on work

      might.

      > --

      > Steve Lord

      > slord.matlab.todaysummary.com.mathworks.com

      >

      #5; Wed, 07 May 2008 10:08:00 GMT
    • "Steve Amphlett" <Firstname.Lastname.matlab.todaysummary.com.where_I_work.com> wrote in message

      news:ef29f57.1.matlab.todaysummary.com.webx.raydaftYaTP...

      > max wrote:

      > I couldn't find that one-liner. I had a good look around the Wiki,

      > using the search etc and even Google to search the site. However...

      >

      https://pse.cheme.cmu.edu/wiki/view...rModellingTools

      > I have experience of chemical process modelling using Simulink and

      > also using custom code. The problem with Simulink is that you do not

      > have enough control over the solution method.

      >

      Does Simulink always uses a stiff solver? If yes, how does it cope with

      discontinuities? (Task next w - RTFM!)

      > Modelling a single reaction is fine - you just select your favourite

      > stiff solver and off you go. The timestep shrinks during the "bang"

      > as the reaction starts to kick off and then relaxes again in the

      > aftermath. But most chemical problems aren't that simple. You

      > normally have many coupled equations: flow, thermal, diffusion,

      > reaction. And then you'll probably have a discretized system with

      > many cells. If you try to solve all this lot with a stiff solver,

      > you'll find it grinds to a halt as soon as the first reaction starts

      > to kick off. And the only way to prevent it is to put in all sorts

      > of lags to try to decouple the equations a bit. Getting it to

      > actually run is a big task.

      >

      I'm thinking of flowsheeting, so (say) 10 components, all reacting, and

      maybe five different kinds of processes for the, to react in - say, 50

      equations to get started. But some may be PDEs discretised too 100 grid

      points, which is a big increase in scope. By end-April I hope that we have

      scoped out what we want to do - we are literally just starting, gathering

      information.

      > If you write your own solver, you can manually decouple the equations

      > and only solve the stiff bits in isolation. You can also solve

      > different equations on different timescales. Maybe this is possible

      > in Simulink these days? I never found how to do it.

      #6; Wed, 07 May 2008 10:09:00 GMT
    • "Kelvin Hales" <khales.matlab.todaysummary.com.khace.com> wrote in message

      news:VA.00001f89.001130b2.matlab.todaysummary.com.khace.com...

      > In article <IAnLf.43486$Q22.30347.matlab.todaysummary.com.fe1.news.blueyonder.co.uk>, Max wrote:

      have

      > I can't shed light on this particular statement; but, as someone who work

      with Chem.Engrs.

      > doing modelling and simulation in Matlab/Simulink, in general:

      > Matlab/Simulink is a general-purpose simulation software package, and can

      therefore be used

      > to simulate anything, including (as we do here) Oil,Gas.Petrochemical and

      Chemical

      > Processes.

      I agree, but how does it fare on ease of use? I've seen a small Simulink

      flowsheet, which seemed cumbersome with its use of integrators scattered

      everywhere - and that was for a relatively simple, two-variable,

      CSTR-approach system. Making sense of what had been done seemed less easy

      than Fortran code. but I've spent maybe 30 years with Fortran, and 1 w

      with Simulink, so I don't want to pre-judge based on my experience with the

      one and ignorance of the other. However, in the timescales that I have, I

      wont get sufficiently familiar with Simulink before we commit to Stage 2 -

      development. Hence, my attempts to get background information. Once we start

      then there will be plenty of time for acquiring experience. At least on

      paper ;-)

      > However, sometimes in Chemical Process simulation it is especially useful

      to have an

      > equation-oriented and equation-solving simulation package, rather than a

      sequential-solving

      > package like Simulink - but each approach has its advantages and

      divantages. Furthermore,

      > because Simulink is general purpose it is not specifically aimed at

      Chem.Eng. Simulation,

      > and therefore does not come with the features built-in that Chem Engineers

      like to see - in

      > other words, it requires more modelling skills and up-front engineering

      input to tailor it

      > to Chem.Eng. simulation, plus some add-ons like thermodynamics and

      physical properties. But

      > the same could be said of the use of any general-purpose simulation

      package to any

      > engineering speciality. However, because Simulink *is* general-purpose, it

      can do lots of

      > things you just can't do in a Chem.Eng. package - such as build models

      incorporating

      > elements of MEch.Eng, Elec.Eng. Chem.Eng, Control Eng. etc. in one model

      for simulation.

      > That's why our Chem.Eng. colleagues prefer their Chem.Eng. packages for

      process design; but

      > we prefer Simulink for doing the combined process and process

      control-system design. There

      > is no difference in the equations or mathematical or modelling rigour in

      the models we each

      > use; but they are just solved numerically in different ways, and we have

      to be better

      > modellers because nothing is pre-configured for us.

      >

      That's fine. I've been used to coding up in Fortran, but for this project

      wewant to see what is available for us to build upon.

      > Kelvin B. Hales

      > Kelvin Hales Associates Limited

      > Consulting Control Engineers

      > Web: www.khace.com

      >

      #7; Wed, 07 May 2008 10:10:00 GMT
    • In article <VA.00001f89.001130b2.matlab.todaysummary.com.khace.com>, Kelvin Hales wrote:

      > In article <IAnLf.43486$Q22.30347.matlab.todaysummary.com.fe1.news.blueyonder.co.uk>, Max wrote:

      > I can't shed light on this particular statement; but, as someone who work

      with Chem.Engrs.

      > doing modelling and simulation in Matlab/Simulink, in general:

      > Matlab/Simulink is a general-purpose simulation software package, and can

      therefore be used

      > to simulate anything, including (as we do here) Oil,Gas.Petrochemical and

      Chemical

      > Processes.

      > However, sometimes in Chemical Process simulation it is especially useful

      to have an

      > equation-oriented and equation-solving simulation package, rather than a s

      equential-solving

      > package like Simulink - but each approach has its advantages and divant

      ages. Furthermore,

      > because Simulink is general purpose it is not specifically aimed at Chem.E

      ng. Simulation,

      > and therefore does not come with the features built-in that Chem Engineers

      like to see - in

      > other words, it requires more modelling skills and up-front engineering in

      put to tailor it

      > to Chem.Eng. simulation, plus some add-ons like thermodynamics and physica

      l properties. But

      > the same could be said of the use of any general-purpose simulation packag

      e to any

      > engineering speciality. However, because Simulink *is* general-purpose, it

      can do lots of

      > things you just can't do in a Chem.Eng. package - such as build models inc

      orporating

      > elements of MEch.Eng, Elec.Eng. Chem.Eng, Control Eng. etc. in one model f

      or simulation.

      > That's why our Chem.Eng. colleagues prefer their Chem.Eng. packages for pr

      ocess design; but

      > we prefer Simulink for doing the combined process and process control-syst

      em design. There

      > is no difference in the equations or mathematical or modelling rigour in t

      he models we each

      > use; but they are just solved numerically in different ways, and we have t

      o be better

      > modellers because nothing is pre-configured for us.

      I'm going to add to my original statement the following additions:

      It may be more accurate to say that MATLAB/Simulink is not so much not suita

      ble for Chem.Eng.

      applications, as to say that it is not suitable for use by Chemical Engineer

      s! In my several decades

      working closely with Chemical Engineers (as sort of Control-Engineer made ho

      nourary Chemical

      Engineer) I have learned that the way Chemical Engineers think about modelli

      ng, and hence system

      simulation, is quite different than the way that other Engineers (Electrical

      , Mechanical, Control)

      think about it. In particular Chemical Engineers like to think of their mode

      lling in the more

      abstract more terms of sets of simultaneous differential equations and degre

      es of freedom. They

      don't study general system dynamics to any significant degree (or at least n

      ot to the extent of

      other engineering disciplines). They aren't familiar with and don't understa

      nd state-space

      representation. They like to see their variables move with time; but they ar

      en't interested in

      things like frequency-response (not even taught in some universities), syste

      m resonances,

      rise-times, bandwidth, noise, regulation, sensitivity, etc. They can't visua

      lise how a state-diagram

      with integrators and etc. can represent simultaneous differential equations.

      They can't get to grips

      with something like Simulink and can't see the interest of seeing the struct

      ure of a system laid out

      in blocks and solved sequentially (cause and effect). What they do like to d

      o is to have the

      flexibility to swap around the knowns (independent variables) and unknowns (

      dependent variables) in

      a model, to solve forwards and backwards as part of their approach to proces

      s modelling and design.

      They also have a frequent need to model lots of partial-differential equatio

      ns.

      OTOH, the Process Control Engineer will find a Chem.Eng. package offering fe

      w, if any, of the

      features needed to do dynamic analysis, and may well prefer (as we sometimes

      do) to have the entire

      process model re-engineered into something like Simulink, to support a dynam

      ic analysis. (Although

      sometimes it is possible to work with just linearised models generated by so

      me of the better

      Chem.Eng. packages - but its inconvenient.) Note, however, that some of the

      better Chem.Eng.

      packages will now co-simulate with Simulink, or allow themselves to be embed

      ded in Simulink.

      On a historical note: all Chem.Eng. modelling and simulation started out wit

      h Simulink-like; i.e.

      sequential solver, packages (e.g. ACSL) - which were all that was available

      back in the 80's/90's.

      However, alongside the evolution of general-purpose packages (like Simulink)

      all areas of

      simulation-engineering (not just Chem.Eng.) have also seen an increase in sp

      ecial-purpose packages

      aimed at supporting special interest groups.

      In theory it all comes down to selecting appropriate software for the simula

      tion task to be

      performed. (Although more and more we find that in industry it goes the othe

      r way around: the target

      simulation software is chosen first (usually by management in some commercia

      lly -advantageous deal

      with the manufacturer), and then the simulation tasks performed are subseque

      ntly limited in scope to

      whatever that chosen/preferred package can do! The days of the general model

      ler are this numbered!

      Kelvin B. Hales

      Kelvin Hales Associates Limited

      Consulting Control Engineers

      Web: www.khace.com

      #8; Wed, 07 May 2008 10:11:00 GMT