# Compressor Map with Scattered Lookup

This example shows gas flow through a compressor which is modeled using a simple controlled mass flow rate source. The compressor map that governs this mass flow rate is modeled using the PS Scattered Lookup (2D) block whose data coordinates are the pressure ratio (Pa/Pa) and the engine RPM, and the output is the mass flow rate (kg/s). The scattered lookup block performs delaunay triangulation on the input data (which is shown in plots below), and uses this to interpolate and calculate the mass flow rate based on the input. Scattered lookup allows modeling of the compressor even if the data provided is in an unstructured format.

A sample compressor map is shown in the figure. For this example, one can choose any set of points along the various RPM lines as input data points for the PS Scattered Lookup block. The first coordinate is the pressure ratio and the second coordinate is the RPM value. The function value is the corresponding value of the mass flow rate. ### Model ### Compressor Map Subsystem ### Simulation Results from Scopes

In this example, a sinusoidal input of RPM is provided to the compressor and the flow resistance based on a pressure drop and mass flow rate in the range of the compressor map is set. As the RPM changes, so does the mass flow rate, which then changes the outlet pressure which is also plotted in the Scope. ### Simulation Results from Simscape Logging

This plot shows how the provided data is triangulated for the SluCompressorMapExample. The x1 coordinate is the pressure ratio and the x2 coordinate is the scaled RPM. This triangulation is what is used by scatteredlookup to interpolate or extrapolate query values in the compressor map. The function value is the mass flow rate.
{"ft_lang_label":"__label__en","ft_lang_prob":0.8605361,"math_prob":0.96877795,"size":1752,"snap":"2023-40-2023-50","text_gpt3_token_len":358,"char_repetition_ratio":0.16075514,"word_repetition_ratio":0.027303753,"special_character_ratio":0.18778539,"punctuation_ratio":0.06269593,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99216163,"pos_list":[0,1,2,3,4,5,6,7,8,9,10],"im_url_duplicate_count":[null,1,null,1,null,1,null,1,null,1,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-09-25T19:49:42Z\",\"WARC-Record-ID\":\"<urn:uuid:f9072f3c-27ed-4066-b4ba-906a6e76b49b>\",\"Content-Length\":\"79119\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:bcdfb77e-b794-4c78-a95d-87119a89133a>\",\"WARC-Concurrent-To\":\"<urn:uuid:c92893d8-0189-4383-8050-1e903467287a>\",\"WARC-IP-Address\":\"23.34.160.82\",\"WARC-Target-URI\":\"https://ch.mathworks.com/help/simscape/ug/compressor-with-scattered-lookup.html\",\"WARC-Payload-Digest\":\"sha1:TWBD3X2G2JUYWMA2SWFFV6MPVC3ZTM5Y\",\"WARC-Block-Digest\":\"sha1:XP5QGBUXR6TWXKPQ7QJZVVGYSS5NDSAG\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-40/CC-MAIN-2023-40_segments_1695233510085.26_warc_CC-MAIN-20230925183615-20230925213615-00044.warc.gz\"}"}