3Farmer, Wolf, Goat, Cabbage A farmer needs to transport a wolf, a goat, and a cabbage across the river.FGBoat has two seatsFarmer must drive…If left alone…The wolf will eat the goat.The goat will eat the cabbage.WC
4Farmer, Wolf, Goat, Cabbage As a group, formulate a solution to transport everything across the river, without anything being eaten.FGWC
5What do we learn from this exercise? Sometimes we have to move backwards to move forwards.Even simple systems need thought to formulate a plan for accomplishing their goals.We call this plan, an algorithm.
7Algorithms al-Khwarizmi Persian mathematician, astronomer, and geographer born 780 A.D.Invented a few things…Decimal systemAlgebraTrigonometry
8Algorithmsal-Khwarizmi also introduced the idea of solving problems using step-by-step procedures for calculations.Algorithms – A method of solving a problem or accomplishing a task expressed as a finite list of well defined instructions.Starting from an initial state and an initial input, the instructions describe a computation that, when executed will proceed through a finite number of well defined successive states, eventually producing output, and terminating at a final ending state.
9States, Inputs, and Outputs States are a way of measuring the condition of a system, and it’s environment.Inputs are a way of getting information to a system.Outputs are a way of getting information from a system.
10AlgorithmsAlgorithms let us define, formally, what we want machines and automated systems to do.Algorithms are written to have precise meanings, and to be generally applicable.
11Systems Engineering and Cyberphysical Systems We build systems to do jobs, solve problems, and accomplish tasks.Often these systems are cyberphysical systems, i.e. they combine computational components with the real world.An algorithm is a way of telling the components how to do their job, and how to work together.
12Example System: Thermostat What is the goal?What problem does it solve?How would we characterize the state?What would the inputs and outputs be?
13Example System: Thermostat What is the goal?What problem does it solve?How would we characterize the state?What would the inputs and outputs be?Break into groupsDefine the problemDefine what the thermostat needs to do
14Example System: Thermostat Regulate temperatureSpecificationMust be able to sense temperatureBased on the temperature must be able to signal cooling or warming the room, or to do nothing.State: temperature, heating state, cooling state
15Example System: Thermostat Pseudocode algorithmtempLow = LtempHigh = Hloop()Test temperature, store the value in TIf (T < L) send a heating signalIf (T > H) send a cooling signal
17Some important points… ThermostatSignal: HeatSignal: CoolHeaterAir ConditionerSensorSome important points…Four systems here, each with their implementations…Need to communicate with each other…
18Networking and Communication Systems communicate via signals, over wires, or wirelessly via electromagnetic radiation.In our thermostat system, the heater and cooler can be switched on or off by a pure signal on the wire. I.e., if electrons are flowing, turn on, if not, turn off!
19Networking and Communication But how do we get information from the sensor?It needs to send a number… how do we do that?
20Networking and Communication What if we encode the signal into pulses?Detect if the value is above or below some threshold, and decide it represents a 1, or a 0.Strings of 1’s and 0’s can be interpreted as a number.
21Some simple things we can represent with 1’s and 0’s True or false…1 – true0 – falseWe already were doing this with pure signals.
22Some simple things we can represent with 1’s and 0’s IntegersExamples–– – 10– – 14776543211286432168
23Negative numbers and real numbers are more complex… We will cover those later…
24Boolean Algebra Using true/false values in complicated ways Thermostat systemLet’s make a change to the basic systemAdd a switch with values “Heat” and “Cool”Cool the room if T > H and Switch is set to “Heat”Heat the room if T < L and Switch is set to “Cool”
25Boolean Algebra Gets back to gators and grades… Represent truth as 1, and false as 0We can operate on values using the following basic operators:ANDORNOT