Instructions 1. The next sheet is an example problem from the text. Select the cells at the top of the columns to see the formulas and format. 2. Columns A,B, and C are the input data. Note that the upper boundary is used. Columns D and E are used to calculate the average and sample standard deviation. Column F calculates the z value using the upper boundary (Column B), the average, and the sample standard deviation. Column G is the area (cumulative probability) under the normal curve to the left of the z value in the same manner as Table A. Column H is the area [probability] for each cell. Note that the formula for Row 3 is different than the rest of the rows. Column I is the expected frequency for each cell. It equals the value in Column H times the total number of observed values (110). Column J is the chi-squared value which can be compared to a chi-squared table to determine the observed values (110). This column is really not necessary because the program calculates the observed values (110) and performs the chi-squared test at I21 and K21. Column K is an adjustment to bring the total number of observed values to 110. The chi-squared test for the adjustment gives a probability of 0.971that the distribution is normal. 3. The following sheet, called template, should be copied before using the program. This activity is accomplished by selecting EDIT, selecting MOVE OR COPY SHEET, selecting CREATE A COPY, and locating the new sheet, called template (2), in the dialog box. 4. The template is designed for 9 cells. If more or less cells are required, the appropriate changes must be made.

Instructions 1. The next sheet is an example problem from the text. Select the cells at the top of the columns to see the formulas and format. 2. Columns A,B, and C are the input data. Note that the upper boundary is used. Columns D and E are used to calculate the average and sample standard deviation. Column F calculates the z value using the upper boundary (Column B), the average, and the sample standard deviation. Column G is the area (cumulative probability) under the normal curve to the left of the z value in the same manner as Table A. Column H is the area [probability] for each cell. Note that the formula for Row 3 is different than the rest of the rows. Column I is the expected frequency for each cell. It equals the value in Column H times the total number of observed values (110). Column J is the chi-squared value which can be compared to a chi-squared table to determine the observed values (110). This column is really not necessary because the program calculates the observed values (110) and performs the chi-squared test at I21 and K21. Column K is an adjustment to bring the total number of observed values to 110. The chi-squared test for the adjustment gives a probability of 0.971that the distribution is normal. 3. The following sheet, called template, should be copied before using the program. This activity is accomplished by selecting EDIT, selecting MOVE OR COPY SHEET, selecting CREATE A COPY, and locating the new sheet, called template (2), in the dialog box. 4. The template is designed for 9 cells. If more or less cells are required, the appropriate changes must be made.

info@checkyourstudy.com
Homework Assignment 7. Due March 19 1. Consider the differential equation: ?? ?? = − 1 2 ? sin? ? with initial condition given by ?(0) = 1 Solve this equation from t = 0 to t = 8π using the following methods: (a) Solve analytically by separating variables and integrating. (b) Solve using the 4th-order Runge-Kutta method (write your own code for this, do not use the MATLAB provided ODE solvers) for the following two step sizes: I. Maximum step size for stability (don’t try and do this analytically – try out your code for different step sizes to find the stability limit). II. Maximum step size for a time-accurate solution. “Good” accuracy can be defined in several ways, but use the definition that the numerical solution remains within 2% of the true solution a t = nπ. (c) Solve using the MATLAB function ode45. 2. A car and its suspension system traveling over a bumpy road can be modeled as a mass/spring/damper system. In this model, ?? is the vertical motion of the wheel center of mass, ?? is the vertical motion of the car chassis, and ?? represents the displacement of the bottom of the tire due to the variation in the road surface. Applying Newton’s law to the two masses yields a system of second-order equations: ???̈? + ??(?̇? − ?̇?) + ??(?? − ??) + ???? = ???? ???̈? − ??(?̇? − ?̇?) − ??(?? − ??) + ???? = 0 (a) Convert the two second-order ODE’s into a system of 4 first-order ODE’s. Write them in standard “state-space” form. (b) Assume the car hits a large pothole at t = 0 so that ??(?) = ?−0.2 m 0 ≤ ? < 0.2 s 0 ? > 0.2 s Create a MATLAB function that returns the right hand sides of the state-space equations for an input t and an input state vector. (c) Solve the system on the time interval [0 60] seconds using the MATLAB function ode45. Find the displacement and velocity of the chassis and the wheel as a function of time. Use the following data: ?? = 100 kg, ?? = 1900 kg, ?? = 145 N/m, ?? = 25 N/m, ?? = 150 N-s/m 3. Write a MATLAB program to simulate the dynamics of a helicopter lifting a survivor. When lifting the survivor into the helicopter with a constant speed winch, the resulting dynamics are non-linear, and stability is dependent upon the winch speed. Using polar coordinates, we can find the equations of motion to be: −?? sin ? = ????̈ + 2?̇?̇? ?̇ = constant (negative) Notice that the mass of the survivor factors out and thus the solution is independent of the mass of the person being lifted. In these equations, r is the instantaneous length of the winch cable, g, is the gravitational constant, and θ is the angle of the swing. You may choose to use either your Runge-Kutta solver from problem 1 or ode45 to integrate the equations of motion. This problem is of particular interest to the survivor since an unstable condition can cause the angle of the swing to exceed 90⁰, essentially placing him/her in danger of being beheaded by the rotor blades of the rescue helicopter. Also, it is desirable to retrieve the survivor as fast as possible to get away from the danger. Use your program to determine the maximum winch speed for which the survivor will not swing above the helicopter attach point for a lift from the initial conditions: ?? = 0.1 ??? ?? ̇ = 0 ?? = 34 ? And ending when ? = 0.5 ?. The maximum lifting speed of the winch is 5 m/s. Present your results for the above problems in an appropriate fashion. For problem 1, be sure to include a comparison of the numerical methods with each other and with the true solution. Be sure to discuss your findings with respect to the notions of stability and accuracy of the numerical methods. For problem 2, ensure that your results are easily interpreted by a reader. Students receiving a score of 70% or above on these two problems will receive credit for outcome #5. For problem 3, if you receive at least 70% of the points, you will receive credit for outcome #4.

