PH36010: Numerical Methods - Evaluating the Lorenz Attractor using Runge-Kutta methods Abstract

Similar documents
PH36010: Numerical Methods - Evaluating the Lorenz Attractor using Runge-Kutta methods Abstract

By Nadha CHAOS THEORY

Physics 584 Computational Methods

Introduction. Prediction MATH February 2017

Maps and differential equations

APPM 2460 CHAOTIC DYNAMICS

Environmental Physics Computer Lab #8: The Butterfly Effect

ESTIMATING THE ATTRACTOR DIMENSION OF THE EQUATORIAL WEATHER SYSTEM M. Leok B.T.

Comparison of Numerical Ordinary Differential Equation Solvers

THREE DIMENSIONAL SYSTEMS. Lecture 6: The Lorenz Equations

Lesson 9: Predator-Prey and ode45

Chapter 6 - Ordinary Differential Equations

Chap. 20: Initial-Value Problems

Computational project: Modelling a simple quadrupole mass spectrometer

Mathematical Foundations of Neuroscience - Lecture 7. Bifurcations II.

Chapter 6: Ensemble Forecasting and Atmospheric Predictability. Introduction

Een vlinder in de wiskunde: over chaos en structuur

SPATIOTEMPORAL CHAOS IN COUPLED MAP LATTICE. Itishree Priyadarshini. Prof. Biplab Ganguli

MATH 415, WEEK 12 & 13: Higher-Dimensional Systems, Lorenz Equations, Chaotic Behavior

Astronomy 8824: Numerical Methods Notes 2 Ordinary Differential Equations

Real Randomness with Noise and Chaos

ACM/CMS 107 Linear Analysis & Applications Fall 2016 Assignment 4: Linear ODEs and Control Theory Due: 5th December 2016

The Nonlinear Pendulum

FORECASTING ECONOMIC GROWTH USING CHAOS THEORY

THE ESSENCE OF... HAO~ Edward N. Lorenz UNIVERSITY OF WASHINGTON PRESS. Seattle


Edward Lorenz: Predictability

6.2 Brief review of fundamental concepts about chaotic systems

Why are Discrete Maps Sufficient?

Physically Based Modeling: Principles and Practice Differential Equation Basics

Using Matlab to integrate Ordinary Differential Equations (ODEs)

Physically Based Modeling Differential Equation Basics

FORTRAN 77 Lesson 7. Reese Haywood Ayan Paul

9. Scientific Computing. Introduction to Computer Science Sedgewick and Wayne Copyright

Edward Lorenz. Professor of Meteorology at the Massachusetts Institute of Technology

Dynamical Systems and Chaos Part I: Theoretical Techniques. Lecture 4: Discrete systems + Chaos. Ilya Potapov Mathematics Department, TUT Room TD325

lab6 October 25, 2015

A Study of the Thermal Properties of a One. Dimensional Lennard-Jones System

Fourth Order RK-Method

Corresponding address:

Solving PDEs with PGI CUDA Fortran Part 4: Initial value problems for ordinary differential equations

MAS212 Assignment #2: The damped driven pendulum

Numerov s Method for Approximating Solutions to Poisson s Equation

Ordinary Differential Equations (ODEs)

Lesson 4: Population, Taylor and Runge-Kutta Methods

Lecture 6. Lorenz equations and Malkus' waterwheel Some properties of the Lorenz Eq.'s Lorenz Map Towards definitions of:

Matthew S. Norton PHY 112 Lab Report CL-4 Damped Oscillator: Feynman-Newton Method for Solving First-Order Differential Equations March 2, 2006

Worksheet 8 Sample Solutions

A Brief Introduction to Numerical Methods for Differential Equations

Applications of Hurst Coefficient Analysis to Chaotic Response of ODE Systems: Part 1a, The Original Lorenz System of 1963

A Classical Approach to the Stark-Effect. Mridul Mehta Advisor: Prof. Enrique J. Galvez Physics Dept., Colgate University

Report E-Project Henriette Laabsch Toni Luhdo Steffen Mitzscherling Jens Paasche Thomas Pache

Module E Unit 2 Lesson 2 Exploration 2 Explaining the accuracy of weather prediction

Observability, a Problem in Data Assimilation

In this report, I discuss two different topics of thermodynamics and explain how they have

Lecture 1 Monday, January 14

Numerical Methods - Initial Value Problems for ODEs

Introduction to computational modelling

