All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Early warning system: Early warning system is an adaptive measure for climate change, using integrated communication systems to help communities prepare for hazardous climate-related events. A successful EWS saves lives and jobs, land and infrastructures…
Rathish TJ
updated on 07 Mar 2022
Early warning system:
Early warning system is an adaptive measure for climate change, using integrated communication systems to help communities prepare for hazardous climate-related events. A successful EWS saves lives and jobs, land and infrastructures and supports long-term sustainability.
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 7 16:28:04 2022
@author: DELL
"""
# import libraries
import numpy as np
import pandas as pd
from scipy import integrate
import matplotlib.pyplot as plt
# show plots in notebook
#parameters
df = pd.read_csv('NSE-TATAGLOBAL11.csv')
# looking at the first five rows of the data
print(df.head())
print('\n Shape of the data:')
print(df.shape)
a = 0.7
b = 1.
r = 0.2
h = 1. # half-saturation value
# take high p for steep Hill-function
p = 12
# determine strength of noise
sigma = 0.1
# define the system in a function
def Sys(X, t=0):
# X[0] = x and x[1] = y
return np.array([a - b * X[0] + r *(X[0]**p / (X[0]**p + h**p))])
# generate 1000 linearly spaced numbers for x-axes
t = np.linspace(1, 10, 1000)
# initial value for X: 1
Sys0 = np.array([1])
# prepare plots
fig = plt.figure(figsize=(15,5))
ax1 = fig.add_subplot(1,1,1)
# loop through various r values
while r <= 1:
# integrate system
X, infodict = integrate.odeint(Sys, Sys0, t, full_output=True)
#generate noise, sigma * x * dW
noise = sigma * np.random.normal(0, 0.1, 1000)
# transform x and y, and add noise
x = X.T + noise*X.T
# plot
ax1.plot(x[0], label = 'r = %0.1f' % r)
# increment r
r += 0.2
# determine plotting specifics
ax1.grid()
ax1.legend(loc='best')
ax1.set_xlabel('time')
ax1.set_ylabel('Nutrient load')
ax1.set_title('Dynamics in time (parameter r)')
#critical slowing down (parameter r)
fig = plt.figure(figsize=(15,5))
ax2 = fig.add_subplot(1,1,1)
# reduce strength of noise to make differences more distinct
sigma = 0.01
x = np.linspace(400, 2000, 1600)
dt = 0.01
r = 0.2
# loop through various r values
while r < 0.6:
P = []
P.append(1)
i = 0
while (i < 2000):
# perturb only when equilibrium is reached, here after 500 timesteps
if i == 500:
P[i] = P[i - 1] + 0.5
# the difference equation with noise added
P.append(P[i] + (a - b * P[i] + r * (P[i]**p / (P[i]**p + h**p))) * dt + sigma * P[i] * np.random.normal(0, 0.1))
i += 1
ax2.plot(x, P[400:2000], label = 'r = ' + str(r) + ', distance to tipping point = %0.1f' % (0.6 - r))
r += 0.1
ax2.grid()
ax2.legend(loc='best')
ax2.set_xlabel('time')
ax2.set_title('Critical slowing down (parameter r)')
To start with, the following Python code generates a plot which shows that this model too has alternative stable states, depending on the parameter rr (for the nutrient recycling rate). Other than in the analyzing chapter, we add a small amount of noise to the development to let the behavior become a bit more realistic. The amplitude of this noise is determined by a parameter σσ.
The most prominent indicator in the conception of EWS is critical slowing down suggesting that a decreasing rate of recovery from small perturbations predicts the approachment of a tipping point (i.e. a critical transition). The next piece of Python-code generates a plot showing the above development with a small perturbation applied after reaching equilibrium (at timetime = 500). Testing different rr-values, the plot shows that recovery time increases with decreasing distance to the tipping point. In this case, in order to be able to intervene, the system is modeled in the form of a difference equation.
Another noticable Early Warning Signal is a system's back and forth oscillation between two stable states close to a critical transition. This oscillation has been called flickering and was observed among others on the model of lake eutrophication (Wang et al. 2012). In the following calculation we increase rr slowly and plot the system at timetime = 800. in order to show that flickering is noise-induced, we add a second curve (red) to the plot showing the same dynamics without added noise.
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Project 2
Early warning system: Early warning system is an adaptive measure for climate change, using integrated communication systems to help communities prepare for hazardous climate-related events. A successful EWS saves lives and jobs, land and infrastructures…
07 Mar 2022 11:35 AM IST
Project 1
Preprocessing data: The stock market data is taken and the values at the start and close of the working hours are considered and the data are preprocessed to get a valid model for predicting the outcomes. # importing libraries import pandas as pd import numpy…
05 Mar 2022 06:23 AM IST
Project 2
Torque-speed characteristics: The torque-speed characteristics of a 3-phase motor is defined as the curve plotted between torque developed and rotational speed of the motor. It gives the information about variation in the motor torque with the change in its speed. The characteristic is obtained from…
02 Feb 2022 10:05 AM IST
Project 1
1)Stationary d-q reference frame: In this reference frame the d-axis is fixed to and thus coincident with the axis of the stator phase A winding. This means that the mmf wave of the stator moves over this frame at the same speed as it does over the stator phase A windings.…
27 Jan 2022 10:27 AM IST
Related Courses
0 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.