Homework Assignment 7. Due March 19 1. Consider the differential equation: ?? ?? = − 1 2 ? sin? ? with initial condition given by ?(0) = 1 Solve this equation from t = 0 to t = 8π using the following methods: (a) Solve analytically by separating variables and integrating. (b) Solve using the 4th-order Runge-Kutta method (write your own code for this, do not use the MATLAB provided ODE solvers) for the following two step sizes: I. Maximum step size for stability (don’t try and do this analytically – try out your code for different step sizes to find the stability limit). II. Maximum step size for a time-accurate solution. “Good” accuracy can be defined in several ways, but use the definition that the numerical solution remains within 2% of the true solution a t = nπ. (c) Solve using the MATLAB function ode45. 2. A car and its suspension system traveling over a bumpy road can be modeled as a mass/spring/damper system. In this model, ?? is the vertical motion of the wheel center of mass, ?? is the vertical motion of the car chassis, and ?? represents the displacement of the bottom of the tire due to the variation in the road surface. Applying Newton’s law to the two masses yields a system of second-order equations: ???̈? + ??(?̇? − ?̇?) + ??(?? − ??) + ???? = ???? ???̈? − ??(?̇? − ?̇?) − ??(?? − ??) + ???? = 0 (a) Convert the two second-order ODE’s into a system of 4 first-order ODE’s. Write them in standard “state-space” form. (b) Assume the car hits a large pothole at t = 0 so that ??(?) = ?−0.2 m 0 ≤ ? < 0.2 s 0 ? > 0.2 s Create a MATLAB function that returns the right hand sides of the state-space equations for an input t and an input state vector. (c) Solve the system on the time interval [0 60] seconds using the MATLAB function ode45. Find the displacement and velocity of the chassis and the wheel as a function of time. Use the following data: ?? = 100 kg, ?? = 1900 kg, ?? = 145 N/m, ?? = 25 N/m, ?? = 150 N-s/m 3. Write a MATLAB program to simulate the dynamics of a helicopter lifting a survivor. When lifting the survivor into the helicopter with a constant speed winch, the resulting dynamics are non-linear, and stability is dependent upon the winch speed. Using polar coordinates, we can find the equations of motion to be: −?? sin ? = ????̈ + 2?̇?̇? ?̇ = constant (negative) Notice that the mass of the survivor factors out and thus the solution is independent of the mass of the person being lifted. In these equations, r is the instantaneous length of the winch cable, g, is the gravitational constant, and θ is the angle of the swing. You may choose to use either your Runge-Kutta solver from problem 1 or ode45 to integrate the equations of motion. This problem is of particular interest to the survivor since an unstable condition can cause the angle of the swing to exceed 90⁰, essentially placing him/her in danger of being beheaded by the rotor blades of the rescue helicopter. Also, it is desirable to retrieve the survivor as fast as possible to get away from the danger. Use your program to determine the maximum winch speed for which the survivor will not swing above the helicopter attach point for a lift from the initial conditions: ?? = 0.1 ??? ?? ̇ = 0 ?? = 34 ? And ending when ? = 0.5 ?. The maximum lifting speed of the winch is 5 m/s. Present your results for the above problems in an appropriate fashion. For problem 1, be sure to include a comparison of the numerical methods with each other and with the true solution. Be sure to discuss your findings with respect to the notions of stability and accuracy of the numerical methods. For problem 2, ensure that your results are easily interpreted by a reader. Students receiving a score of 70% or above on these two problems will receive credit for outcome #5. For problem 3, if you receive at least 70% of the points, you will receive credit for outcome #4.