The Nonlinear Pendulum

Nonlinear dynamics & chaos BECS

Lorenz Equations. Lab 1. The Lorenz System

Numerical Methods for Ordinary Differential Equations

PSTricks. pst-ode. A PSTricks package for solving initial value problems for sets of Ordinary Differential Equations(ODE), v0.12.

CHEM-UA 652: Thermodynamics and Kinetics

Controlling a Novel Chaotic Attractor using Linear Feedback

Chaos & Recursive. Ehsan Tahami. (Properties, Dynamics, and Applications ) PHD student of biomedical engineering

ATM S 111, Global Warming Climate Models

Introduction Knot Theory Nonlinear Dynamics Topology in Chaos Open Questions Summary. Topology in Chaos

Unit Ten Summary Introduction to Dynamical Systems and Chaos

Chaos Control for the Lorenz System

Three-Tank Experiment

Boyce/DiPrima/Meade 11 th ed, Ch 1.1: Basic Mathematical Models; Direction Fields

Research Computing with Python, Lecture 7, Numerical Integration and Solving Ordinary Differential Equations

13 Numerical Solution of ODE s

Math 216 Final Exam 14 December, 2012

Computers, Lies and the Fishing Season

Lesson 9: Diffusion of Heat (discrete rod) and ode45

A New Science : Chaos

Numerical Methods - Preliminaries

Chaos in multiplicative systems

Exploring Nonlinear Oscillator Models for the Auditory Periphery

Discussion of the Lorenz Equations

Math 308 Week 8 Solutions

Extracting beauty from chaos

11 Chaos in Continuous Dynamical Systems.

AIMS Exercise Set # 1

9. Scientific Computing

Do not turn over until you are told to do so by the Invigilator.

Introduction to Dynamical Systems Basic Concepts of Dynamics

Numerical Methods for Ordinary Differential Equations

Integration of Differential Equations

Fundamentals of Fluid Dynamics: Ideal Flow Theory & Basic Aerodynamics

NONLINEAR DYNAMICS AND CHAOS. Numerical integration. Stability analysis

AM 205 Final Project The N-Body Problem

Use of Differential Equations In Modeling and Simulation of CSTR

Streamline calculations. Lecture note 2

+ h4. + h5. 6! f (5) i. (C.3) Since., it yields

IMHO In My Humble Opinion

Solving Systems of ODEs in Python: From scalar to TOV. MP 10/2011

Transcription:

PH36010: Numerical Methods - Evaluating the Lorenz Attractor using Runge-Kutta methods Mr. Benjamen P. Reed (110108461) IMPACS, Aberystwyth University January 31, 2014 Abstract A set of three coupled ordinary differential equations known as the Lorenz equations were evaluated using the Fourth-Order Runge-Kutta method to produce a solution known as the Lorenz Attractor. The parameters of the Lorenz attractor were systematically altered using a FORTRAN program to ascertain their effect on the behaviour of the chaotic system and the possible physical consequences of these changes was discussed. The functionality of the Runge- Kutta method is also considered.

Table of Contents 1. Introduction 3 2. Background Theory and Procedure 4 2.1 Lorenz Equations 4 2.2 Fourth-Order Runge-Kutta. 4 2.3 Evaluating the Lorenz Equations 5 3. Results 6 3.1 Typical Lorenz Attractor 6 3.2 Dependence on sigma σ. 7 3.3 Dependence on beta β 9 3.4 Dependence on rho ρ. 11 4. Discussion 13 5. Conclusion 14 Acknowledgements 14 References 14 Appendixes 15 A. Runge-Kutta Code to Evaluate Lorenz Equations 15 2

