{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2025-12-14T01:33:56.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2025-12-14T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":45413,"title":"Characterize fluid flow in a pipe as to laminar or turbulent","description":"In fluid mechanics, characterizing the flow in a pipe is essential to predicting its behavior. The flow pattern can either be laminar (smooth/sheet-like), turbulent (rough/chaotic), or transitioning from laminar to turbulent. Intuitively, flow velocity is a dominant factor in determining the flow pattern: A slow-moving fluid is laminar, while a fast-moving one is turbulent. However, the flow pattern can also be influenced by pipe geometry, fluid viscosity, and fluid density.\r\n\r\nHence, instead of just flow velocity, engineers are using a number that better indicates the flow pattern called the Reynolds Number, *Re*. For a fluid flowing inside a circular pipe, *Re* is computed as follows:\r\n\r\n  Re = D x v x rho / mu\r\n    where:\r\n    D = inside diameter of the pipe [m]\r\n    v = mean flow velocity [m/s]\r\n    rho = fluid density [kg/m^3]\r\n    mu = fluid viscosity [Pa.s] or [kg/m/s]\r\n \r\nNote: Although it is not customary to use SI units for these quantities, this problem deals with SI units for ease. \r\n\r\nWe can then adopt the following rule: If *Re* \u003c 2300, the flow is laminar; if *Re* \u003e 2900, the flow is turbulent; otherwise, the flow is in transition. \r\n\r\nWrite a function that accepts a MATLAB variable, x, which is always a 4-element row vector containing the values (in SI) of |D|, |v|, |rho|, and |mu| in that order. Output the appropriate string among 'LAMINAR', 'TRANSITION', or 'TURBULENT', according to the rule above.\r\n\r\nSee sample test cases:\r\n\r\n  \u003e\u003e flow_pattern([0.02 0.1 1000 8.9e-4])\r\nans =\r\n    'LAMINAR'\r\n\u003e\u003e flow_pattern([0.02 0.5 1000 8.9e-4])\r\nans =\r\n    'TURBULENT'\r\n\u003e\u003e flow_pattern([0.02 0.1 1200 8.9e-4])\r\nans =\r\n    'TRANSITION'\r\n    \r\n","description_html":"\u003cp\u003eIn fluid mechanics, characterizing the flow in a pipe is essential to predicting its behavior. The flow pattern can either be laminar (smooth/sheet-like), turbulent (rough/chaotic), or transitioning from laminar to turbulent. Intuitively, flow velocity is a dominant factor in determining the flow pattern: A slow-moving fluid is laminar, while a fast-moving one is turbulent. However, the flow pattern can also be influenced by pipe geometry, fluid viscosity, and fluid density.\u003c/p\u003e\u003cp\u003eHence, instead of just flow velocity, engineers are using a number that better indicates the flow pattern called the Reynolds Number, \u003cb\u003eRe\u003c/b\u003e. For a fluid flowing inside a circular pipe, \u003cb\u003eRe\u003c/b\u003e is computed as follows:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eRe = D x v x rho / mu\r\n  where:\r\n  D = inside diameter of the pipe [m]\r\n  v = mean flow velocity [m/s]\r\n  rho = fluid density [kg/m^3]\r\n  mu = fluid viscosity [Pa.s] or [kg/m/s]\r\n\u003c/pre\u003e\u003cp\u003eNote: Although it is not customary to use SI units for these quantities, this problem deals with SI units for ease.\u003c/p\u003e\u003cp\u003eWe can then adopt the following rule: If \u003cb\u003eRe\u003c/b\u003e \u0026lt; 2300, the flow is laminar; if \u003cb\u003eRe\u003c/b\u003e \u0026gt; 2900, the flow is turbulent; otherwise, the flow is in transition.\u003c/p\u003e\u003cp\u003eWrite a function that accepts a MATLAB variable, x, which is always a 4-element row vector containing the values (in SI) of \u003ctt\u003eD\u003c/tt\u003e, \u003ctt\u003ev\u003c/tt\u003e, \u003ctt\u003erho\u003c/tt\u003e, and \u003ctt\u003emu\u003c/tt\u003e in that order. Output the appropriate string among 'LAMINAR', 'TRANSITION', or 'TURBULENT', according to the rule above.\u003c/p\u003e\u003cp\u003eSee sample test cases:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e\u0026gt;\u0026gt; flow_pattern([0.02 0.1 1000 8.9e-4])\r\nans =\r\n  'LAMINAR'\r\n\u0026gt;\u0026gt; flow_pattern([0.02 0.5 1000 8.9e-4])\r\nans =\r\n  'TURBULENT'\r\n\u0026gt;\u0026gt; flow_pattern([0.02 0.1 1200 8.9e-4])\r\nans =\r\n  'TRANSITION'\r\n\u003c/pre\u003e","function_template":"function y = flow_pattern(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nassert(isequal(flow_pattern([0.025 0.089 986.29 0.00087]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.036 0.095 976.11 0.00089]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.035 0.124 1089.38 0.00080]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.036 0.095 1069.84 0.00078]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.035 0.148 1004.66 0.00079]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.024 0.082 922.17 0.00078]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.027 0.084 1063.42 0.00081]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.030 0.127 924.05 0.00083]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.027 0.083 1014.92 0.00087]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.024 0.117 1080.37 0.00074]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.026 0.100 1077.98 0.00080]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.026 0.103 1014.85 0.00078]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.020 0.120 1001.35 0.00078]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.021 0.086 946.85 0.00074]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.036 0.089 910.72 0.00078]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.035 0.067 1082.44 0.00076]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.027 0.070 1053.44 0.00071]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.039 0.066 957.29 0.00084]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.023 0.101 1044.27 0.00089]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.035 0.125 981.46 0.00075]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.030 0.072 1068.48 0.00083]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.036 0.129 993.82 0.00076]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.034 0.149 1053.99 0.00087]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.034 0.110 1050.57 0.00080]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.037 0.057 1093.71 0.00072]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.031 0.090 921.41 0.00084]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.032 0.128 1013.32 0.00086]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.032 0.144 1074.29 0.00080]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.036 0.097 1065.76 0.00076]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.040 0.078 914.57 0.00085]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.037 0.142 965.40 0.00086]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.031 0.096 1064.15 0.00089]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.022 0.121 946.99 0.00078]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.025 0.133 1099.07 0.00083]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.034 0.143 1037.53 0.00081]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.028 0.113 972.65 0.00078]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.027 0.097 1000.68 0.00088]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.024 0.084 1014.83 0.00080]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.025 0.108 1075.67 0.00071]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.029 0.058 1012.65 0.00081]),'LAMINAR'))\r\n%%\r\nassert(isequal(flow_pattern([0.035 0.073 1017.47 0.00079]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.037 0.116 970.78 0.00077]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.025 0.145 959.64 0.00073]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.027 0.124 1041.18 0.00084]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.020 0.087 1080.30 0.00076]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.032 0.080 925.00 0.00078]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.036 0.148 1072.40 0.00072]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.027 0.074 963.56 0.00090]),'LAMINAR'))\r\n%%\r\nassert(isequal(flow_pattern([0.031 0.125 1068.37 0.00073]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.038 0.061 1049.02 0.00085]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.034 0.063 989.16 0.00080]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.031 0.136 1035.54 0.00086]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.031 0.146 913.34 0.00081]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.026 0.098 1036.97 0.00074]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.032 0.083 1076.17 0.00073]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.022 0.146 930.58 0.00073]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.023 0.059 990.88 0.00083]),'LAMINAR'))\r\n%%\r\nassert(isequal(flow_pattern([0.037 0.129 1042.54 0.00079]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.034 0.146 1001.16 0.00076]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.036 0.074 946.86 0.00079]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.032 0.112 924.52 0.00072]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.026 0.124 982.26 0.00087]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.039 0.090 910.44 0.00081]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.035 0.082 998.59 0.00074]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.039 0.098 1008.00 0.00074]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.022 0.056 1063.90 0.00085]),'LAMINAR'))\r\n%%\r\nassert(isequal(flow_pattern([0.024 0.140 1036.86 0.00083]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.040 0.053 984.85 0.00080]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.032 0.058 1032.03 0.00071]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.031 0.121 997.58 0.00082]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.024 0.115 976.13 0.00072]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.028 0.076 948.26 0.00082]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.030 0.091 943.56 0.00087]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.037 0.078 1023.08 0.00086]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.039 0.142 976.96 0.00073]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.036 0.061 931.76 0.00077]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.037 0.108 1017.24 0.00089]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.032 0.051 1061.88 0.00082]),'LAMINAR'))\r\n%%\r\nassert(isequal(flow_pattern([0.030 0.077 951.62 0.00080]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.025 0.055 933.85 0.00075]),'LAMINAR'))\r\n%%\r\nassert(isequal(flow_pattern([0.024 0.111 1064.74 0.00086]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.036 0.121 1071.88 0.00086]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.024 0.149 918.72 0.00083]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.024 0.074 967.94 0.00074]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.030 0.145 978.92 0.00082]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.032 0.121 980.31 0.00087]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.038 0.125 957.12 0.00086]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.023 0.100 1022.14 0.00084]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.028 0.123 1077.46 0.00071]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.023 0.136 984.35 0.00078]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.039 0.125 1096.20 0.00075]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.022 0.088 1000.05 0.00081]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.040 0.099 980.18 0.00090]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.025 0.117 1092.85 0.00083]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.026 0.103 900.29 0.00088]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.028 0.080 1090.12 0.00079]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.026 0.058 1016.44 0.00073]),'LAMINAR'))\r\n%%\r\nassert(isequal(flow_pattern([0.021 0.108 957.40 0.00077]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.034 0.136 969.58 0.00089]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.039 0.071 1053.65 0.00082]),'TURBULENT'))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":1,"created_by":255320,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":149,"test_suite_updated_at":"2020-04-01T01:14:34.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-04-01T00:39:41.000Z","updated_at":"2026-03-31T11:58:08.000Z","published_at":"2020-04-01T01:14:34.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn fluid mechanics, characterizing the flow in a pipe is essential to predicting its behavior. The flow pattern can either be laminar (smooth/sheet-like), turbulent (rough/chaotic), or transitioning from laminar to turbulent. Intuitively, flow velocity is a dominant factor in determining the flow pattern: A slow-moving fluid is laminar, while a fast-moving one is turbulent. However, the flow pattern can also be influenced by pipe geometry, fluid viscosity, and fluid density.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHence, instead of just flow velocity, engineers are using a number that better indicates the flow pattern called the Reynolds Number,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRe\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. For a fluid flowing inside a circular pipe,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRe\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is computed as follows:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[Re = D x v x rho / mu\\n  where:\\n  D = inside diameter of the pipe [m]\\n  v = mean flow velocity [m/s]\\n  rho = fluid density [kg/m^3]\\n  mu = fluid viscosity [Pa.s] or [kg/m/s]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNote: Although it is not customary to use SI units for these quantities, this problem deals with SI units for ease.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWe can then adopt the following rule: If\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRe\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u0026lt; 2300, the flow is laminar; if\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRe\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u0026gt; 2900, the flow is turbulent; otherwise, the flow is in transition.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function that accepts a MATLAB variable, x, which is always a 4-element row vector containing the values (in SI) of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eD\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ev\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003erho\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003emu\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e in that order. Output the appropriate string among 'LAMINAR', 'TRANSITION', or 'TURBULENT', according to the rule above.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSee sample test cases:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[\u003e\u003e flow_pattern([0.02 0.1 1000 8.9e-4])\\nans =\\n  'LAMINAR'\\n\u003e\u003e flow_pattern([0.02 0.5 1000 8.9e-4])\\nans =\\n  'TURBULENT'\\n\u003e\u003e flow_pattern([0.02 0.1 1200 8.9e-4])\\nans =\\n  'TRANSITION']]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":45413,"title":"Characterize fluid flow in a pipe as to laminar or turbulent","description":"In fluid mechanics, characterizing the flow in a pipe is essential to predicting its behavior. The flow pattern can either be laminar (smooth/sheet-like), turbulent (rough/chaotic), or transitioning from laminar to turbulent. Intuitively, flow velocity is a dominant factor in determining the flow pattern: A slow-moving fluid is laminar, while a fast-moving one is turbulent. However, the flow pattern can also be influenced by pipe geometry, fluid viscosity, and fluid density.\r\n\r\nHence, instead of just flow velocity, engineers are using a number that better indicates the flow pattern called the Reynolds Number, *Re*. For a fluid flowing inside a circular pipe, *Re* is computed as follows:\r\n\r\n  Re = D x v x rho / mu\r\n    where:\r\n    D = inside diameter of the pipe [m]\r\n    v = mean flow velocity [m/s]\r\n    rho = fluid density [kg/m^3]\r\n    mu = fluid viscosity [Pa.s] or [kg/m/s]\r\n \r\nNote: Although it is not customary to use SI units for these quantities, this problem deals with SI units for ease. \r\n\r\nWe can then adopt the following rule: If *Re* \u003c 2300, the flow is laminar; if *Re* \u003e 2900, the flow is turbulent; otherwise, the flow is in transition. \r\n\r\nWrite a function that accepts a MATLAB variable, x, which is always a 4-element row vector containing the values (in SI) of |D|, |v|, |rho|, and |mu| in that order. Output the appropriate string among 'LAMINAR', 'TRANSITION', or 'TURBULENT', according to the rule above.\r\n\r\nSee sample test cases:\r\n\r\n  \u003e\u003e flow_pattern([0.02 0.1 1000 8.9e-4])\r\nans =\r\n    'LAMINAR'\r\n\u003e\u003e flow_pattern([0.02 0.5 1000 8.9e-4])\r\nans =\r\n    'TURBULENT'\r\n\u003e\u003e flow_pattern([0.02 0.1 1200 8.9e-4])\r\nans =\r\n    'TRANSITION'\r\n    \r\n","description_html":"\u003cp\u003eIn fluid mechanics, characterizing the flow in a pipe is essential to predicting its behavior. The flow pattern can either be laminar (smooth/sheet-like), turbulent (rough/chaotic), or transitioning from laminar to turbulent. Intuitively, flow velocity is a dominant factor in determining the flow pattern: A slow-moving fluid is laminar, while a fast-moving one is turbulent. However, the flow pattern can also be influenced by pipe geometry, fluid viscosity, and fluid density.\u003c/p\u003e\u003cp\u003eHence, instead of just flow velocity, engineers are using a number that better indicates the flow pattern called the Reynolds Number, \u003cb\u003eRe\u003c/b\u003e. For a fluid flowing inside a circular pipe, \u003cb\u003eRe\u003c/b\u003e is computed as follows:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eRe = D x v x rho / mu\r\n  where:\r\n  D = inside diameter of the pipe [m]\r\n  v = mean flow velocity [m/s]\r\n  rho = fluid density [kg/m^3]\r\n  mu = fluid viscosity [Pa.s] or [kg/m/s]\r\n\u003c/pre\u003e\u003cp\u003eNote: Although it is not customary to use SI units for these quantities, this problem deals with SI units for ease.\u003c/p\u003e\u003cp\u003eWe can then adopt the following rule: If \u003cb\u003eRe\u003c/b\u003e \u0026lt; 2300, the flow is laminar; if \u003cb\u003eRe\u003c/b\u003e \u0026gt; 2900, the flow is turbulent; otherwise, the flow is in transition.\u003c/p\u003e\u003cp\u003eWrite a function that accepts a MATLAB variable, x, which is always a 4-element row vector containing the values (in SI) of \u003ctt\u003eD\u003c/tt\u003e, \u003ctt\u003ev\u003c/tt\u003e, \u003ctt\u003erho\u003c/tt\u003e, and \u003ctt\u003emu\u003c/tt\u003e in that order. Output the appropriate string among 'LAMINAR', 'TRANSITION', or 'TURBULENT', according to the rule above.\u003c/p\u003e\u003cp\u003eSee sample test cases:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e\u0026gt;\u0026gt; flow_pattern([0.02 0.1 1000 8.9e-4])\r\nans =\r\n  'LAMINAR'\r\n\u0026gt;\u0026gt; flow_pattern([0.02 0.5 1000 8.9e-4])\r\nans =\r\n  'TURBULENT'\r\n\u0026gt;\u0026gt; flow_pattern([0.02 0.1 1200 8.9e-4])\r\nans =\r\n  'TRANSITION'\r\n\u003c/pre\u003e","function_template":"function y = flow_pattern(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nassert(isequal(flow_pattern([0.025 0.089 986.29 0.00087]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.036 0.095 976.11 0.00089]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.035 0.124 1089.38 0.00080]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.036 0.095 1069.84 0.00078]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.035 0.148 1004.66 0.00079]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.024 0.082 922.17 0.00078]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.027 0.084 1063.42 0.00081]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.030 0.127 924.05 0.00083]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.027 0.083 1014.92 0.00087]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.024 0.117 1080.37 0.00074]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.026 0.100 1077.98 0.00080]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.026 0.103 1014.85 0.00078]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.020 0.120 1001.35 0.00078]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.021 0.086 946.85 0.00074]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.036 0.089 910.72 0.00078]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.035 0.067 1082.44 0.00076]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.027 0.070 1053.44 0.00071]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.039 0.066 957.29 0.00084]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.023 0.101 1044.27 0.00089]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.035 0.125 981.46 0.00075]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.030 0.072 1068.48 0.00083]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.036 0.129 993.82 0.00076]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.034 0.149 1053.99 0.00087]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.034 0.110 1050.57 0.00080]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.037 0.057 1093.71 0.00072]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.031 0.090 921.41 0.00084]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.032 0.128 1013.32 0.00086]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.032 0.144 1074.29 0.00080]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.036 0.097 1065.76 0.00076]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.040 0.078 914.57 0.00085]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.037 0.142 965.40 0.00086]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.031 0.096 1064.15 0.00089]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.022 0.121 946.99 0.00078]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.025 0.133 1099.07 0.00083]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.034 0.143 1037.53 0.00081]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.028 0.113 972.65 0.00078]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.027 0.097 1000.68 0.00088]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.024 0.084 1014.83 0.00080]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.025 0.108 1075.67 0.00071]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.029 0.058 1012.65 0.00081]),'LAMINAR'))\r\n%%\r\nassert(isequal(flow_pattern([0.035 0.073 1017.47 0.00079]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.037 0.116 970.78 0.00077]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.025 0.145 959.64 0.00073]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.027 0.124 1041.18 0.00084]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.020 0.087 1080.30 0.00076]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.032 0.080 925.00 0.00078]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.036 0.148 1072.40 0.00072]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.027 0.074 963.56 0.00090]),'LAMINAR'))\r\n%%\r\nassert(isequal(flow_pattern([0.031 0.125 1068.37 0.00073]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.038 0.061 1049.02 0.00085]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.034 0.063 989.16 0.00080]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.031 0.136 1035.54 0.00086]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.031 0.146 913.34 0.00081]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.026 0.098 1036.97 0.00074]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.032 0.083 1076.17 0.00073]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.022 0.146 930.58 0.00073]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.023 0.059 990.88 0.00083]),'LAMINAR'))\r\n%%\r\nassert(isequal(flow_pattern([0.037 0.129 1042.54 0.00079]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.034 0.146 1001.16 0.00076]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.036 0.074 946.86 0.00079]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.032 0.112 924.52 0.00072]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.026 0.124 982.26 0.00087]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.039 0.090 910.44 0.00081]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.035 0.082 998.59 0.00074]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.039 0.098 1008.00 0.00074]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.022 0.056 1063.90 0.00085]),'LAMINAR'))\r\n%%\r\nassert(isequal(flow_pattern([0.024 0.140 1036.86 0.00083]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.040 0.053 984.85 0.00080]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.032 0.058 1032.03 0.00071]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.031 0.121 997.58 0.00082]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.024 0.115 976.13 0.00072]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.028 0.076 948.26 0.00082]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.030 0.091 943.56 0.00087]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.037 0.078 1023.08 0.00086]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.039 0.142 976.96 0.00073]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.036 0.061 931.76 0.00077]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.037 0.108 1017.24 0.00089]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.032 0.051 1061.88 0.00082]),'LAMINAR'))\r\n%%\r\nassert(isequal(flow_pattern([0.030 0.077 951.62 0.00080]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.025 0.055 933.85 0.00075]),'LAMINAR'))\r\n%%\r\nassert(isequal(flow_pattern([0.024 0.111 1064.74 0.00086]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.036 0.121 1071.88 0.00086]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.024 0.149 918.72 0.00083]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.024 0.074 967.94 0.00074]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.030 0.145 978.92 0.00082]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.032 0.121 980.31 0.00087]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.038 0.125 957.12 0.00086]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.023 0.100 1022.14 0.00084]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.028 0.123 1077.46 0.00071]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.023 0.136 984.35 0.00078]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.039 0.125 1096.20 0.00075]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.022 0.088 1000.05 0.00081]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.040 0.099 980.18 0.00090]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.025 0.117 1092.85 0.00083]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.026 0.103 900.29 0.00088]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.028 0.080 1090.12 0.00079]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.026 0.058 1016.44 0.00073]),'LAMINAR'))\r\n%%\r\nassert(isequal(flow_pattern([0.021 0.108 957.40 0.00077]),'TRANSITION'))\r\n%%\r\nassert(isequal(flow_pattern([0.034 0.136 969.58 0.00089]),'TURBULENT'))\r\n%%\r\nassert(isequal(flow_pattern([0.039 0.071 1053.65 0.00082]),'TURBULENT'))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":1,"created_by":255320,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":149,"test_suite_updated_at":"2020-04-01T01:14:34.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-04-01T00:39:41.000Z","updated_at":"2026-03-31T11:58:08.000Z","published_at":"2020-04-01T01:14:34.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn fluid mechanics, characterizing the flow in a pipe is essential to predicting its behavior. The flow pattern can either be laminar (smooth/sheet-like), turbulent (rough/chaotic), or transitioning from laminar to turbulent. Intuitively, flow velocity is a dominant factor in determining the flow pattern: A slow-moving fluid is laminar, while a fast-moving one is turbulent. However, the flow pattern can also be influenced by pipe geometry, fluid viscosity, and fluid density.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHence, instead of just flow velocity, engineers are using a number that better indicates the flow pattern called the Reynolds Number,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRe\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. For a fluid flowing inside a circular pipe,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRe\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is computed as follows:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[Re = D x v x rho / mu\\n  where:\\n  D = inside diameter of the pipe [m]\\n  v = mean flow velocity [m/s]\\n  rho = fluid density [kg/m^3]\\n  mu = fluid viscosity [Pa.s] or [kg/m/s]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNote: Although it is not customary to use SI units for these quantities, this problem deals with SI units for ease.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWe can then adopt the following rule: If\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRe\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u0026lt; 2300, the flow is laminar; if\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRe\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u0026gt; 2900, the flow is turbulent; otherwise, the flow is in transition.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function that accepts a MATLAB variable, x, which is always a 4-element row vector containing the values (in SI) of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eD\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ev\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003erho\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003emu\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e in that order. Output the appropriate string among 'LAMINAR', 'TRANSITION', or 'TURBULENT', according to the rule above.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSee sample test cases:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[\u003e\u003e flow_pattern([0.02 0.1 1000 8.9e-4])\\nans =\\n  'LAMINAR'\\n\u003e\u003e flow_pattern([0.02 0.5 1000 8.9e-4])\\nans =\\n  'TURBULENT'\\n\u003e\u003e flow_pattern([0.02 0.1 1200 8.9e-4])\\nans =\\n  'TRANSITION']]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"term":"tag:\"reynolds\"","current_player_id":null,"fields":[{"name":"page","type":"integer","callback":null,"default":1,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"per_page","type":"integer","callback":null,"default":50,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"sort","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"body","type":"text","callback":null,"default":"*:*","directive":null,"facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":false},{"name":"group","type":"string","callback":null,"default":null,"directive":"group","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"difficulty_rating_bin","type":"string","callback":null,"default":null,"directive":"difficulty_rating_bin","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"id","type":"integer","callback":null,"default":null,"directive":"id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"tag","type":"string","callback":null,"default":null,"directive":"tag","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"product","type":"string","callback":null,"default":null,"directive":"product","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_at","type":"timeframe","callback":{},"default":null,"directive":"created_at","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"profile_id","type":"integer","callback":null,"default":null,"directive":"author_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_by","type":"string","callback":null,"default":null,"directive":"author","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player_id","type":"integer","callback":null,"default":null,"directive":"solver_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player","type":"string","callback":null,"default":null,"directive":"solver","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"solvers_count","type":"integer","callback":null,"default":null,"directive":"solvers_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"comments_count","type":"integer","callback":null,"default":null,"directive":"comments_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"likes_count","type":"integer","callback":null,"default":null,"directive":"likes_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leader_id","type":"integer","callback":null,"default":null,"directive":"leader_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leading_solution","type":"integer","callback":null,"default":null,"directive":"leading_solution","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true}],"filters":[{"name":"asset_type","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":"\"cody:problem\"","prepend":true},{"name":"profile_id","type":"integer","callback":{},"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":"author_id","static":null,"prepend":true}],"query":{"params":{"per_page":50,"term":"tag:\"reynolds\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"reynolds\"","","\"","reynolds","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f4f477071d0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f4f47707130\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f4f47705970\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f4f47707590\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f4f477074f0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f4f47707450\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f4f47707270\u003e":"tag:\"reynolds\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f4f47707270\u003e":"tag:\"reynolds\""},"queried_facets":{}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"search","password":"J3bGPZzQ7asjJcCk","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"tag:\"reynolds\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"reynolds\"","","\"","reynolds","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f4f477071d0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f4f47707130\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f4f47705970\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f4f47707590\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f4f477074f0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f4f47707450\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f4f47707270\u003e":"tag:\"reynolds\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f4f47707270\u003e":"tag:\"reynolds\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":45413,"difficulty_rating":"easy-medium"}]}}