No expert has answered this question yet. You can browse … Read More...
1 IN2009: Language Processors Coursework Part 3: The Interpreter Introduction This is the 3rd and final part of the coursework. In the second part of the coursework you created a parser for the Moopl grammar which, given a syntactically correct Moopl program as input, builds an AST representation of the program. In Part 3 you will develop an interpreter which executes Moopl programs by visiting their AST representations. For this part of the coursework we provide functional code (with limitations, see below) for parsing, building a symbol table, type checking and variable allocation. Marks This part of the coursework is worth 12 of the 30 coursework marks for the Language Processors module. This part of the coursework is marked out of 12. Submission deadline This part of the coursework should be handed in before 5pm on Sunday 9th April 2017. In line with school policy, late submissions will be awarded no marks. Return & Feedback Marks and feedback will be available as soon as possible, certainly on or before Wed 3rd May 2017. Plagiarism If you copy the work of others (either that of fellow students or of a third party), with or without their permission, you will score no marks and further disciplinary action will be taken against you. Group working You will be working in the same groups as for the previous parts of the coursework except where group changes have already been approved. Submission: Submit a zip archive (not a rar file) of all your source code (the src folder of your project). We do not want the other parts of your NetBeans project, only the source code. Note 1: Submissions which do not compile will get zero marks. Note 2: You must not change the names or types of any of the existing packages, classes or public methods. 2 Getting started Download either moopl-interp.zip or moopl-interp.tgz from Moodle and extract all files. Key contents to be aware of: • A fully implemented Moopl parser (also implements a parser for the interpreter command language; see below). • A partially implemented Moopl type checker. • Test harnesses for the type checker and interpreter. • A directory of a few example Moopl programs (see Testing below). • Folder interp containing prototype interpreter code. The type-checker is only partially implemented but a more complete implementation will be provided following Session 6. That version is still not fully complete because it doesn’t support inheritance. Part d) below asks you to remove this restriction. The VarAllocator visitor in the interp package uses a simple implementation which only works for methods in which all parameter and local variable names are different. Part e) below asks you to remove this restriction. The three parts below should be attempted in sequence. When you have completed one part you should make a back-up copy of the work and keep it safe, in case you break it in your attempt at the next part. Be sure to test old functionality as well as new (regression testing). We will not assess multiple versions so, if your attempt at part d) or e) breaks previously working code, you may gain a better mark by submitting the earlier version for assessment. c) [8 marks] The Basic Interpreter: complete the implementation of the Interpreter visitor in the interp package. d) [2 marks] Inheritance: extend the type-checker, variable allocator and interpreter to support inheritance. e) [2 marks] Variable Allocation: extend the variable allocator to fully support blockstructure and lexical scoping, removing the requirement that all parameter and local variable names are different. Aim to minimise the number of local variable slots allocated in a stack frame. Note: variable and parameter names declared at the same scope level are still required to be different from each other (a method cannot have two different parameters called x, for example) and this is enforced by the existing typechecking code. But variables declared in different blocks (even when nested) can have the same name. Exceptions Your interpreter will only ever be run on Moopl code which is type-correct (and free from uninitialised local variables). But it is still possible that the Moopl code contains logical errors which may cause runtime errors (such as null-reference or array-bound errors). Your interpreter should throw a MooplRunTimeException with an appropriate error message in these cases. The only kind of exception your interpreter should ever throw is a MooplRunTimeException. 3 Testing The examples folder does not contain a comprehensive test-suite. You need to invent and run your own tests. The document Moopl compared with Java gives a concise summary of how Moopl programs are supposed to behave. You can (and should) also compare the behaviour of your interpreter with that of the online tool: https://smcse.city.ac.uk/student/sj353/langproc/Moopl.html (Note: the online tool checks for uninitialised local variables. Your implementation is not expected to do this.) To test your work, run the top-level Interpret harness, providing the name of a Moopl source file as a command-line argument. When run on a type-correct Moopl source file, Interpret will pretty-print the Moopl program then display a command prompt (>) at which you can enter one of the following commands: :quit This will quit the interpreter. :call main() This will call the top-level proc main, interpreted in the context defined by the Moopl program. (Any top-level proc can be called this way). :eval Exp ; This will evaluate expression Exp, interpreted in the context defined by the Moopl program, and print the result. Note the required terminating semi-colon. Testing your Expression visitors To unit-test your Exp visit methods, run the top-level Interpret harness on a complete Moopl program (though it can be trivial) and use the :eval command. For example, to test your visit methods for the Boolean-literals (ExpTrue and ExpFalse), you would enter the commands > :eval true ; > :eval false ; which should output 1 and 0, respectively. For the most basic cases, the Moopl program is essentially irrelevant (a single top-level proc with empty body may be sufficient). For other cases you will need to write programs containing class definitions (in order, for example, to test object creation and method call). Testing your Statement visitors To unit-test your Stm visit methods, write very simple Moopl programs, each with a top-level proc main() containing just a few lines of code. Run the top-level Interpret harness on these simple programs and enter the command > :call main() You will find a few examples to get you started in the folder examples/unittests. As for the Exp tests, simple cases can be tested using Moopl programs with just a main proc but for the more complex tests you will need to write Moopl programs containing class definitions. 4 Grading criteria Solutions will be graded according to their functional correctness, and the elegance of their implementation. Below are criteria that guide the award of marks. 70 – 100 [1st class] Work that meets all the requirements in full, constructed and presented to a professional standard. Showing evidence of independent reading, thinking and analysis. 60 – 69 [2:1] Work that makes a good attempt to address the requirements, realising all to some extent and most well. Well-structured and well presented. 50 – 59 [2:2] Work that attempts to address requirements realising all to some extent and some well but perhaps also including irrelevant or underdeveloped material. Structure and presentation may not always be clear. 40 – 49 [3rd class] Work that attempts to address the requirements but only realises them to some extent and may not include important elements or be completely accurate. Structure and presentation may lack clarity. 0 – 39 [fail] Unsatisfactory work that does not adequately address the requirements. Structure and presentation may be confused or incoherent.