1. Introduction Of all the dynamic systems that physics, and the physical sciences describe and model, none are more subtle yet potent than chaotic systems; these are systems whose behaviour is highly sensitive to the initial conditions of that system. One example of a chaotic system is the double rod pendulum, which has a full rotation hinge in the middle of the system, allowing the bottom half of the pendulum to swing quasi-independently of the main pendulum. The high initial condition dependence in these systems has been poetically named the Butterfly effect, after Edward Norton Lorenz s (an American mathematician and meteorologist) work on the Lorenz attractor and his 1972 talk, Predictability: Does the Flap of a Butterfly's Wings in Brazil set off a Tornado in Texas? As a meteorologist, Lorenz investigated the functionality and possibility of performing accurate long-term weather forecasts, and his research demonstrated that even the smallest change in a weather system could have significant effects on the system as it evolved in time. He concluded that any model of any weather system would have to take into account the smallest variations in the weather conditions in order to have a high accuracy; today s weather modelling computers are designed to compute thousands of variables in order to predict the short-term forecast. However, despite all the known variables, there are still just as many unknown variables that have non-periodic or chaotic behaviour, and as such they are intrinsically unpredictable in the long-term. Even smaller systems with considerably less variables, still exhibit this long-term unpredictability (Palmer, 1993). One simple system to exhibit chaotic behaviour is the Lorentz equations, a system of three coupled ordinary differential equations that are a simple and idealistic set of twelve hydrodynamical equations that describe turbulent flow in the atmosphere. When the 3- dimensional coordinates of this system are plotted with time as the independent variable, an interesting graph is observed. For a single point moving around in phase space (i.e. x(t), y(t) and z(t) where t is time), it traces out a curve, or an orbit which always converges and then remains on a surface comprised of two wings. For any initial conditions, the point always and eventually links up with this two-winged surface, and hence it is known generally as an attractor. The attractor created with the Lorenz equations, shown in figure 1, is appropriately named the Butterfly attractor for its appearance and also because it visualises solutions that exhibit the butterfly effect (Taylor, 2011). Figure 1 - A visualisation of the Lorenz attractor in phase space; solution to the Lorenz equations as an orbit in phase space. (Source: http://www.mizuno.org/c/la/img/lorenz_web.jpg) As previously mentioned, the Lorenz attractor can be constructed using three coupled ordinary differential equations, and as such can be modelled with a relatively simple program and a robust graphing client. In this report, the Lorenz attractor for an arbitrary chaotic system is evaluated using a program written in the script-based programming language FORTRAN. The program employs the use of the Fourth-Order Runge-Kutta method in order to solve the Lorenz equation and thus produce useable data. The parameters and variables of the system were changed systematically in order to ascertain their effect on the shape and profile of the butterfly attractor in phase space. This report will also discuss the effectiveness of using the Fourth-Order Runge- Kutta method with coupled ordinary differential equations. 3

2. Background Theory and Procedure 2.1 The Lorenz Equations The Lorenz equations, as written by Edward Lorenz himself are dx dt = σ (y x) (1) dy dt = x(ρ z) y (2) dz dt = xy βz (3) where x, y, and z are variables in phase space and σ, ρ. And β are the constant parameters of the system. It is easy to see in this system, that as one variable of phase space changes, the other two variables in phase space change in response. The parameters in these equations each have physical meanings are not just some mathematical quirk. Sigma σ is called the Prandtl number and is a description of the systems physical characteristics such as viscosity and thermal conductivity in the case of convection flow. Rho ρ represents a control parameter, which is the difference between the extrema driving forces in the system. For the example where the Lorenz attractor is characterising convection in a fluid filled tank, ρ would represent the temperature difference between the top and bottom of the tank. Finally beta β is a value that describes the shape of the box that the Lorenz attractor is contained within. For the convection example, β would be the width-to-height ratio of the convection layer (Stockie & Wong, 2009). 2.2 The Fourth Order Runge-Kutta The Runge-Kutta method is an iterative numerical method for solving systems of coupled ordinary differential equations (CODEs), and is highly considered to be the most accurate numerical method for this purpose for the amount of effort required to code it. It is similar to Euler s method of solving ODEs however whereas Euler s method only evaluates each iterative step at one point, Runge-Kutta evaluates each step at four separate locations as shown by equations 4 to 7. Two evaluations are made at the end points of each interval, and two are made in the middle. F 1 = δtf (y i,t i ) (4)! F 2 = δtf # y i + 1 2 F 1,t i + 1 " 2 δt $ %! F 3 = δtf # y i + 1 2 F,t + 1 2 i " 2 δt $ % & (5) & (6) F 4 = dtf ( y i + F 3,t i +δt) (7) It then combines these solutions into one highly accurate approximation of the function at that point. In essence, this means that any number of time-dependant CODEs can be evaluated by one 4

