Papyrus-RT and Simulink for Modelling Behaviour Assignment Help
Description
Details
There will be 2 parts to this assignment. You will be creating a system to generate random numbers, process them in in some manner, then compare the results for output. You will implement the system in both Papyrus-RT and in Simulink.
- The following is the basic behavior of the system regardless of implementation:
- You must generate 3 random numbers between 1 and
- Each random number must be passed to some other component to process the number in some way:
- The first, called A, will double the
- The second, called B, will add 37 to the
- The third, called C, will square the number and subtract
- All three results will be stored for
- The highest of the three values will determine the winner:
- If A is the highest, then A wins; if B is the highest, then B wins,
- You will need to keep track of the winner in each round (A, B, or C), and a count for each of them to determine an overall
- Ultimately, your competition will have 100 values, thus 100 rounds of competition, and the number of winners should add up to
- The following should be considered for your Papyrus-RT implementation:
- You will need 4 capsules: 1 central capsule for the generator and comparison, and 1 for each of A, B, and
- You will need protocols for communication between the appropriate
- This assignment will require passing of parameters with messages – you will need to look into how to do
- A, B, and C should only receive messages with a number, process it in their own way, and send it back to the central
- The central capsule should wait to receive all three results back, compare them, and determine that round’s winner (logging output), as well as update counters for the winner.
- At the end of the 100 runs, the system should pick an ultimate winner; that is the system (A, B, or C) that had the most wins over the 100
- The following should be considered for your Simulink implementation:
- You will need a variable to keep track of wins for A, B, and
- You will also need to count the number of wins for each of A, B, and
- Processing for A, B, and C should take place in separate
- Your values should work for BOTH simulation AND generated
- Make sure to set all model properties as appropriate (things like solver type, step size, the type of output, )
- Once both are completed, you will need to “officially” run each 3 times as follows:
- Run your Papyrus-RT system by generating the code, and running it 3 times just as we did for Lab 5, redirecting output to files for inclusion in
- Simulate your Simulink model twice, then generate the code and run it once for the 3 runs. You will need to capture the output in the workspace after each
What to Submit
- Your Papyrus-RT Implementation
- Include all structure diagrams, state diagrams, and code snippets in the same manner and detail as for Lab
- Your Simulink Model Implementation
- A screenshot of the completed Simulink Model
- You must show the inside of any contained subsystems by opening them up and providing additional screenshots.
- Your Papyrus-RT Outputs
- The contents of the 3 files containing your output for the 3
- Your Simulink Outputs
- A screenshot of the workspace after the two simulation runs – delete all values after each run
- A screenshot of the workspace after generating and running the Executable file, and loading the resulting .mat file into the
Please follow and like us: