Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Chemical process modelling

Subject: Chemical process modelling

From: max

Date: 23 Feb, 2006 18:57:44

Message: 1 of 11

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.

Subject: Chemical process modelling [OT]

From: =?ISO-8859-1?Q?Javier_Fern=E1ndez?=

Date: 23 Feb, 2006 20:13:01

Message: 2 of 11

max wrote:
> ...
> flowsheeting package) there is the one-liner that Matlab/Simulink is not
> suitable for chemical process engineering. I haven't managed to find any
> ...

I thought "one-liner" was MATLAB-specific jargon :-). I think I have
seen it in several places, including manuals and web pages, always used
in the sense of "look how much you can do with just 1 line of MATLAB
code". For instance, at the beginning of

http://www.mathworks.com/company/newsletters/news_notes/clevescorner/clevecorner.html

Winter'99 Cleve's corner. The one-liner in question was

       plot(eig(randn(1024, 1024*p)), '.')

So one-liner is common jargon & it means something completely unrelated
to MATLAB? What does it mean?

-javier

Subject: Chemical process modelling

From: Steve Amphlett

Date: 24 Feb, 2006 05:14:25

Message: 3 of 11

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.

Subject: Chemical process modelling

From: Kelvin Hales

Date: 24 Feb, 2006 15:04:32

Message: 4 of 11

In article <IAnLf.43486$Q22.30347@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 have
> 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 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 sequential-solving
package like Simulink - but each approach has its advantages and disadvantages. 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.

Kelvin B. Hales
Kelvin Hales Associates Limited
Consulting Control Engineers
Web: www.khace.com

Subject: Chemical process modelling

From: Steve Amphlett

Date: 24 Feb, 2006 12:21:34

Message: 5 of 11

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.

Subject: Chemical process modelling

From: Steven Lord

Date: 24 Feb, 2006 12:46:32

Message: 6 of 11


"Steve Amphlett" <Firstname.Lastname@where_I_work.com> wrote in message
news:ef29f57.3@webx.raydaftYaTP...
> 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.

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@mathworks.com

Subject: Chemical process modelling [OT]

From: max

Date: 24 Feb, 2006 19:38:45

Message: 7 of 11


"Javier Fernández" <javier@atc.ugr.es> wrote in message
news:dtl1f8$5ia$1@mercurio.cica.es...
> max wrote:
> > ...
> > flowsheeting package) there is the one-liner that Matlab/Simulink is not
> > suitable for chemical process engineering. I haven't managed to find any
> > ...
>
> I thought "one-liner" was MATLAB-specific jargon :-). I think I have
> seen it in several places, including manuals and web pages, always used
> in the sense of "look how much you can do with just 1 line of MATLAB
> code". For instance, at the beginning of
>
>
http://www.mathworks.com/company/newsletters/news_notes/clevescorner/clevecorner.html
>
> Winter'99 Cleve's corner. The one-liner in question was
>
> plot(eig(randn(1024, 1024*p)), '.')
>
> So one-liner is common jargon & it means something completely unrelated
> to MATLAB? What does it mean?
>
> -javier

In this context it means a throw-away comment, intriguing but with no
back-up or justification.

Subject: Chemical process modelling

From: max

Date: 24 Feb, 2006 19:38:45

Message: 8 of 11


"Steve Amphlett" <Firstname.Lastname@where_I_work.com> wrote in message
news:ef29f57.1@webx.raydaftYaTP...
> 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...
>

https://pse.cheme.cmu.edu/wiki/view/Ascend/OtherModellingTools

> 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 week - 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.

Subject: Chemical process modelling

From: max

Date: 24 Feb, 2006 19:38:46

Message: 9 of 11


"Kelvin Hales" <khales@khace.com> wrote in message
news:VA.00001f89.001130b2@khace.com...
> In article <IAnLf.43486$Q22.30347@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
have
> > 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
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 week
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
disadvantages. 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
>

Subject: Chemical process modelling

From: max

Date: 24 Feb, 2006 19:38:46

Message: 10 of 11


"Steven Lord" <slord@mathworks.com> wrote in message
news:dtngpo$14p$1@fred.mathworks.com...
>
> "Steve Amphlett" <Firstname.Lastname@where_I_work.com> wrote in message
> news:ef29f57.3@webx.raydaftYaTP...
> > 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.
>
> 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@mathworks.com
>
>

Subject: Chemical process modelling

From: Kelvin Hales

Date: 27 Feb, 2006 09:36:36

Message: 11 of 11

In article <VA.00001f89.001130b2@khace.com>, Kelvin Hales wrote:
> In article <IAnLf.43486$Q22.30347@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 have
> > 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 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 sequential-solving
> package like Simulink - but each approach has its advantages and disadvantages. 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.

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 suitable for Chem.Eng.
applications, as to say that it is not suitable for use by Chemical Engineers! In my several decades
working closely with Chemical Engineers (as sort of Control-Engineer made honourary Chemical
Engineer) I have learned that the way Chemical Engineers think about modelling, 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 modelling in the more
abstract more terms of sets of simultaneous differential equations and degrees of freedom. They
don't study general system dynamics to any significant degree (or at least not to the extent of
other engineering disciplines). They aren't familiar with and don't understand state-space
representation. They like to see their variables move with time; but they aren't interested in
things like frequency-response (not even taught in some universities), system resonances,
rise-times, bandwidth, noise, regulation, sensitivity, etc. They can't visualise 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 structure of a system laid out
in blocks and solved sequentially (cause and effect). What they do like to do 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 process modelling and design.
They also have a frequent need to model lots of partial-differential equations.
OTOH, the Process Control Engineer will find a Chem.Eng. package offering few, 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 dynamic analysis. (Although
sometimes it is possible to work with just linearised models generated by some 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 embedded in Simulink.

On a historical note: all Chem.Eng. modelling and simulation started out with 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 special-purpose packages
aimed at supporting special interest groups.
In theory it all comes down to selecting appropriate software for the simulation task to be
performed. (Although more and more we find that in industry it goes the other way around: the target
simulation software is chosen first (usually by management in some commercially -advantageous deal
with the manufacturer), and then the simulation tasks performed are subsequently limited in scope to
whatever that chosen/preferred package can do! The days of the general modeller are this numbered!

Kelvin B. Hales
Kelvin Hales Associates Limited
Consulting Control Engineers
Web: www.khace.com

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us