1 IN2009: Language Processors Coursework Part 3: The Interpreter Introduction This is the 3rd and final part of the coursework. In the second part of the coursework you created a parser for the Moopl grammar which, given a syntactically correct Moopl program as input, builds an AST representation of the program. In Part 3 you will develop an interpreter which executes Moopl programs by visiting their AST representations. For this part of the coursework we provide functional code (with limitations, see below) for parsing, building a symbol table, type checking and variable allocation. Marks This part of the coursework is worth 12 of the 30 coursework marks for the Language Processors module. This part of the coursework is marked out of 12. Submission deadline This part of the coursework should be handed in before 5pm on Sunday 9th April 2017. In line with school policy, late submissions will be awarded no marks. Return & Feedback Marks and feedback will be available as soon as possible, certainly on or before Wed 3rd May 2017. Plagiarism If you copy the work of others (either that of fellow students or of a third party), with or without their permission, you will score no marks and further disciplinary action will be taken against you. Group working You will be working in the same groups as for the previous parts of the coursework except where group changes have already been approved. Submission: Submit a zip archive (not a rar file) of all your source code (the src folder of your project). We do not want the other parts of your NetBeans project, only the source code. Note 1: Submissions which do not compile will get zero marks. Note 2: You must not change the names or types of any of the existing packages, classes or public methods. 2 Getting started Download either moopl-interp.zip or moopl-interp.tgz from Moodle and extract all files. Key contents to be aware of: • A fully implemented Moopl parser (also implements a parser for the interpreter command language; see below). • A partially implemented Moopl type checker. • Test harnesses for the type checker and interpreter. • A directory of a few example Moopl programs (see Testing below). • Folder interp containing prototype interpreter code. The type-checker is only partially implemented but a more complete implementation will be provided following Session 6. That version is still not fully complete because it doesn’t support inheritance. Part d) below asks you to remove this restriction. The VarAllocator visitor in the interp package uses a simple implementation which only works for methods in which all parameter and local variable names are different. Part e) below asks you to remove this restriction. The three parts below should be attempted in sequence. When you have completed one part you should make a back-up copy of the work and keep it safe, in case you break it in your attempt at the next part. Be sure to test old functionality as well as new (regression testing). We will not assess multiple versions so, if your attempt at part d) or e) breaks previously working code, you may gain a better mark by submitting the earlier version for assessment. c) [8 marks] The Basic Interpreter: complete the implementation of the Interpreter visitor in the interp package. d) [2 marks] Inheritance: extend the type-checker, variable allocator and interpreter to support inheritance. e) [2 marks] Variable Allocation: extend the variable allocator to fully support blockstructure and lexical scoping, removing the requirement that all parameter and local variable names are different. Aim to minimise the number of local variable slots allocated in a stack frame. Note: variable and parameter names declared at the same scope level are still required to be different from each other (a method cannot have two different parameters called x, for example) and this is enforced by the existing typechecking code. But variables declared in different blocks (even when nested) can have the same name. Exceptions Your interpreter will only ever be run on Moopl code which is type-correct (and free from uninitialised local variables). But it is still possible that the Moopl code contains logical errors which may cause runtime errors (such as null-reference or array-bound errors). Your interpreter should throw a MooplRunTimeException with an appropriate error message in these cases. The only kind of exception your interpreter should ever throw is a MooplRunTimeException. 3 Testing The examples folder does not contain a comprehensive test-suite. You need to invent and run your own tests. The document Moopl compared with Java gives a concise summary of how Moopl programs are supposed to behave. You can (and should) also compare the behaviour of your interpreter with that of the online tool: https://smcse.city.ac.uk/student/sj353/langproc/Moopl.html (Note: the online tool checks for uninitialised local variables. Your implementation is not expected to do this.) To test your work, run the top-level Interpret harness, providing the name of a Moopl source file as a command-line argument. When run on a type-correct Moopl source file, Interpret will pretty-print the Moopl program then display a command prompt (>) at which you can enter one of the following commands: :quit This will quit the interpreter. :call main() This will call the top-level proc main, interpreted in the context defined by the Moopl program. (Any top-level proc can be called this way). :eval Exp ; This will evaluate expression Exp, interpreted in the context defined by the Moopl program, and print the result. Note the required terminating semi-colon. Testing your Expression visitors To unit-test your Exp visit methods, run the top-level Interpret harness on a complete Moopl program (though it can be trivial) and use the :eval command. For example, to test your visit methods for the Boolean-literals (ExpTrue and ExpFalse), you would enter the commands > :eval true ; > :eval false ; which should output 1 and 0, respectively. For the most basic cases, the Moopl program is essentially irrelevant (a single top-level proc with empty body may be sufficient). For other cases you will need to write programs containing class definitions (in order, for example, to test object creation and method call). Testing your Statement visitors To unit-test your Stm visit methods, write very simple Moopl programs, each with a top-level proc main() containing just a few lines of code. Run the top-level Interpret harness on these simple programs and enter the command > :call main() You will find a few examples to get you started in the folder examples/unittests. As for the Exp tests, simple cases can be tested using Moopl programs with just a main proc but for the more complex tests you will need to write Moopl programs containing class definitions. 4 Grading criteria Solutions will be graded according to their functional correctness, and the elegance of their implementation. Below are criteria that guide the award of marks. 70 – 100 [1st class] Work that meets all the requirements in full, constructed and presented to a professional standard. Showing evidence of independent reading, thinking and analysis. 60 – 69 [2:1] Work that makes a good attempt to address the requirements, realising all to some extent and most well. Well-structured and well presented. 50 – 59 [2:2] Work that attempts to address requirements realising all to some extent and some well but perhaps also including irrelevant or underdeveloped material. Structure and presentation may not always be clear. 40 – 49 [3rd class] Work that attempts to address the requirements but only realises them to some extent and may not include important elements or be completely accurate. Structure and presentation may lack clarity. 0 – 39 [fail] Unsatisfactory work that does not adequately address the requirements. Structure and presentation may be confused or incoherent.

