dynamic simulation models is r powerful enough
play

Dynamic simulation models is R powerful enough? - PowerPoint PPT Presentation

Faculty Faculty of of Forest Forest- -, Geo , Geo- - and and Hydrosciences Hydrosciences, Institute of , Institute of Hydrobiology Hydrobiology Faculty Faculty of of Forest Forest - - , Geo , Geo - - and and Hydrosciences


  1. Faculty Faculty of of Forest Forest- -, Geo , Geo- - and and Hydrosciences Hydrosciences, Institute of , Institute of Hydrobiology Hydrobiology Faculty Faculty of of Forest Forest - - , Geo , Geo - - and and Hydrosciences Hydrosciences , Institute of , Institute of Hydrobiology Hydrobiology Dynamic simulation models – is R powerful enough? Thomas.Petzoldt@TU-Dresden.de

  2. dN  − N  Dynamic models … 1 = ⋅ ⋅ r N   dt K   • … models that respect time explicitly . • used in many fields: mathematics, physics, chemistry, biology, ecology, engineering, economics… • "What makes using system dynamics different from other approaches to studying complex systems is the use of feedback loops and stocks and flows . These elements help describe how even seemingly simple systems display baffling nonlinearity . http://en.wikipedia.org/wiki/System_dynamics

  3. Example 1: A Lotka-Volterra-type model Substrate Producer Consumer Source Sink P S K Import b c d e f dS = − ⋅ ⋅ import b S P dt dP = ⋅ ⋅ − ⋅ ⋅ c S P d P K dt dK = ⋅ ⋅ − ⋅ e P K f K dt

  4. The LV-type model in R ������� � ������� �� � ���������� ��������������� ���������� ������� ������� ��������� ���� ������� ������� � � � � ���������� ���������� ����� ����� ����� ����� �� �� ����� ����� ���� ���� ���������������������������� �������������������� �������������������� �������������������� �������� �������� �������� ������ ������ ������ ������ � � �� � � ������� � � ������� �������� ������� � � � �� �� � �� � ������ ������ � � ����� ����� �� �� � � � � ������ ������ � � ����� ����� �� �� �� �� � � � �� � ����� � � ����� ����� ����� � � �� �� � � �� �� �� �� �� �� � � � � � � � �� � ���� � � ���� ���� ���� � � �� � � �� �� �� ��������� ����������� ��������� ��������� �� ���� �� ���� �� �� �� ��� �� � � � �� �� �� �� !� !� !� !� ! ! ! ! "����������� "� ������������ ��������� ������� ������ ������ ����� ���������� ����� # # "� "� ���������� ���������� �� �� ������� ������� ������ ������ ����� ����� ����� ����� # # "� "� "�# "� # # # ���� ���� ���� �������� ���� ���� ���� ���� ������ ���� ���� �� ����$ �� ��$ ��$ ��$�� �� �� ��������$���� ������$���� ������$���� ������$���� ��$��� ��$��� ��$��� ��$��� ��$��� ��$��� � �� � ������������$���%����� ������������$���%������� ����$���%������ ��$���%������� � ��$��� ��$��� � � � � ������������$���%����� ������������$���%����� �� �� ��$���%������ ��$���%������ � � ����� ����� ����� ������ � � � ���������� ������������ ���������� ���������� �� ������� �� ����� ����� ������� �� �� ��������� ������� ������� ��������� ������� �� �� ����� ����� ������� �� �� �������&��$��� �����&��$��� �����&��$��� �����&��$���� � � � package deSolve (Soetaert, Petzoldt, Setzer)

  5. Benchmark dS = − ⋅ ⋅ import b S P dt dP = ⋅ ⋅ − ⋅ ⋅ c S P d P K dt dK = ⋅ ⋅ − ⋅ e P K f K dt CPU time 3 equations (ODEs) in R, 1000 (external) timesteps case A: interpolated input (approxfun) • ………… 1.4 s • case B: import <- if (trunc(t) %% 2 == 0) 0 else 0.1 ………… 0.8 s Time is ok for this toy model, but is R suited for more complex simulations? 3 ODEs = 1 s � � � spatial system with 10.000 ODEs > 1 hour? �

  6. Example 2: A stream model Experimentally manipulated small stream of our limnological workgroup � Hamburg 500 km Elbe River Dresden 20 km � Experimental Range 650m � Rennes 1200 km

  7. Downward drift of water insects in the stream (Mayflies) Is buffer stretch sufficiently long? 3) Fish treatment 2) Buffer stretch with fish > drift drift nofish fish 1) Reference Fences Fences Fences Fences no fish v flow up down Water Sediment

  8. Can be described by a basic PDE model ∂ ∂ M M Mobile Organisms = ⋅ − ⋅ − ⋅ up S down M v ∂ ∂ t x dS = − ⋅ + ⋅ up S down M Sessile Organisms dt v flow up down Water Sediment x x x dx 1 2 n

Recommend


More recommend