program and hence data can be formulated for data analysis. The final recombination step is characterised by equation 8, which gives the phase space coordinate at that time step (Süli, 2013). y i+1 = y i + 1 ( 6 F + 2F + 2F + F 1 2 3 4) (8) (N.B. y in equations 4 8 can represent any value in any axis, i.e. y can be x or z. Cartesian coordinates are evaluated separately for each axis, so Runge-Kutta is executed three times for each point in phase space). 2.3 Evaluating the Lorenz Equations To solve the Lorenz equations and thus produce the Lorenz attractor plot, a program was written in FORTRAN, which used the aforementioned Fourth-Order Runge-Kutta method to evaluate the CODEs hence produce useable data in the form of a comma separating variable file. This data was then sent to gnuplot to produce 3-dimensional phase space plots and 2-dimension time dependent graphs of the variables (Press et al., 2007). The full FORTRAN can be viewed in the appendix. To ascertain the effect of parameters on the Lorenz attractor, a default attractor was plotted and then each parameter was adjusted systematically. The attractor was then re-plotted and compared with the original to ascertain what had changed. 5

3. Results 3.1 Typical Lorenz Attractor Figure 2 - A 3D plot of a typical Lorenz attractor in phase space, where σ = 10, β = 8/3, ρ = 28. Figure 3 - A 2D plot of Lorenz attractor phase space coordinates against time, where σ = 10, β = 8/3, ρ = 28. 6

3.2 Dependence on sigma σ Figure 4 - A 3D plot of a typical Lorenz attractor in phase space, where σ = 5, β = 8/3, ρ = 28. Figure 5 - A 2D plot of Lorenz attractor phase space coordinates against time, where σ = 5, β = 8/3, ρ = 28. 7

Figure 6 - A 3D plot of a typical Lorenz attractor in phase space, where σ = 20, β = 8/3, ρ = 28. Figure 7 - A 2D plot of Lorenz attractor phase space coordinates against time, where σ = 20, β = 8/3, ρ = 28. 8

3.3 Dependence on beta β Figure 8 - A 3D plot of a typical Lorenz attractor in phase space, where σ = 10, β =4/3, ρ = 28. Figure 9 - A 2D plot of Lorenz attractor phase space coordinates against time, where σ = 10, β =4/3, ρ = 28. 9

Figure 10 - A 3D plot of a typical Lorenz attractor in phase space, where σ = 10, β =16/3, ρ = 28. Figure 11 - A 2D plot of Lorenz attractor phase space coordinates against time, where σ = 10, β =16/3, ρ = 28. 10

3.4 Dependence on rho ρ Figure 12 - A 3D plot of a typical Lorenz attractor in phase space, where σ = 10, β =8/3, ρ = 14. Figure 13 - A 2D plot of Lorenz attractor phase space coordinates against time, where σ = 10, β =8/3, ρ = 14. 11

Figure 14 - A 3D plot of a typical Lorenz attractor in phase space, where σ = 10, β =8/3, ρ = 56. Figure 15 - A 2D plot of Lorenz attractor phase space coordinates against time, where σ = 10, β =8/3, ρ = 56. 12

4. Discussion Figure 2 shows a typical Lorenz attractor with the parameters σ = 10, β = 8/3, ρ = 28. This 3- dimensional plot, along with its 2-dimensional temporal dependence graph in figure 3 was treated as the control, a reference that could be used to determine the changes in the Lorenz attractor shape as the parameters were altered. The 3d representation in figure 2 was typical of the butterfly wings found in the literature and resource material. Hence, it was assumed that these figures were correct and an accurate demonstration of chaotic flow in atmospheric systems. To infer some physical meaning to the results detailed in section 3, it has been assumed that the Lorenz equations in this situation are characterising the convectional flow of a viscous fluid in a heated tank. The first parameter that was altered was sigma σ, which as mentioned in section 2.1, is the Prandtl number and is a description of the systems physical characteristics of flow. It tells information about the fluid s viscosity and thermal conductivity. Figures 4 and 5 show the situation where the parameter sigma has been halved from it original value. Physically, this means that the viscosity of the fluid is higher, so the fluid takes longer to converge on the attractor surface. Furthermore, once on the surface the flow begins to spiral inwards on only one wing. Figure 5 shows that the movement of one unit of fluid decreases over time, which implies that the flow is so viscous that it actually dampens any movement within it. Conversely, in figures 6 and 7 the viscosity is lower and hence the flow quickly converges on the attractor surface, and onto two wings. Once there, it is able to sweep out large arcs of movement in the decreased viscosity hence why there appears to be no inner orbits within the wings. The second parameter to be altered was beta β, which characterises the width-to-height ratio of the convection layer. Intuition infers that a smaller width in the convection zone means that flow will frequently switch between one wing of the attractor surface and the other. Whereas a larger width in the convection zone will mean that flow will switch attractor wings frequently, if at all. The figures in section 3.3 seem to agree with this intuition, with the 2D temporal dependence graphs demonstrating this much more clearly. Figure 9 shows the temporal dependence of the flow when the width-to-height ratio is low; the x(t) and y(t) frequently change phase which implies that the flow is moving through the convection zone frequently and changing which wing it orbits. On the other hand, figure 10 where β is double the control parameter, shows that once the flow is orbiting one wing, it never switches over to other wing, implying that the width of the convection zone is so large, that flow cannot or rarely passes into it. Finally, the last parameter rho ρ details the temperature difference between the top and the bottom of the tank. It is expected that a large difference in temperature between the top and the bottom of the tank will give rise to a large flow rate with frequent changes in attractor orbit. The system would also take an extended period of time to reach equilibrium and so the flow rate would continue to be rapid for a long time. With a small temperature difference, the thermal driving forces would be reduced and the system would reach equilibrium relatively faster. This is certainly what seems to be happening in figures 12 and 13. The low thermodynamic driving force means that the flow hardly changes orbit, or in this case, doesn t at all. Furthermore, once equilibrium is reached, all macroscopic movement stops as shown by figure 13 and the system tends toward equilibrium, a dampening effect is observed much like in figure 5. From this discussion, it is apparent that small changes in the Lorentz attractor system give rise to large macroscopic effects. The Runge-Kutta method has illustrated these changes well and is a very suitable method to use in the modelling of chaotic systems. It does not appear to show signs of divergence, a common issue in the simpler Euler s method, and so confidence is high that there is minimal error in the Lorentz modelling. 13

5. Conclusion A model of the Lorenz attractor has been constructed using the Runge-Kutta method to solve the Lorenz equations, a set of three coupled ordinary differential equations that describe chaotic flow in atmospheric or hydrodynamic systems. The modelling proved to be successful and the Lorenz equation parameters were varied to ascertain their effect on the behaviour of the system. It was found that small changes to these parameters could have huge effects on the dynamics of the system, either making it more chaotic, or taming it such that the flow rate of the system tends to zero. In the cases where the flow rate tended to zero, the parameters gave rise to an unstable system where the dynamics could not be maintain for an extended period of time. Conversely, in the situations where the flow became more chaotic, the system remained stable and the orbits of the attractor surface were more pronounced. In respect to the numerical method employed, the Runge-Kutta method performed well and produced an accurate, stable model in which to observe the Lorenz attractor. Acknowledgements The author would like to extend their gratitude to Dr. Martin Wilding for the tuition he provided during the course, and for taking time out of his own schedule to give students on the course the time necessary to provide work of their best effort. The author would also like to thank Mr. Patrick Dixon, Mr. Andrew Leonard and Mr. Tom Knight for helping to run the module and provide lessons in effective coding. Finally, the author would like to thank Miss. Carley Martin, Miss. Fffion Whitehouse and Miss. Rose Cooper for providing much needed discussion and support during the module. References Palmer, T., 1993. Exploring Chaos: A Guide to the New Science of Disorder. London: W. W. Norton & Co. Press, W.H., Teukolsky, S.A., Vetterling, W.T. & Flannery, B.P. 2007. Numerical Recipes: The Art of Scientific Computing. 3rd ed. Cambridge: Cambridge Press. Stockie, J. & Wong, K., 2009. A Simple Model of the Unpredictability of Weather: The Lorenz Equations. Clouds, Aerosols and Climate Feedback Publications. Available at: <http://clouds.eos.ubc.ca/~phil/numeric/labs/lab6/lab6.pdf> [Accessed 30 January 2014] Süli, E. 2013. Numerical Solution of Ordinary Differential Equations. [pdf] Mathematical Institute, University of Oxford. Available at: <http://people.maths.ox.ac.uk/suli/nsodes.pdf> [Accessed 30 January 2014] Taylor, R.L.V., 2011. Attractors: Nonstrange to Chaotic. SIAM Undergraduate Research Online, 4. 14

A Runge-Kutta Code to Evaluate Lorenz Equations PROGRAM lorentz IMPLICIT NONE INTEGER :: i INTEGER,PARAMETER :: npars=3,nvars=3,nits=50000 REAL,DIMENSION(npars) :: pars REAL,DIMENSION(nvars) :: yo REAL,DIMENSION(nits+1) :: tout REAL,DIMENSION(nvars,nits+1) :: yout REAL :: to,tf,dt!define parameters! PRINT*, "Please input the parameter sigma (default: 10)"! READ*, pars(1)! PRINT*, "Please input the parameter beta (default: 8/3)"! READ*, pars(2)! PRINT*, "Please input the parameter rho (default: 28)"! READ*, pars(3) pars(1) = 10.0 pars(2) = 8.0/3.0 pars(3) = 56.0!define yo yo(1) = - 10.0 yo(2) = - 10.0 yo(3) = - 5.0!define to to = 0.0 tf = 30.0!Working out dt dt = (tf- to)/nits!calling subroutine rungeit CALL rungeit(nvars,yo,to,dt,npars,pars,nits,yout,tout) OPEN(UNIT=10,FILE='lorentz.csv',FORM='FORMATTED',ACTION='WRITE') DO i = 1,nits+1 WRITE(UNIT=10,FMT='(F13.5,A3,F13.5,A3,F13.5,A3,F13.5)') tout(i), " ", yout(1,i), " ", yout(2,i), " ", yout(3,i) END DO CLOSE(10) END PROGRAM Lorentz!===============================================================!Subroutine of the function we wish to solve for!narvs - number of eqns we're solving for.!yin - narvs element array of solution at current time.!t - the current time!npars - number of parameters/constants in the equations!pars - npars element array containing the constants!yout - nvars element array of the solution at new time SUBROUTINE fy(nvars,yin,t,npars,pars,yout) IMPLICIT NONE INTEGER, INTENT(IN) :: nvars, npars REAL, INTENT(IN), DIMENSION(nvars) :: yin REAL, INTENT(IN), DIMENSION(npars) :: pars REAL, INTENT(IN) :: t REAL, INTENT(INOUT), DIMENSION(nvars) :: yout yout(1) = pars(1)*(yin(2)- yin(1)) yout(2) = yin(1)*(pars(3)- yin(3))- yin(2) yout(3) = (yin(1)*yin(2))- (pars(2)*yin(3)) END SUBROUTINE fy!==============================================================!subroutine to perform the Runge- Kutta steps SUBROUTINE rungestep(nvars,yin,to,dt,npars,pars,yout) IMPLICIT NONE 15

INTEGER, INTENT(IN) :: nvars, npars REAL, INTENT(IN), DIMENSION(nvars) :: yin REAL, INTENT(IN), DIMENSION(npars) :: pars REAL, INTENT(IN) :: dt, to REAL, INTENT(INOUT), DIMENSION(nvars) :: yout REAL, DIMENSION(nvars) :: f1, f2, f3, f4, ytemp!first step CALL fy(nvars,yin,to,npars,pars,ytemp) f1 = dt*ytemp!second step CALL fy(nvars,yin+f1/2.0,to+dt/2.0,npars,pars,ytemp) f2 = dt*ytemp!third step CALL fy(nvars,yin+f2/2.0,to+dt/2.0,npars,pars,ytemp) f3 = dt*ytemp!forth step CALL fy(nvars,yin+f3,to+dt,npars,pars,ytemp) f4 = dt*ytemp!collecting steps together yout = yin+((f1+2.0*f2+2.0*f3+f4)/6.0) END SUBROUTINE rungestep!============================================================ SUBROUTINE rungeit(nvars,yo,to,dt,npars,pars,nits,yout,tout) IMPLICIT NONE INTEGER, INTENT(IN) :: nits,nvars,npars REAL, INTENT(IN), DIMENSION(nvars) :: yo REAL, INTENT(IN), DIMENSION(npars) :: pars REAL, INTENT(IN) :: dt, to REAL, INTENT(INOUT), DIMENSION(nvars,nits+1) :: yout REAL, INTENT(INOUT), DIMENSION(nits+1) :: tout INTEGER :: i!put the initial conditions into the output array tout(1) = to yout(:,1) = yo!iterate thro all timesteps, taking a new step from the previous!result. Note the suroutine call to eulermodstep is different to the!function call in the 1D case DO i = 2, nits+1 tout(i) = tout(i- 1) + dt CALL rungestep(nvars,yout(:,i- 1),tout(i- 1),dt,npars,pars, & & yout(:,i)) END DO END SUBROUTINE rungeit!====================================================================== 16