checkyourstudy.com Whatsapp +919911743277
Overview The human body can regulate its function responding to the change of its environment. Temperature is one of the factors which can modulate the body function. Refer to the related lectures and other resources; answer the followed questions (question 1-5 need at least 400 words together): Q1 In case of cold weather how does human body detect the coldness? Explain the signal detection, delivery, processing and involved cells, tissues and organs.

Overview The human body can regulate its function responding to the change of its environment. Temperature is one of the factors which can modulate the body function. Refer to the related lectures and other resources; answer the followed questions (question 1-5 need at least 400 words together): Q1 In case of cold weather how does human body detect the coldness? Explain the signal detection, delivery, processing and involved cells, tissues and organs.

  The chief brain mechanisms for heat regulation are established … Read More...
IE413 HW2 Soln 1 ♣ ♣ ♣ ♣ ♣ ♣ ♣♣ ♣ ♣ ♣ ♣ ♣ ♣ ♣ ♣ ♣ IE 413 Engineering OR I Homework #3 Solution Due Tuesday, September 29, 2015 ♣ ♣ ♣ ♣ ♣ ♣♣ ♣ ♣ ♣ ♣ ♣ ♣ ♣ ♣ ♣ ♣ 1. “Mama’s Kitchen” serves from 5:30am each morning until 7:30pm in the afternoon. Tables are set and cleared by busers working 5-hour shifts beginning on the hour from 5am (shift #1) through 3pm (shift #11). Most are college students who hate to get up early in the morning, so Mama’s pays $12 per hour for the 5am, 6am, 7am and 8am shifts, and $9 per hour for the others. The manager seeks a minimum cost staffing plan that will have at least a minimum number of busers on duty each hour: 5am 6am 7am 8am 9am 10am 11am Noon #reqd 3 5 6 5 1 2 4 6 1pm 2pm 3pm 4pm 5pm 6pm 7pm #reqd 7 1 3 1 4 6 7 (a) Formulate a linear programming model (LP) for this problem. Be sure to define your decision variables! (b) Provide LINDO input to solve the LP model provided in (a) (c) Provide LINGO input to solve the LP model provided in (a) (d) Use LINDO (or LINGO) to solve the problem, and describe the optimal solution briefly in “plain English” 2. (Modification of Problem 3.5-2, page 87-88, of Hillier & Lieberman’s OR book, 10th edition) You are given the following data for a linear programming problem where the objective is to maximize the profit from allocating three resources to two nonnegative activities. Contribution per unit = profit per unit of the activity (a) Formulate a linear programming model for this problem. Be sure to define your decision variables! (b) Use the graphical method to solve this model IE413 HW2 Soln 2 (c) Use the simplex algorithm to solve this model (Show the initial and each succeeding tableau) (d) Provide LINDO input to solve this model (e) Provide LINGO input to solve this model (f) Describe the optimal solution briefly in “plain English” 3. (Modification of Problem 3.4-10, page 85-86, of Hillier & Lieberman’s OR book, 10th edition) Eddie Smith is the director of the Computer Center for Johnson College. He now needs to schedule the staffing of the center. It is open from 8 A.M. until midnight. Eddie has monitored the usage of the center at various times of the day, and determined that the following number of computer consultants are required: Two types of computer consultants can be hired: full-time and part-time. The full-time consultants work for 8 consecutive hours in any of the following shifts: morning (8 A.M.–4 P.M.), afternoon (noon–8 P.M.), and evening (4 P.M.–midnight). Full-time consultants are paid $40 per hour. Part-time consultants can be hired to work any of the four shifts listed in the above table. Part-time consultants are paid $30 per hour. An additional requirement is that during every time period, there must be at least 2 full-time consultants on duty for every part time consultant on duty. Eddie would like to determine how many full-time and how many part-time workers should work each shift to meet the above requirements at the minimum possible cost. (a) Formulate an integer programming model for this problem. Be sure to define your decision variables! (b) Use LINDO (or LINGO) to solve this model and describe the optimal solution briefly in “plain English”

