File Exchange

image thumbnail

Engine Cooling Model in Simscape

version (275 KB) by Steve Miller
Thermal fluid system in Simscape language using full-flux modeling method


Updated 07 Mar 2016

View Version History

View License

This file contains a model of an engine cooling system built using the Simscape language. A radiator, thermostat, hoses, coolant, and a pump are included in the model. Heat is transferred from the engine to the fluid, and the thermostat opens the fluid path through the radiator when the activation temperature is reached. The fluid properties change based on pressure and temperature using lookup tables implemented in the Simscape language. The table lookup data was generated using REFPROP supplied by NIST. This example uses the full-flux modeling technique. Consult the model description as well as the Simscape language source code and comments for more information on this approach.
Please read the README.txt file to get started.

For an explanation of this model and the full-flux modeling method, watch this video (3 min):

To view a webinar (35 minutes) about the Simscape language, go to:

To find other Simscape examples, search for posts with the keyword "physical modeling"

To learn more about MathWorks Simscape Products, go to:

Cite As

Steve Miller (2020). Engine Cooling Model in Simscape (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (15)

Steve Miller

Hi SITTI: For release R2014a and higher, please open the shipping example ssc_engine_cooling_system. For releases prior to R2014a, please run the startup script startup_EngineCooling.

Hello there, i have same question as any other comment. i am using R2020b but why i still cant use it, i mean it have bad link, the basic component aka block of ECS just the 4 of them, then how am i suppose to do to insert the the Other bad link such as Bypass Hose, Fluid Properties and Hose. Do you have any suggestion. Because i already try many stupid trying to insert the Pipe(TL) into the ECS lib but still can't link

Giti Karimi

Where I can find the 'README.txt' file?

Ted Mitrou

hey!great job!my question is can it work with refpropmini?

Andreas Welschof

I have the exact same Problem described by Jon only I am using R2015b... What am I supposed to do? Thanks a lot!


Steve, I have downloaded and unzipped this model and followed the directions in the readme. However the model is full of "bad link" blocks and fails to run, with the error "failed to load library 'EngineCoolingComponents_lib'".
Am I missing something? I am running 2012b.
Many thanks.


I forgot something:
How did you create the media data with refprop?


Great model, could you provide more examples using the thermal liquid library?

Steve Miller

Luca and Michael -- I think this example was created in a MATLAB release that is later than the one you're using. This submission contains a version compatible with R2012b and beyond, and a separate version compatible with R2013b and beyond. If you are using a MATLAB release *before* R2012b, neither will work ("Bad link" error). Please check your release and use the version compatible with your release.

The release that is compatible with this submission is indicated in the "File Information" field above.



It also doesn't work for me. I am using R2012, and when I run the code it generates an error. I run the startup file, and then the mdl file. The model loads, however the pump, hose, radiator, fluid properties, thermostat, and bypass hose all display "Bad link". Any suggestions?

Steve Miller

Hi Luca -- which release are you using, and what message did you receive?


The file does not work


Hi there,

I was going over the video and the file. In the video, you have one temp sensor and two mass flow sensors. The file has only the temperature sensor. I am trying to add some temperature sensors and flow sensors using the methods described in the videos but not links do not get connected. I am a newbie in Simscape so probably missing something.

How can I add temperature and flow sensors in the example given? Any help would be highly appreciated.

Thank you.

Steve Miller

Hello there,
Thank you for your comments.
Since table look-up functions have been introduced in Simscape during the 12a release, this example cannot be run in its current state. The underlying reason is that fluid properties, as defined in the main classes ('TwoportsIncompressible.ssc' and 'TwoportsCompressible.ssc'), are described using table look-up functions.
To work around this, you may consider defining your own analytical description of the properties as functions of pressure and temperature.
Thank you,


it looks very complete when i read the code. that's a very good job.
but i can't launch it because i have a matlab 2010 version. when i launch startup, it tell me that there is unexpected matlab operator in TwoportsIncompressible.ssc line 42 column 82. if i try to put == instead of =, it tell me that there is a unknow variable 'interpolation'.
is there something to do to launch it on matlab 2010 or can't we?
thanks for answer

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!