# Modeling The Environment In conventional computer-based systems, a computer manipulates symbols and numbers while it operates exclusively in the cyber domain. These types of systems only interact with the physical world through a human-machine interface and an operator. In this scenario, the human-machine interface accepts inputs from the operator, performs a computation, and delivers the output data back to the operator, who is the sole authority to assess the outputs and decides to initiate an action in the physical world. In this scenario, the human actor is the main decider on how the physical surroundings are modified by the operations the computer performs, but the computer does not alter the environment by itself. A trivial example is a cashier scanning groceries: the computer interacts with the items by using the bar code reader, but it's the cashier who takes the effort of making the computer interact with the items. In some other cases, a system may be able to interact with the physical environment. In this case, the system consists of two sides: the physical side which contains equipment that can directly interact with and sense the physical reality, called sensors and actuators, and the controller side which observes the state of the system and acts accordingly by modifying the dynamical state. In fully autonomous systems of this kind, there will be no human in the loop. To modify its dynamic state, the system will sense the surroundings to determine its state. This is done utilizing a set of sensors that define and limit the worldview of the system. Therefore, the system will not be able to detect properties of the physical environment that are outside the scope of the sensors mounted. One significant challenge when developing complex systems that interact with the physical environment is to replicate these environments. The solution is to devise synthetic environments which are simplified numerical representations of the real ones; in other words, simulations of the real environment. A paradoxical situation pops up: the true nature of the simulations is to be less complex (i.e., less accurate) than the entities they come to simulate. This is undoubtedly true: if a simulation is as complex as the entity it simulates, there is no point for a simulation in the first place. It would be like using a 1:1 map for navigation. But how do we trick a computer into working with a synthetic environment if it's expecting a real one? Fortunately, computers are still rather easy to fool. Imagine for a moment a digital system controlling a chemical process in some industrial plant. Monitoring a chemical process will require reading temperatures, pressures, flows, and the like. For the process to be controlled, the system will need to read those physical variables from the environment. However, because computers cannot directly read a physical variable like a temperature from the environment, this will require converting the physical quantity into proportional voltages or currents that the computer will be able to read once converted into the digital domain by analog-to-digital converters. Then, the digital system governing the plant will process the converted readings, compute an action (if necessary), and it will apply actuation to correct for any deviations from a desired set point. One thing is clear: digital systems have no means of discerning if a number they are using for their computations comes from a "real" or "fake" source. Then, if we had a magical device capable of replicating the dynamics of the chemical plant in a way that would feed credible (as in, not absurd) values into the control computer, the computer would just continue with "business as usual". And this is the main principle behind system simulation. This does not come without challenges. There is an inescapable tradeoff between the fidelity of simulation and the usefulness of the synthetic environment. Also, simulation environments can grow in complexity in such a way they may become unreliable and hard to maintain. For good exposure to simulation environments and devising control laws to regulate the dynamical state of a vehicle, check the [[Flight Simulation (start here)]] section.