IE413 HW2 Soln 1 ♣ ♣ ♣ ♣ ♣ ♣ ♣♣ ♣ ♣ ♣ ♣ ♣ ♣ ♣ ♣ ♣ IE 413 Engineering OR I Homework #3 Solution Due Tuesday, September 29, 2015 ♣ ♣ ♣ ♣ ♣ ♣♣ ♣ ♣ ♣ ♣ ♣ ♣ ♣ ♣ ♣ ♣ 1. “Mama’s Kitchen” serves from 5:30am each morning until 7:30pm in the afternoon. Tables are set and cleared by busers working 5-hour shifts beginning on the hour from 5am (shift #1) through 3pm (shift #11). Most are college students who hate to get up early in the morning, so Mama’s pays $12 per hour for the 5am, 6am, 7am and 8am shifts, and $9 per hour for the others. The manager seeks a minimum cost staffing plan that will have at least a minimum number of busers on duty each hour: 5am 6am 7am 8am 9am 10am 11am Noon #reqd 3 5 6 5 1 2 4 6 1pm 2pm 3pm 4pm 5pm 6pm 7pm #reqd 7 1 3 1 4 6 7 (a) Formulate a linear programming model (LP) for this problem. Be sure to define your decision variables! (b) Provide LINDO input to solve the LP model provided in (a) (c) Provide LINGO input to solve the LP model provided in (a) (d) Use LINDO (or LINGO) to solve the problem, and describe the optimal solution briefly in “plain English” 2. (Modification of Problem 3.5-2, page 87-88, of Hillier & Lieberman’s OR book, 10th edition) You are given the following data for a linear programming problem where the objective is to maximize the profit from allocating three resources to two nonnegative activities. Contribution per unit = profit per unit of the activity (a) Formulate a linear programming model for this problem. Be sure to define your decision variables! (b) Use the graphical method to solve this model IE413 HW2 Soln 2 (c) Use the simplex algorithm to solve this model (Show the initial and each succeeding tableau) (d) Provide LINDO input to solve this model (e) Provide LINGO input to solve this model (f) Describe the optimal solution briefly in “plain English” 3. (Modification of Problem 3.4-10, page 85-86, of Hillier & Lieberman’s OR book, 10th edition) Eddie Smith is the director of the Computer Center for Johnson College. He now needs to schedule the staffing of the center. It is open from 8 A.M. until midnight. Eddie has monitored the usage of the center at various times of the day, and determined that the following number of computer consultants are required: Two types of computer consultants can be hired: full-time and part-time. The full-time consultants work for 8 consecutive hours in any of the following shifts: morning (8 A.M.–4 P.M.), afternoon (noon–8 P.M.), and evening (4 P.M.–midnight). Full-time consultants are paid $40 per hour. Part-time consultants can be hired to work any of the four shifts listed in the above table. Part-time consultants are paid $30 per hour. An additional requirement is that during every time period, there must be at least 2 full-time consultants on duty for every part time consultant on duty. Eddie would like to determine how many full-time and how many part-time workers should work each shift to meet the above requirements at the minimum possible cost. (a) Formulate an integer programming model for this problem. Be sure to define your decision variables! (b) Use LINDO (or LINGO) to solve this model and describe the optimal solution briefly in “plain English”

Lab Description: Follow the instructions in the lab tasks below to complete Problems 1 through 4. These problems will guide you in observing signal delays and timing hazards of logic circuits (both Sum-of-Products (SOP) and Product-of-Sums (POS) circuits). These problems will also guide you in adding circuitry to eliminate a timing hazard. Use VHDL to design the circuits. Carefully follow the directions provided in the lab tasks below. Write your answers to the questions asked by the problems. Do not print out the VHDL code and waveforms as asked by the problems, instead include these on the cover sheet for this lab and print this out when you are done. Do not worry about annotating or putting arrows/notes on the waveforms–just make sure any signals or transitions of interest are shown in your screenshot. For each problem, use VHDL assignment statements for each gate of the Boolean expression. You must add delay for each gate and inverter as described by the problem. Do this by using the “after” statement: Z <= (A and B) after 1 ns; Refer to Digilent Real Digital Module 8 for more information about the "after" statement. Lab Tasks: 1. Complete Problem 1 of Project 8. Simulate all input combinations for this SOP (Sum-of-Products) expression. However, be aware that specific input sequences are required to observe a timing hazard. The problem states that you will need to observe the output when B and C are both high (logic 1) and A transitions from high to low to high (logic 1 to 0, then back to 1). 2. Complete Problem 4 of Project 8. Increase the delay of the OR gate as specified and re-simulate to answer the questions. 3. Complete Problem 2 of Project 8. Change the delay of the OR gate back to the 1 ns that you used for Problem 1. Add the new logic gate (with delay) to your VHDL for the SOP expression and re-simulate to answer the questions. 4. Complete Problem 3 of Project 8. You may create any POS (Product-of-Sums) expression for this problem, however, not all POS expressions will have a timing hazard (so spend some time thinking about how a timing hazard can be generated with a POS expression). Once again, simulate all input combinations for your POS expression but be aware that specific input sequences are required to observe a timing hazard. For this problem, you will also add the new logic gate (with delay) to your VHDL for your POS expression in order to eliminate the timing hazard; you will need to re-simulate with this additional logic gate in order to answer the questions. Problem 1. Implement the function Y = A’.B + A.C in the VHDL tool. Define the INV, OR and two AND operations separately, and give each operation a 1ns delay. Simulate the circuit with all possible combinations of inputs. Watch all circuit nets (inputs, outputs, and intermediate nets) during the simulation. Answer the questions below. Observe the outputs of the AND gates and the overall circuit output when B and C are both high, and A transitions from H to L and then from L to H (you may want to create another simulation to focus on this behavior). What output behavior do you notice when A transitions? What happens when A transitions and B or C are held a ‘0’? How long is the output glitch? _______ Is it positive ( ) or negative ( ) (circle one)? Change the delay through the inverter to 2ns, and resimulate. Now how long is output glitch? ______ What can you say about the relationship between the inverter gate delay and the length of the timing glitch? Based on this simple experiment, an SOP circuit can exhibit positive/negative glitches (circle one) when an input that arrives at one AND gate in a complemented form and another AND gate in uncomplemented form transitions from a _____ to a _____. Problem 2. Enter the logic equation from problem 1 in the K-map below, and loop the equation with redundant term included. Add the redundant term to the Xilinx circuit, re-simulate, and answer the questions. B C A 00 01 11 10 0 1 F Did adding the new gate to the circuit change the logical behavior of the circuit? What effect did the new gate have on the output, particularly when A changes and B and C are both held high? Problem 3. Create a three-input POS circuit to illustrate the formation of a glitch. Drive the simulator to illustrate a glitch in the POS circuit, and answer the questions below. A POS circuit can exhibit a positive/negative glitch (circle one) when an input that arrives at one OR gate in a complemented form and another OR gate in un-complemented form transitions from a _____ to a _____. Write the POS equation you used to show the glitch: Enter the equation in the K-map below, loop the original equation with the redundant term, add the redundant gate to your Xilinx circuit, and resimulate. How did adding the new gate to the circuit change the logical behavior of the circuit? What effect did the new gate have on the output, particularly when A changes and B and C are both held high? Print and submit the circuits and simulation output, label the output glitches in the simulation output, and draw arrows on the simulation output between the events that caused the glitches (i.e., a transition in an input signal) and the glitches themselves. Problem 4. Copy the SOP circuit above to a new VHDL file, and increase the delay of the output OR gate. Simulate the circuit and answer the questions below. How did adding delay to the output gate change the output transition? Does adding delay to the output gate change the circuit’s glitch behavior in any way? Name: Signal Delays Date: Designing with VHDL Grade Item Grade Five segments of VHDL Code for Problems 1-4: /10 Five simulation screenshots for Problems 1-4: /10 Questions from Problems 1-4: /16 Total Grade: /36 VHDL Code: Copy-paste your VHDL design code (just the code you wrote) for: • The SOP expression with the timing hazard (Problem 1, Project 8): • The SOP expression with increased OR gate delay (Problem 4, Project 8): • The SOP expression with the extra logic gate in order to eliminate the timing hazard (Problem 2, Project 8): • Your POS expression with the timing hazard (Problem 3, Project 8): • Your POS expression with the extra logic gate in order to eliminate the timing hazard (Problem 3, Project 8): Simulation Screenshots: Use the “Print Screen” button to capture your screenshot (it should show the entire screen, not just the window of the program). • The SOP expression with the timing hazard (Problem 1, Project 8): • The SOP expression with increased OR gate delay (Problem 4, Project 8): • The SOP expression with the extra logic gate in order to eliminate the timing hazard (Problem 2, Project 8): • Your POS expression with the timing hazard (Problem 3, Project 8): • Your POS expression with the extra logic gate in order to eliminate the timing hazard (Problem 3, Project 8): Simulation Screenshot Tips: (you can delete this once you capture your screenshot) 1. Make the “Wave” window large by clicking the “+” button near the upper-right of the window 2. Click the “Zoom Full” button (looks like a blue/green-filled magnifying glass) to enlarge your waveforms 3. In order to not print a lot of black, change the color scheme of the “Wave” window: 3.1. Click ToolsEdit Preferences… 3.2. The “By Window” tab should be selected, then click Wave Windows in the “Window List” to the left 3.3. Scroll to the bottom of the “Wave Windows Color Scheme” list and click waveBackground. Then click white in the color “Palette” at the right of the screen. 3.4. Now color the waveforms and text black: 3.4.1. Click LOGIC_0 in the “Wave Windows Color Scheme.” Then click black in the color “Palette” at the right of the screen. 3.4.2. Repeat this for LOGIC_1, timeColor, and cursorColor (if you have a cursor you want to print) 3.5. Once you have captured your screenshot, you can click the Reset Defaults button to restore the “Wave” window to its original color scheme Questions: (Please use this cover sheet to type and print your responses) 1. List the references you used for this lab assignment (e.g. sources/websites used or students with whom you discussed this assignment) 2. Do you have any comments or suggestions for this lab exercise?

