Presentation is loading. Please wait.

Presentation is loading. Please wait.

Modelling Complex Systems Video 4: A simple example in a complex way.

Similar presentations


Presentation on theme: "Modelling Complex Systems Video 4: A simple example in a complex way."— Presentation transcript:

1 Modelling Complex Systems Video 4: A simple example in a complex way

2 Traditional models Probability theory and distributions. Ordinary differential equation models. Difference equations. Partial differential equation models. Stochastic differential equations. Partial differential equations. Markov chain models Statistical mechanics models.

3 Using traditional models Usually a whole course or number of courses will be dedicated to looking at each technique. Each types of models are also useful in modelling complex systems. But we do not take any particular traditional model as our starting point. Instead we switch backwards and forwards between different approaches.

4 ‘Complex systems’ models Cellular automata Agent-based models Self-propelled particles All are computer simulations.

5 `Complex systems’ models The basic approach is to write down an algorithm which describes how our complex system works and use this algorithm to better understand the system. This algorithm becomes a computer simulation which we run to see how the system behaves. But the algorithm can also be related to more 'traditional' mathematical models in order that we can better analyse the system.

6 A very simple (not complex) example Lets assume we want to model two connected boxes in which ’particles’ can move On each time step we choose one particle at random at move it to the other box. What is the equilibrium distribution of particles between boxes? How long does it take to reach this equilibrium?

7

8

9

10

11 Simulation Code %Number of particles N=50; %Simulation of Ehrenfest model %x is number in box x x(1)=round(rand); for t=1:T-1 if rand<x(t)/N %Leave box x x(t+1)=x(t)-1; else %Enter box x x(t+1)=x(t)+1; end

12 Simulation Output: 1 run N=50

13 Simulation Output: 5 runs N=50

14 Mean-field approximation

15

16 Importance of multiple runs R=100; for j=1:R %Initial conditions MAIN CODE HERE %Store final value xr(j)=x(end); end figure(2) hist(xr,[0:1:50]) ylabel('Frequency Count') xlabel('Number of Particles')

17 Simulation Output: 100 runs N=50

18 Equilibrium Distribution: 100 runs

19 Ehrenfest model

20

21 Complex Systems Approach Express a model as an ‘algorithm’ Simulate it lots of times. Look at equilibrium distribution. See if we can use traditional mathematics to approximate it. Compare approximation and simulation. Systematically investigate the effect of changing a parameter (next lecture).

22 Code The code to generate the figures on the previous slides can be found on studentportalen. Ehrenfest.m


Download ppt "Modelling Complex Systems Video 4: A simple example in a complex way."

Similar presentations


Ads by Google