1/99
Looks like no tags are added yet.
Which four precepts form the foundation of modeling and simulation?
Modeling, simulation, visualization, and analysis.
How does a model differ from a simulation?
A model represents a system; a simulation imitates its operation over time.
How do discrete and continuous systems differ in the way their states change?
Discrete states change at separate event times; continuous states change continuously with time.
A tank level changes continuously but is recorded every five minutes. What system classification describes the available information?
Sampled-data system.
In a factory model, a machine has a speed of 30 units/hour. What is the machine, and what is its speed?
The machine is an entity; its speed is an attribute.
What distinguishes endogenous activities from exogenous activities?
Endogenous activities occur inside the system; exogenous activities occur outside it.
A commander enters decisions that simulated personnel execute in simulated equipment. What type of simulation is this?
Constructive simulation.
How does fidelity differ from resolution in a simulation?
Fidelity is closeness to reality; resolution is the level of detail or granularity.
What is v after this MATLAB statement? v = 2:3:11;
[2 5 8 11]
For real-valued data, what is the value and shape of v? v = [2 4 6]';
[2; 4; 6], a 3-by-1 column vector.
What is x? A = [1 2 3; 4 5 6]; x = A(2,3);
6
What is B? A = [1 2 3; 4 5 6]; B = A(:,2:3);
[2 3; 5 6]
What are r, c, and n? A = [1 2 3; 4 5 6]; [r,c] = size(A); n = numel(A);
r = 2, c = 3, n = 6.
What is s? A = [1 2; 3 4]; s = sum(A);
[4 6]
What is s? A = [1 2; 3 4]; s = sum(A,2);
[3; 7]
What is c? a = [2 3 4]; b = [5 6 7]; c = a.*b;
[10 18 28]
Correct the exponent operator so the script squares each element. x = 1:4; y = x^2;
Use y = x.^2; the result is [1 4 9 16].
What is C? A = [1 2; 3 4]; B = [2; 1]; C = A*B;
[4; 10]
A is 3-by-4 and B is 4-by-2. What is the size of A*B?
3-by-2
What is v after the deletion? v = [10 20 30 40]; v(2) = [];
[10 30 40]
Which MATLAB command lists workspace variables together with details such as size and class?
whos
Which command removes every variable from the current MATLAB workspace?
clear
What defines discrete-event simulation (DES)?
System state changes instantaneously at separate event times.
How does next-event time advance update the simulation clock?
It jumps to the earliest scheduled future event time.
In a linear congruential random-number generator, what does Z_0 represent?
The seed, or starting value of the recurrence.
Which distribution commonly models independent interarrival times with a constant arrival rate?
Exponential distribution.
Only minimum, most likely, and maximum repair times are known. Which distribution uses those three parameters?
Triangular distribution.
A customer joins a queue but leaves before service. What is this behavior called?
Reneging.
Under FCFS, customers A, B, and C arrive at times 0, 2, and 3. Their service times are 8, 1, and 2. What is their service order?
A, B, C
In a single-server FCFS queue, how is customer i's service-start time calculated?
B_i = max(A_i, D(i-1)), where A_i is arrival time and D(i-1) is the previous departure.
A customer arrives at time 5 and begins service at time 7. What is the waiting time in the queue?
2 time units: waiting = service start - arrival = 7 - 5.
A customer begins service at time 9 and needs 4 minutes. When does service end?
At time 13 minutes: departure = start + service time.
A customer arrives at time 11 and departs at time 15. How long is the customer in the system?
4 minutes: time in system = departure - arrival.
The previous customer departs at time 8. The next customer arrives and starts service at time 9. How much idle time occurs between them?
1 minute: idle time = max(0, next arrival - previous departure).
The first customer arrives at time 0. Subsequent interarrival times are 4, 1, and 4. What are the four arrival times?
0, 4, 5, 9
For an initially idle single FCFS server, arrivals are [0 4 5 9 11 15] and service times are [2 3 1 4 2 3]. What are the departure times?
[2 7 8 13 15 18]
Six customers have queue waits [0 0 2 0 2 0]. What is the average queue waiting time across all six?
4/6 = 2/3 minute, approximately 0.667 minute.
Six customers have queue waits [0 0 2 0 2 0]. What fraction of customers waited?
2/6 = 1/3, approximately 33.3%.
Three tellers can each serve one customer at a time. What is their combined resource capacity?
3 customers at a time.
What distinguishes direct sample-data reuse from an empirical distribution?
Direct reuse feeds stored observations into the model; an empirical distribution constructs a sampling distribution from the observations.
Why must the state variables of a continuous model be complete?
They must contain enough information to reproduce all relevant system behavior to the required accuracy.
In the module's predator-prey model, what do x and y represent?
x is prey population; y is predator population.
In the Lotka-Volterra prey growth rate f = b - p*y, what happens to f as predator population y increases, assuming p > 0?
f decreases.
Why are numerical methods such as Euler and Runge-Kutta used for continuous-system models?
Many governing differential equations cannot be solved conveniently in closed form, so numerical approximation is needed.
How do a MATLAB script and a function differ in their data access?
A script operates in the current workspace; a function can accept inputs, return outputs, and use local variables.
What is C? A = [1 0; 2 4]; B = [5 9; 2 1]; C = A + B;
[6 9; 4 5]
What is s? s1 = ["Red" "Blue" "Green"]; s2 = ["Truck" "Sky" "Tree"]; s = s1 + s2;
["RedTruck" "BlueSky" "GreenTree"]
Write a MATLAB statement that reads a name as text rather than evaluating the typed input as an expression.
name = input('Enter name: ', 's');
What does disp(A) show compared with entering A by itself?
disp(A) shows the value without the leading variable name.
What text is printed? name = 'Alice'; age = 12; fprintf('%s will be %d this year.\n',name,age);
Alice will be 12 this year. Then a newline.
What text is printed? fprintf('Average = %.2f\n', 7/2);
Average = 3.50 followed by a newline.
Which word is printed? x = -3; if x < 0; disp('Negative'); else; disp('Nonnegative'); end
Negative
Given age = 20, which category is printed by this code? if age > 13 && age < 20; disp('teen'); elseif age > 20 && age < 60; disp('adult'); elseif age
senior
In MATLAB, why is y = x % 2; unsuitable for testing parity, and what expression should replace its right-hand side?
Because % begins a comment. Use mod(x,2), as in y = mod(x,2);.
What is ok? age = 19; ok = age > 13 && age < 20;
logical true (1)
What text is printed? grade = 'B'; switch grade; case 'A'; disp('Excellent'); case 'B'; disp('Well done'); otherwise; disp('Invalid'); end
Well done
What is pick if the user clicks Mushroom? pick = menu('Pick a Pizza','Cheese','Sausage','Mushroom');
3
What is the final value of total? total = 0; for k = 1:4; total = total + k; end
10
What sequence is displayed? for v = [1 5 8 17]; disp(v); end
1, 5, 8, 17, in that order.
What is the final value of a? a = 10; while a < 13; a = a + 1; end
13
What is the final value of a? a = 10; while a < 20; a = a + 1; if a > 15; break; end; end
16
A function file triple.m contains the following. What does triple(4) return? function y = triple(x); y = 3*x; end
12
What are the four steps of a Monte Carlo simulation?
Define input distributions; sample inputs; compute deterministically for each sample; aggregate the results.
Of 10,000 uniformly sampled points in a unit square, 7,850 lie inside its unit quarter circle. Estimate pi.
pi is approximately 4*(7850/10000) = 3.14.
What does sensitivity analysis investigate?
How uncertainty or variation in model inputs contributes to uncertainty or variation in its outputs.
Why should derivative-based sensitivity be checked at several operating points for a nonlinear model?
A derivative describes local sensitivity, which can change across a nonlinear model's operating range.
Write the command that exports numeric array results to results.dat as ASCII data.
save('results.dat','results','-ascii');
Write a command that reads a compatible rectangular numeric text file results.dat into variable R.
R = load('results.dat');
Why does basic numeric load fail for a text file whose rows contain different numbers of values?
The data cannot form the rectangular numeric matrix expected by this workflow.
When save exports a character array using -ascii, does the file contain the original text or numeric character codes?
Numeric character codes.
Write the three essential MATLAB statements to plot y = x squared for x from 0 to 2 in steps of 0.5.
x = 0:0.5:2; y = x.^2; plot(x,y);
What appearance does plot(x,y,'r--o') request?
A red dashed line with circle markers.
What does hold on allow when another plot command follows?
It retains the existing plot so the next data series is added to the same axes.
Which command names two plotted curves 'Sin(x)' and 'Cos(x)'?
legend('Sin(x)','Cos(x)');
How does axis equal differ from axis square?
axis equal uses equal data-unit scales on the axes; axis square makes the plot box square.
Which function plots coordinate vectors x, y, and z in 3D, and which function labels its z axis?
plot3(x,y,z) and zlabel(...)
A hydraulic network model emphasizes physical balancing relationships more than connection direction. Which Fishwick model type fits?
Constraint model.
In a concept map, what do nodes, directed arrows, and arrow labels represent?
Nodes are concepts or elements; arrows are interactions; labels specify the nature of the interactions.
Which standardized, semiformal, object-oriented graphical notation models software and system structure and behavior?
UML (Unified Modeling Language).
What are the three stated steps of an operations research study?
Formulate the problem; develop a mathematical model; solve the model to search for an optimal solution.
Which Simulink block supplies a fixed numeric value such as the box labeled 10 in the module?
Constant block.
A Simulink block has plus signs at its two input ports. With inputs 1 and 100, what block is it and what value does it output?
Add (Sum) block; output = 101.
Which Simulink block is marked with a multiplication symbol and produces 10 from inputs 10 and 1?
Product block.
Which Simulink block shows the numeric result in a rectangular readout, such as 1660 in the module?
Display block.
A Simulink relational block labeled > receives 1660 at its top input and 5000 at its bottom input. What does it output?
0 (false)
In Simulink, String Constant blocks contain "Hello " and "FEU Tech". What does String Concat output?
"Hello FEU Tech"
In the shown Simulink examples, what do the blocks marked square-root(u) and u^2 output for inputs 16 and 3, respectively?
4 and 9, respectively.
The module connects sqrt(16), square(3), and sign(-5) to an Add block, then compares their sum with 12 using ==. What logical output results?
1 (true), because 4 + 9 - 1 = 12.
How do a point and a vector differ in computer graphics?
A point is a location; a vector has direction and magnitude without a fixed location.
Match the geometric transformations to their effects: translation, rotation, scaling.
Translation changes location; rotation changes orientation; scaling changes size.
How does perspective projection differ from parallel projection?
Perspective uses a finite center of projection; parallel uses parallel projectors and a direction of projection.
Which graphics light model best represents sunlight arriving from a very distant source?
Directional light, also called distant light.
Why is texture mapping useful when geometric complexity must stay low?
It enriches surface appearance without significantly increasing geometric complexity.
What is the simuland?
The real-world object, process, or phenomenon being simulated.
What is the referent in a simulation project?
The developers' body of knowledge about the simuland, including quantitative and qualitative knowledge.
Which VV&A process checks whether an implementation correctly follows its specification?
Verification.
Which VV&A process checks how accurately model behavior represents the simuland?
Validation.
What is accreditation?
Official certification by a responsible authority that a model is acceptable for a specific use, informed by V&V results.
In the module's VV&A terminology, distinguish Type I, Type II, and Type III errors.
Type I: a valid model is not used. Type II: an invalid model is used. Type III: an irrelevant model is used.
Knowledgeable experts assess whether simulation output looks plausible compared with simuland behavior. What method is this?
Face validation.