{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-04-06T14:01:22.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":"2026-04-06T00: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":44703,"title":"Response of First Order Control Systems","description":"In practice, the input signal to an automatic control system is not known ahead of time but usually random in nature. Thus, in the analysis and design of control systems, engineers usually employ test input signals as the basis for comparison of system performance.\r\n\r\nMATLAB Control System Toolbox contain the functions _step_ and _impulse_ which allows the simulation of the response of a control system to these test signals. Given the numerator and denominator of a system transfer function and simulation time duration _t_ given as a vector, these functions will return the response _y(t)_ that determines the system performance [See MATLAB Documentation for more information].\r\n\r\n  \u003e\u003e clc\r\n  \u003e\u003e num = 1; den = [2 1]; t = [0:0.2:1];\r\n  \u003e\u003e y = step(num,den,t)\r\n   y = \r\n\r\n                   0\r\n   0.095162581964040\r\n   0.181269246922018\r\n   0.259181779318282\r\n   0.329679953964361\r\n   0.393469340287367\r\n\u003e\u003e y = impulse(num,den,t)\r\ny =\r\n\r\n   0.500000000000000\r\n   0.452418709017980\r\n   0.409365376538991\r\n   0.370409110340859\r\n   0.335160023017820\r\n   0.303265329856317\r\n\r\n\r\nUnfortunately, these useful toolboox functions are not available here on Cody.\r\n\r\n\r\nYour task is to write a program that performs the same function for first order control systems. We will consider three important aperiodic test signals: *(1.)* Unit impulse *(2.)* Unit step *(3.)* Unit ramp. This will be specified as an additional parameter to your program. Your program will then return:\r\n\r\n*y* (t) – the system response during time interval _t_ (exactly the same with MATLAB toolbox for impulse and step)\r\n\r\n\r\n*HINT:* This is a simple problem in classical control involving the application of Laplace Transform and partial fractions.","description_html":"\u003cp\u003eIn practice, the input signal to an automatic control system is not known ahead of time but usually random in nature. Thus, in the analysis and design of control systems, engineers usually employ test input signals as the basis for comparison of system performance.\u003c/p\u003e\u003cp\u003eMATLAB Control System Toolbox contain the functions \u003ci\u003estep\u003c/i\u003e and \u003ci\u003eimpulse\u003c/i\u003e which allows the simulation of the response of a control system to these test signals. Given the numerator and denominator of a system transfer function and simulation time duration \u003ci\u003et\u003c/i\u003e given as a vector, these functions will return the response \u003ci\u003ey(t)\u003c/i\u003e that determines the system performance [See MATLAB Documentation for more information].\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e\u0026gt;\u0026gt; clc\r\n\u0026gt;\u0026gt; num = 1; den = [2 1]; t = [0:0.2:1];\r\n\u0026gt;\u0026gt; y = step(num,den,t)\r\n y = \r\n\u003c/pre\u003e\u003cpre\u003e                   0\r\n   0.095162581964040\r\n   0.181269246922018\r\n   0.259181779318282\r\n   0.329679953964361\r\n   0.393469340287367\r\n\u0026gt;\u0026gt; y = impulse(num,den,t)\r\ny =\u003c/pre\u003e\u003cpre\u003e   0.500000000000000\r\n   0.452418709017980\r\n   0.409365376538991\r\n   0.370409110340859\r\n   0.335160023017820\r\n   0.303265329856317\u003c/pre\u003e\u003cp\u003eUnfortunately, these useful toolboox functions are not available here on Cody.\u003c/p\u003e\u003cp\u003eYour task is to write a program that performs the same function for first order control systems. We will consider three important aperiodic test signals: \u003cb\u003e(1.)\u003c/b\u003e Unit impulse \u003cb\u003e(2.)\u003c/b\u003e Unit step \u003cb\u003e(3.)\u003c/b\u003e Unit ramp. This will be specified as an additional parameter to your program. Your program will then return:\u003c/p\u003e\u003cp\u003e\u003cb\u003ey\u003c/b\u003e (t) – the system response during time interval \u003ci\u003et\u003c/i\u003e (exactly the same with MATLAB toolbox for impulse and step)\u003c/p\u003e\u003cp\u003e\u003cb\u003eHINT:\u003c/b\u003e This is a simple problem in classical control involving the application of Laplace Transform and partial fractions.\u003c/p\u003e","function_template":"function y = FirstOrderSystem(num,den,t,signal)\r\n T                           %% time constant\r\n  switch signal\r\n      case 'step'            %% Unit Step Response\r\n          \r\n      case 'ramp'            %% Unit Ramp Response\r\n         \r\n      case 'impulse'         %% Unit Impulse Response\r\n          \r\n  end\r\nend","test_suite":"%% Unit Impulse Response of First Order Systems.\r\n\r\n% Control system 1. tf = 1/(s + 2)\r\n% Took approx. 2 seconds for the impulse response to die out.\r\nnum = 1; den = [1 2]; t = 0:0.2:2; signal = 'impulse';\r\ny_correct = [1  0.6703  0.4493  0.3012  0.2019  0.1353  0.0907  0.0608  0.0408  0.0273  0.0183]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 2. tf = 1/(2*s + 2)\r\n% Took approx. 3 seconds for the impulse response to die out.\r\nnum = 1; den = [2 2]; t = 0:0.2:3; signal = 'impulse';\r\ny_correct = [0.5000  0.4094  0.3352  0.2744  0.2247  0.1839  0.1506  0.1233 0.1009  0.0826  0.0677  0.0554  0.0454  0.0371  0.0304  0.0249]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 3. tf = 3/(2*s + 3)\r\n% Took approx. 3 seconds for the impulse response to die out.\r\nnum = 3; den = [2 3]; t = 0:0.2:3; signal = 'impulse';\r\ny_correct = [1.5000  1.1112  0.8232  0.6099  0.4518  0.3347  0.2479  0.1837  0.1361  0.1008  0.0747  0.0553  0.0410  0.0304  0.0225  0.0167]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 4. tf = 1/(2*s + 1)\r\n% Took approx. 6 seconds for the impulse response to die out.\r\nnum = 1; den = [2 1]; t = 0:0.5:6; signal = 'impulse';\r\ny_correct = [0.5000  0.3894  0.3033  0.2362  0.1839  0.1433  0.1116  0.0869  0.0677  0.0527  0.0410  0.0320  0.0249]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 5. tf = 2/(s + 1)\r\n% Took approx. 5 seconds for the impulse response to die out.\r\nnum = 2; den = [1 1]; t = 0:0.2:5; signal = 'impulse';\r\ny_correct = [2  1.6375  1.3406  1.0976  0.8987  0.7358  0.6024  0.4932 0.4038  0.3306  0.2707  0.2216  0.1814  0.1485  0.1216  0.0996  0.0815  0.0667  0.0546  0.0447  0.0366  0.0300  0.0246  0.0201  0.0165  0.0135]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n\r\n%% Unit Step Response of First Order Systems.\r\n\r\n% Control system 1. tf = 1/(s + 2)\r\n% Took approx. 4 seconds to reach a steady state value of 0.5 i.e. an error 0f 0.5 (Undershoot).\r\nnum = 1; den = [1 2]; t = 0:0.2:4; signal = 'step';\r\ny_correct = [0  0.1648  0.2753  0.3494  0.3991  0.4323  0.4546  0.4696  0.4796  0.4863  0.4908  0.4939  0.4959  0.4972  0.4982  0.4988  0.4992  0.4994  0.4996  0.4997  0.4998]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 2. tf = 1/(2*s + 2)\r\n% Took approx. 5 seconds to reach a steady state value of 0.5 i.e. an error of 0.5 (Undershoot).\r\nnum = 1; den = [2 2]; t = 0:0.2:5; signal = 'step';\r\ny_correct = [0  0.0906  0.1648  0.2256  0.2753  0.3161  0.3494  0.3767  0.3991  0.4174  0.4323  0.4446  0.4546  0.4629  0.4696  0.4751  0.4796  0.4833  0.4863  0.4888  0.4908  0.4925  0.4939  0.4950  0.4959  0.4966]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 3. tf = 3/(2*s + 3)\r\n% Took approx. 3 seconds to reach a steady state value of 1 i.e. an error of 0 (accurate).\r\nnum = 3; den = [2 3]; t = 0:0.2:3; signal = 'step';\r\ny_correct = [0 0.2592  0.4512  0.5934  0.6988  0.7769  0.8347  0.8775  0.9093  0.9328  0.9502  0.9631  0.9727  0.9798  0.9850  0.9889]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 4. tf = 1/(2*s + 1)\r\n% Took approx. 10 seconds to reach a steady state value of 1 i.e. an error of 0 (accurate).\r\nnum = 1; den = [2 1]; t = 0:0.5:10; signal = 'step';\r\ny_correct = [0  0.2212  0.3935  0.5276  0.6321  0.7135  0.7769  0.8262  0.8647  0.8946  0.9179  0.9361  0.9502  0.9612  0.9698  0.9765  0.9817  0.9857  0.9889  0.9913  0.9933]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 5. tf = 2/(s + 1)\r\n% Took approx. 6 seconds to reach a steady state value of 2 i.e. an error of -1 (overshoot).\r\nnum = 2; den = [1 1]; t = 0:0.2:6; signal = 'step';\r\ny_correct = [0  0.3625  0.6594  0.9024  1.1013  1.2642  1.3976  1.5068  1.5962  1.6694  1.7293  1.7784  1.8186  1.8515  1.8784  1.9004  1.9185  1.9333  1.9454  1.9553  1.9634  1.9700  1.9754  1.9799  1.9835  1.9865  1.9890  1.9910  1.9926  1.9939  1.9950]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n%% Unit Ramp Response of First Order Systems.\r\n\r\n% Control system 1. tf = 1/(s + 2)\r\n% The error t - y(t) of this system continuously grows with time.\r\nnum = 1; den = [1 2]; t = 0:0.2:4; signal = 'ramp';\r\ny_correct = [0  0.0176  0.0623  0.1253  0.2005  0.2838  0.3727  0.4652  0.5602  0.6568  0.7546  0.8531  0.9521  1.0514  1.1509  1.2506  1.3504  1.4503  1.5502  1.6501  1.7501]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 2. tf = 1/(2*s + 2)\r\n% The error t - y(t) of this system continuously grows with time.\r\nnum = 1; den = [2 2]; t = 0:0.2:5; signal = 'ramp';\r\ny_correct = [0  0.0094  0.0352  0.0744  0.1247  0.1839  0.2506  0.3233  0.4009  0.4826  0.5677  0.6554  0.7454  0.8371  0.9304  1.0249  1.1204  1.2167  1.3137  1.4112  1.5092  1.6075  1.7061  1.8050  1.9041  2.0034]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 3. tf = 3/(2*s + 3)\r\n% The error t - y(t) of this system reaches a constant value of 0.667 after approx. 3 seconds.\r\nnum = 3; den = [2 3]; t = 0:0.2:3; signal = 'ramp';\r\ny_correct = [0  0.0272  0.0992  0.2044  0.3341  0.4821  0.6435  0.8150  0.9938  1.1781  1.3665  1.5579  1.7515  1.9468  2.1433  2.3407]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 4. tf = 1/(2*s + 1)\r\n% The error t - y(t) of this system reaches a constant value of 2 after approx. 10 seconds.\r\nnum = 1; den = [2 1]; t = 0:0.5:10; signal = 'ramp';\r\ny_correct = [0  0.0576  0.2131  0.4447  0.7358  1.0730  1.4463  1.8475  2.2707  2.7108  3.1642  3.6279  4.0996  4.5775  5.0604  5.5470  6.0366  6.5285  7.0222  7.5173  8.0135]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 5. tf = 2/(s + 1)\r\n% The error t - y(t) of this system will initially undershoot, then eventually overshoot.\r\nnum = 2; den = [1 1]; t = 0:0.2:4; signal = 'ramp';\r\ny_correct = [0  0.0375  0.1406  0.2976  0.4987  0.7358  1.0024  1.2932  1.6038  1.9306  2.2707  2.6216  2.9814  3.3485  3.7216  4.0996  4.4815  4.8667  5.2546  5.6447  6.0366]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":178544,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":4,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-07-31T18:07:45.000Z","updated_at":"2018-07-31T19:36:27.000Z","published_at":"2018-07-31T18:17:09.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 practice, the input signal to an automatic control system is not known ahead of time but usually random in nature. Thus, in the analysis and design of control systems, engineers usually employ test input signals as the basis for comparison of system performance.\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\u003eMATLAB Control System Toolbox contain the functions\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003estep\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eimpulse\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e which allows the simulation of the response of a control system to these test signals. Given the numerator and denominator of a system transfer function and simulation time duration\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003et\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e given as a vector, these functions will return the response\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ey(t)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e that determines the system performance [See MATLAB Documentation for more information].\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 clc\\n\u003e\u003e num = 1; den = [2 1]; t = [0:0.2:1];\\n\u003e\u003e y = step(num,den,t)\\n y = \\n\\n                   0\\n   0.095162581964040\\n   0.181269246922018\\n   0.259181779318282\\n   0.329679953964361\\n   0.393469340287367\\n\u003e\u003e y = impulse(num,den,t)\\ny =\\n\\n   0.500000000000000\\n   0.452418709017980\\n   0.409365376538991\\n   0.370409110340859\\n   0.335160023017820\\n   0.303265329856317]]\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\u003eUnfortunately, these useful toolboox functions are not available here on Cody.\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\u003eYour task is to write a program that performs the same function for first order control systems. We will consider three important aperiodic test signals:\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\u003e(1.)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Unit impulse\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\u003e(2.)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Unit step\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\u003e(3.)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Unit ramp. This will be specified as an additional parameter to your program. Your program will then return:\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (t) – the system response during time interval\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003et\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (exactly the same with MATLAB toolbox for impulse and step)\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHINT:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e This is a simple problem in classical control involving the application of Laplace Transform and partial fractions.\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":44703,"title":"Response of First Order Control Systems","description":"In practice, the input signal to an automatic control system is not known ahead of time but usually random in nature. Thus, in the analysis and design of control systems, engineers usually employ test input signals as the basis for comparison of system performance.\r\n\r\nMATLAB Control System Toolbox contain the functions _step_ and _impulse_ which allows the simulation of the response of a control system to these test signals. Given the numerator and denominator of a system transfer function and simulation time duration _t_ given as a vector, these functions will return the response _y(t)_ that determines the system performance [See MATLAB Documentation for more information].\r\n\r\n  \u003e\u003e clc\r\n  \u003e\u003e num = 1; den = [2 1]; t = [0:0.2:1];\r\n  \u003e\u003e y = step(num,den,t)\r\n   y = \r\n\r\n                   0\r\n   0.095162581964040\r\n   0.181269246922018\r\n   0.259181779318282\r\n   0.329679953964361\r\n   0.393469340287367\r\n\u003e\u003e y = impulse(num,den,t)\r\ny =\r\n\r\n   0.500000000000000\r\n   0.452418709017980\r\n   0.409365376538991\r\n   0.370409110340859\r\n   0.335160023017820\r\n   0.303265329856317\r\n\r\n\r\nUnfortunately, these useful toolboox functions are not available here on Cody.\r\n\r\n\r\nYour task is to write a program that performs the same function for first order control systems. We will consider three important aperiodic test signals: *(1.)* Unit impulse *(2.)* Unit step *(3.)* Unit ramp. This will be specified as an additional parameter to your program. Your program will then return:\r\n\r\n*y* (t) – the system response during time interval _t_ (exactly the same with MATLAB toolbox for impulse and step)\r\n\r\n\r\n*HINT:* This is a simple problem in classical control involving the application of Laplace Transform and partial fractions.","description_html":"\u003cp\u003eIn practice, the input signal to an automatic control system is not known ahead of time but usually random in nature. Thus, in the analysis and design of control systems, engineers usually employ test input signals as the basis for comparison of system performance.\u003c/p\u003e\u003cp\u003eMATLAB Control System Toolbox contain the functions \u003ci\u003estep\u003c/i\u003e and \u003ci\u003eimpulse\u003c/i\u003e which allows the simulation of the response of a control system to these test signals. Given the numerator and denominator of a system transfer function and simulation time duration \u003ci\u003et\u003c/i\u003e given as a vector, these functions will return the response \u003ci\u003ey(t)\u003c/i\u003e that determines the system performance [See MATLAB Documentation for more information].\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e\u0026gt;\u0026gt; clc\r\n\u0026gt;\u0026gt; num = 1; den = [2 1]; t = [0:0.2:1];\r\n\u0026gt;\u0026gt; y = step(num,den,t)\r\n y = \r\n\u003c/pre\u003e\u003cpre\u003e                   0\r\n   0.095162581964040\r\n   0.181269246922018\r\n   0.259181779318282\r\n   0.329679953964361\r\n   0.393469340287367\r\n\u0026gt;\u0026gt; y = impulse(num,den,t)\r\ny =\u003c/pre\u003e\u003cpre\u003e   0.500000000000000\r\n   0.452418709017980\r\n   0.409365376538991\r\n   0.370409110340859\r\n   0.335160023017820\r\n   0.303265329856317\u003c/pre\u003e\u003cp\u003eUnfortunately, these useful toolboox functions are not available here on Cody.\u003c/p\u003e\u003cp\u003eYour task is to write a program that performs the same function for first order control systems. We will consider three important aperiodic test signals: \u003cb\u003e(1.)\u003c/b\u003e Unit impulse \u003cb\u003e(2.)\u003c/b\u003e Unit step \u003cb\u003e(3.)\u003c/b\u003e Unit ramp. This will be specified as an additional parameter to your program. Your program will then return:\u003c/p\u003e\u003cp\u003e\u003cb\u003ey\u003c/b\u003e (t) – the system response during time interval \u003ci\u003et\u003c/i\u003e (exactly the same with MATLAB toolbox for impulse and step)\u003c/p\u003e\u003cp\u003e\u003cb\u003eHINT:\u003c/b\u003e This is a simple problem in classical control involving the application of Laplace Transform and partial fractions.\u003c/p\u003e","function_template":"function y = FirstOrderSystem(num,den,t,signal)\r\n T                           %% time constant\r\n  switch signal\r\n      case 'step'            %% Unit Step Response\r\n          \r\n      case 'ramp'            %% Unit Ramp Response\r\n         \r\n      case 'impulse'         %% Unit Impulse Response\r\n          \r\n  end\r\nend","test_suite":"%% Unit Impulse Response of First Order Systems.\r\n\r\n% Control system 1. tf = 1/(s + 2)\r\n% Took approx. 2 seconds for the impulse response to die out.\r\nnum = 1; den = [1 2]; t = 0:0.2:2; signal = 'impulse';\r\ny_correct = [1  0.6703  0.4493  0.3012  0.2019  0.1353  0.0907  0.0608  0.0408  0.0273  0.0183]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 2. tf = 1/(2*s + 2)\r\n% Took approx. 3 seconds for the impulse response to die out.\r\nnum = 1; den = [2 2]; t = 0:0.2:3; signal = 'impulse';\r\ny_correct = [0.5000  0.4094  0.3352  0.2744  0.2247  0.1839  0.1506  0.1233 0.1009  0.0826  0.0677  0.0554  0.0454  0.0371  0.0304  0.0249]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 3. tf = 3/(2*s + 3)\r\n% Took approx. 3 seconds for the impulse response to die out.\r\nnum = 3; den = [2 3]; t = 0:0.2:3; signal = 'impulse';\r\ny_correct = [1.5000  1.1112  0.8232  0.6099  0.4518  0.3347  0.2479  0.1837  0.1361  0.1008  0.0747  0.0553  0.0410  0.0304  0.0225  0.0167]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 4. tf = 1/(2*s + 1)\r\n% Took approx. 6 seconds for the impulse response to die out.\r\nnum = 1; den = [2 1]; t = 0:0.5:6; signal = 'impulse';\r\ny_correct = [0.5000  0.3894  0.3033  0.2362  0.1839  0.1433  0.1116  0.0869  0.0677  0.0527  0.0410  0.0320  0.0249]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 5. tf = 2/(s + 1)\r\n% Took approx. 5 seconds for the impulse response to die out.\r\nnum = 2; den = [1 1]; t = 0:0.2:5; signal = 'impulse';\r\ny_correct = [2  1.6375  1.3406  1.0976  0.8987  0.7358  0.6024  0.4932 0.4038  0.3306  0.2707  0.2216  0.1814  0.1485  0.1216  0.0996  0.0815  0.0667  0.0546  0.0447  0.0366  0.0300  0.0246  0.0201  0.0165  0.0135]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n\r\n%% Unit Step Response of First Order Systems.\r\n\r\n% Control system 1. tf = 1/(s + 2)\r\n% Took approx. 4 seconds to reach a steady state value of 0.5 i.e. an error 0f 0.5 (Undershoot).\r\nnum = 1; den = [1 2]; t = 0:0.2:4; signal = 'step';\r\ny_correct = [0  0.1648  0.2753  0.3494  0.3991  0.4323  0.4546  0.4696  0.4796  0.4863  0.4908  0.4939  0.4959  0.4972  0.4982  0.4988  0.4992  0.4994  0.4996  0.4997  0.4998]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 2. tf = 1/(2*s + 2)\r\n% Took approx. 5 seconds to reach a steady state value of 0.5 i.e. an error of 0.5 (Undershoot).\r\nnum = 1; den = [2 2]; t = 0:0.2:5; signal = 'step';\r\ny_correct = [0  0.0906  0.1648  0.2256  0.2753  0.3161  0.3494  0.3767  0.3991  0.4174  0.4323  0.4446  0.4546  0.4629  0.4696  0.4751  0.4796  0.4833  0.4863  0.4888  0.4908  0.4925  0.4939  0.4950  0.4959  0.4966]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 3. tf = 3/(2*s + 3)\r\n% Took approx. 3 seconds to reach a steady state value of 1 i.e. an error of 0 (accurate).\r\nnum = 3; den = [2 3]; t = 0:0.2:3; signal = 'step';\r\ny_correct = [0 0.2592  0.4512  0.5934  0.6988  0.7769  0.8347  0.8775  0.9093  0.9328  0.9502  0.9631  0.9727  0.9798  0.9850  0.9889]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 4. tf = 1/(2*s + 1)\r\n% Took approx. 10 seconds to reach a steady state value of 1 i.e. an error of 0 (accurate).\r\nnum = 1; den = [2 1]; t = 0:0.5:10; signal = 'step';\r\ny_correct = [0  0.2212  0.3935  0.5276  0.6321  0.7135  0.7769  0.8262  0.8647  0.8946  0.9179  0.9361  0.9502  0.9612  0.9698  0.9765  0.9817  0.9857  0.9889  0.9913  0.9933]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 5. tf = 2/(s + 1)\r\n% Took approx. 6 seconds to reach a steady state value of 2 i.e. an error of -1 (overshoot).\r\nnum = 2; den = [1 1]; t = 0:0.2:6; signal = 'step';\r\ny_correct = [0  0.3625  0.6594  0.9024  1.1013  1.2642  1.3976  1.5068  1.5962  1.6694  1.7293  1.7784  1.8186  1.8515  1.8784  1.9004  1.9185  1.9333  1.9454  1.9553  1.9634  1.9700  1.9754  1.9799  1.9835  1.9865  1.9890  1.9910  1.9926  1.9939  1.9950]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n%% Unit Ramp Response of First Order Systems.\r\n\r\n% Control system 1. tf = 1/(s + 2)\r\n% The error t - y(t) of this system continuously grows with time.\r\nnum = 1; den = [1 2]; t = 0:0.2:4; signal = 'ramp';\r\ny_correct = [0  0.0176  0.0623  0.1253  0.2005  0.2838  0.3727  0.4652  0.5602  0.6568  0.7546  0.8531  0.9521  1.0514  1.1509  1.2506  1.3504  1.4503  1.5502  1.6501  1.7501]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 2. tf = 1/(2*s + 2)\r\n% The error t - y(t) of this system continuously grows with time.\r\nnum = 1; den = [2 2]; t = 0:0.2:5; signal = 'ramp';\r\ny_correct = [0  0.0094  0.0352  0.0744  0.1247  0.1839  0.2506  0.3233  0.4009  0.4826  0.5677  0.6554  0.7454  0.8371  0.9304  1.0249  1.1204  1.2167  1.3137  1.4112  1.5092  1.6075  1.7061  1.8050  1.9041  2.0034]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 3. tf = 3/(2*s + 3)\r\n% The error t - y(t) of this system reaches a constant value of 0.667 after approx. 3 seconds.\r\nnum = 3; den = [2 3]; t = 0:0.2:3; signal = 'ramp';\r\ny_correct = [0  0.0272  0.0992  0.2044  0.3341  0.4821  0.6435  0.8150  0.9938  1.1781  1.3665  1.5579  1.7515  1.9468  2.1433  2.3407]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 4. tf = 1/(2*s + 1)\r\n% The error t - y(t) of this system reaches a constant value of 2 after approx. 10 seconds.\r\nnum = 1; den = [2 1]; t = 0:0.5:10; signal = 'ramp';\r\ny_correct = [0  0.0576  0.2131  0.4447  0.7358  1.0730  1.4463  1.8475  2.2707  2.7108  3.1642  3.6279  4.0996  4.5775  5.0604  5.5470  6.0366  6.5285  7.0222  7.5173  8.0135]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n% Control system 5. tf = 2/(s + 1)\r\n% The error t - y(t) of this system will initially undershoot, then eventually overshoot.\r\nnum = 2; den = [1 1]; t = 0:0.2:4; signal = 'ramp';\r\ny_correct = [0  0.0375  0.1406  0.2976  0.4987  0.7358  1.0024  1.2932  1.6038  1.9306  2.2707  2.6216  2.9814  3.3485  3.7216  4.0996  4.4815  4.8667  5.2546  5.6447  6.0366]';\r\ny = FirstOrderSystem(num,den,t',signal);\r\nassert(norm(round(y,4) - y_correct)\u003c100*eps)\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":178544,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":4,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2018-07-31T18:07:45.000Z","updated_at":"2018-07-31T19:36:27.000Z","published_at":"2018-07-31T18:17:09.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 practice, the input signal to an automatic control system is not known ahead of time but usually random in nature. Thus, in the analysis and design of control systems, engineers usually employ test input signals as the basis for comparison of system performance.\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\u003eMATLAB Control System Toolbox contain the functions\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003estep\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eimpulse\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e which allows the simulation of the response of a control system to these test signals. Given the numerator and denominator of a system transfer function and simulation time duration\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003et\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e given as a vector, these functions will return the response\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ey(t)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e that determines the system performance [See MATLAB Documentation for more information].\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 clc\\n\u003e\u003e num = 1; den = [2 1]; t = [0:0.2:1];\\n\u003e\u003e y = step(num,den,t)\\n y = \\n\\n                   0\\n   0.095162581964040\\n   0.181269246922018\\n   0.259181779318282\\n   0.329679953964361\\n   0.393469340287367\\n\u003e\u003e y = impulse(num,den,t)\\ny =\\n\\n   0.500000000000000\\n   0.452418709017980\\n   0.409365376538991\\n   0.370409110340859\\n   0.335160023017820\\n   0.303265329856317]]\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\u003eUnfortunately, these useful toolboox functions are not available here on Cody.\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\u003eYour task is to write a program that performs the same function for first order control systems. We will consider three important aperiodic test signals:\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\u003e(1.)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Unit impulse\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\u003e(2.)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Unit step\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\u003e(3.)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Unit ramp. This will be specified as an additional parameter to your program. Your program will then return:\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ey\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (t) – the system response during time interval\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003et\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e (exactly the same with MATLAB toolbox for impulse and step)\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eHINT:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e This is a simple problem in classical control involving the application of Laplace Transform and partial fractions.\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:\"classical control\"","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:\"classical control\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"classical control\"","","\"","classical control","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f6cb1fc74f0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f6cb1fc7450\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f6cb1fc6910\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f6cb1fc79f0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f6cb1fc7950\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f6cb1fc7770\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f6cb1fc76d0\u003e":"tag:\"classical control\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f6cb1fc76d0\u003e":"tag:\"classical control\""},"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":"cody-search","password":"78X075ddcV44","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:\"classical control\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"classical control\"","","\"","classical control","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f6cb1fc74f0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f6cb1fc7450\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f6cb1fc6910\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f6cb1fc79f0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f6cb1fc7950\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f6cb1fc7770\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f6cb1fc76d0\u003e":"tag:\"classical control\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f6cb1fc76d0\u003e":"tag:\"classical control\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":44703,"difficulty_rating":"medium"}]}}