Lab Description: Follow the instructions in the lab tasks below to complete Problems 1 through 4. These problems will guide you in observing signal delays and timing hazards of logic circuits (both Sum-of-Products (SOP) and Product-of-Sums (POS) circuits). These problems will also guide you in adding circuitry to eliminate a timing hazard. Use VHDL to design the circuits. Carefully follow the directions provided in the lab tasks below. Write your answers to the questions asked by the problems. Do not print out the VHDL code and waveforms as asked by the problems, instead include these on the cover sheet for this lab and print this out when you are done. Do not worry about annotating or putting arrows/notes on the waveforms–just make sure any signals or transitions of interest are shown in your screenshot. For each problem, use VHDL assignment statements for each gate of the Boolean expression. You must add delay for each gate and inverter as described by the problem. Do this by using the “after” statement: Z <= (A and B) after 1 ns; Refer to Digilent Real Digital Module 8 for more information about the "after" statement. Lab Tasks: 1. Complete Problem 1 of Project 8. Simulate all input combinations for this SOP (Sum-of-Products) expression. However, be aware that specific input sequences are required to observe a timing hazard. The problem states that you will need to observe the output when B and C are both high (logic 1) and A transitions from high to low to high (logic 1 to 0, then back to 1). 2. Complete Problem 4 of Project 8. Increase the delay of the OR gate as specified and re-simulate to answer the questions. 3. Complete Problem 2 of Project 8. Change the delay of the OR gate back to the 1 ns that you used for Problem 1. Add the new logic gate (with delay) to your VHDL for the SOP expression and re-simulate to answer the questions. 4. Complete Problem 3 of Project 8. You may create any POS (Product-of-Sums) expression for this problem, however, not all POS expressions will have a timing hazard (so spend some time thinking about how a timing hazard can be generated with a POS expression). Once again, simulate all input combinations for your POS expression but be aware that specific input sequences are required to observe a timing hazard. For this problem, you will also add the new logic gate (with delay) to your VHDL for your POS expression in order to eliminate the timing hazard; you will need to re-simulate with this additional logic gate in order to answer the questions. Problem 1. Implement the function Y = A’.B + A.C in the VHDL tool. Define the INV, OR and two AND operations separately, and give each operation a 1ns delay. Simulate the circuit with all possible combinations of inputs. Watch all circuit nets (inputs, outputs, and intermediate nets) during the simulation. Answer the questions below. Observe the outputs of the AND gates and the overall circuit output when B and C are both high, and A transitions from H to L and then from L to H (you may want to create another simulation to focus on this behavior). What output behavior do you notice when A transitions? What happens when A transitions and B or C are held a ‘0’? How long is the output glitch? _______ Is it positive ( ) or negative ( ) (circle one)? Change the delay through the inverter to 2ns, and resimulate. Now how long is output glitch? ______ What can you say about the relationship between the inverter gate delay and the length of the timing glitch? Based on this simple experiment, an SOP circuit can exhibit positive/negative glitches (circle one) when an input that arrives at one AND gate in a complemented form and another AND gate in uncomplemented form transitions from a _____ to a _____. Problem 2. Enter the logic equation from problem 1 in the K-map below, and loop the equation with redundant term included. Add the redundant term to the Xilinx circuit, re-simulate, and answer the questions. B C A 00 01 11 10 0 1 F Did adding the new gate to the circuit change the logical behavior of the circuit? What effect did the new gate have on the output, particularly when A changes and B and C are both held high? Problem 3. Create a three-input POS circuit to illustrate the formation of a glitch. Drive the simulator to illustrate a glitch in the POS circuit, and answer the questions below. A POS circuit can exhibit a positive/negative glitch (circle one) when an input that arrives at one OR gate in a complemented form and another OR gate in un-complemented form transitions from a _____ to a _____. Write the POS equation you used to show the glitch: Enter the equation in the K-map below, loop the original equation with the redundant term, add the redundant gate to your Xilinx circuit, and resimulate. How did adding the new gate to the circuit change the logical behavior of the circuit? What effect did the new gate have on the output, particularly when A changes and B and C are both held high? Print and submit the circuits and simulation output, label the output glitches in the simulation output, and draw arrows on the simulation output between the events that caused the glitches (i.e., a transition in an input signal) and the glitches themselves. Problem 4. Copy the SOP circuit above to a new VHDL file, and increase the delay of the output OR gate. Simulate the circuit and answer the questions below. How did adding delay to the output gate change the output transition? Does adding delay to the output gate change the circuit’s glitch behavior in any way? Name: Signal Delays Date: Designing with VHDL Grade Item Grade Five segments of VHDL Code for Problems 1-4: /10 Five simulation screenshots for Problems 1-4: /10 Questions from Problems 1-4: /16 Total Grade: /36 VHDL Code: Copy-paste your VHDL design code (just the code you wrote) for: • The SOP expression with the timing hazard (Problem 1, Project 8): • The SOP expression with increased OR gate delay (Problem 4, Project 8): • The SOP expression with the extra logic gate in order to eliminate the timing hazard (Problem 2, Project 8): • Your POS expression with the timing hazard (Problem 3, Project 8): • Your POS expression with the extra logic gate in order to eliminate the timing hazard (Problem 3, Project 8): Simulation Screenshots: Use the “Print Screen” button to capture your screenshot (it should show the entire screen, not just the window of the program). • The SOP expression with the timing hazard (Problem 1, Project 8): • The SOP expression with increased OR gate delay (Problem 4, Project 8): • The SOP expression with the extra logic gate in order to eliminate the timing hazard (Problem 2, Project 8): • Your POS expression with the timing hazard (Problem 3, Project 8): • Your POS expression with the extra logic gate in order to eliminate the timing hazard (Problem 3, Project 8): Simulation Screenshot Tips: (you can delete this once you capture your screenshot) 1. Make the “Wave” window large by clicking the “+” button near the upper-right of the window 2. Click the “Zoom Full” button (looks like a blue/green-filled magnifying glass) to enlarge your waveforms 3. In order to not print a lot of black, change the color scheme of the “Wave” window: 3.1. Click ToolsEdit Preferences… 3.2. The “By Window” tab should be selected, then click Wave Windows in the “Window List” to the left 3.3. Scroll to the bottom of the “Wave Windows Color Scheme” list and click waveBackground. Then click white in the color “Palette” at the right of the screen. 3.4. Now color the waveforms and text black: 3.4.1. Click LOGIC_0 in the “Wave Windows Color Scheme.” Then click black in the color “Palette” at the right of the screen. 3.4.2. Repeat this for LOGIC_1, timeColor, and cursorColor (if you have a cursor you want to print) 3.5. Once you have captured your screenshot, you can click the Reset Defaults button to restore the “Wave” window to its original color scheme Questions: (Please use this cover sheet to type and print your responses) 1. List the references you used for this lab assignment (e.g. sources/websites used or students with whom you discussed this assignment) 2. Do you have any comments or suggestions for this lab exercise?

checkyourstudy.com Whatsapp +919911743277