text:
Sampling Raster Values at Specific Coordinates with Python by@boa

# Sampling Raster Values at Specific Coordinates with Python

## Too Long; Didn't Read

A comprehensive tutorial for sampling raster values at specific geographic coordinates with PyGMT and plotting a linear regression of the data with Seaborn. Highlights include: - Automatically downloading files from the SoilWeb site in chunks - Reprojecting the coordinate systems to WGS84 - Sampling raster values with specific geographic coordinates - Plotting a linear regression with marginal histograms and density curves - Customized regression line color and axis label text font

### @boa

First Try

Learning new things and sharing them

LEARN MORE ABOUT @BOA'S EXPERTISE AND PLACE ON THE INTERNET.

## Background

Sampling values of a raster at specific geographic coordinates can be done with a number of Python libraries, but I believe the task is most easily accomplished with the geospatial library PyGMT. One common reason to do this is for correlating raster values with sample data.

## The Demonstration

In this tutorial, raster models of soil depth and soil water holding capacity for the United States will be sampled at random geographic coordinates within the state of Colorado. A linear regression of the data will then be plotted to show what relationship*, if any, exists between the datasets. This comprehensive tutorial covers every step from data acquisition to plotting a graph.

Please keep in mind that with the exception of the folder creation script, all code blocks shown in this demo are intended to be run as part of a complete script, which is included at the bottom of the page.

*This tutorial makes no attempt to interpret the regression plot, nor does it assert the accuracy of the results. It is created purely to demonstrate what might be done with values sampled from rasters at specific geographic coordinates.

## Getting Started

### Create Project Folders

To follow this demo as written, project folders need to be created on the Desktop. A diagram of the desired directory tree for Windows 10 is shown below:

Created with Lucidchart

These folders can be created either by running the script provided below from anywhere after changing the main_dir file path to reflect your username, or by manually creating a Grid_Track_Demo folder and within it Data, Methods, and Results folders.

'''
Decription:
This script creates project folers if they don't already exist
'''

import os

# main directory path
main_dir = r'C:\Users\USER\Desktop\Grid_Track_Demo'

# path to the directory holding the project data files
data_folder = os.path.join(main_dir, 'Data')

# path to the directory holding the project Python scripts
methods_folder = os.path.join(main_dir, 'Methods')

# path to the directory holding the map generated by the scripts
results_folder = os.path.join(main_dir, 'Results')

directories = [main_dir, data_folder, methods_folder, results_folder]

# Iterates through the list of directories and creates them if they don't already exist
for directory in directories:
os.makedirs(directory, exist_ok = True)

Data files used and created by the demo script will be located in the Data folder, and the linear regression graph will save to the Results folder. The Methods folder should contain the demo scripts.

## Create Project Files

After creating the project folders, we need to download the rasters that will be used in this demo. This tutorial uses raster models of soil depth and available water holding capacity acquired from the UC Davis SoilWeb website.

While these files aren’t very large, it is good practice to download them in chunks so that larger files can be downloaded if needed in the future; this is done in the demo script function below:

    # automatically downloads soil depth and avalible water holding capacity rasters from the UC Davis SoilWeb website
import requests
import os

# urls of the rasters to be downloaded
file_urls = {
'soil_depth':'https://soilmap2-1.lawr.ucdavis.edu/800m_grids/rasters/soil_depth.tif',
'water_capacity':'https://soilmap2-1.lawr.ucdavis.edu/800m_grids/rasters/water_storage.tif'
}

for name, url in file_urls.items():

# creates a response object, but because stream is set to True it only downloads the response headers, while keeping the connection open
r = requests.get(url, stream = True)

file_save_name = os.path.join(main_dir, 'Data', '{}.tif'.format(name))

# downloads a portion of the file data that is 1024 bytes large, writes it to the file, and repeats this until the whole file is downloaded
with open(file_save_name, 'wb') as tif:
for chunk in r.iter_content(chunk_size=1024):
if chunk:
tif.write(chunk)

### Generate Random Coordinates

In the absence of real observations at specific coordinates, random coordinates are generated to sample the two rasters. The state of Colorado is chosen as the region in which the random coordinates are generated because it is a square and as such, is easy to define.

This demo script function generates random coordinates within the state of Colorado and saves them to a CSV file:

    # generates a set number of random coordinates within the state of Colorado, then saves them to a CSV file
def Get_Random_Land_Coordinates(self):
import random
import pandas as pd
import os

# creates the dataframe that will hold the coordinates
df_random_coordinates = pd.DataFrame(columns = ['longitude', 'latitude'])
# number of random coordinates to generate
n_random_coordinates = 500

for i in range(n_random_coordinates):
# random longitude
lon = random.uniform(-109.03711, -102.05859)
lon = round(lon, 5)
# random latitude
lat = random.uniform(37.01855, 41.00789)
lat = round(lat, 5)

# adds the coordinates to the dataframe
df_random_coordinates = df_random_coordinates.append({'longitude':lon, 'latitude':lat}, ignore_index=True)

random_us_land_coordinates = os.path.join(main_dir, 'Data', 'random_us_land_coordinates.csv')
df_random_coordinates.to_csv(random_us_land_coordinates, sep='\t', index=False)

### Reproject Rasters

In order to demonstrate how to reproject a coordinate reference system (CRS) from one type to another, and because the bounds for the random coordinates were originally derived from a WGS84 web map, we will reproject the rasters from their native CRS to WGS84 so our random coordinates can be used to sample the data. Permanently transforming a raster isn’t ideal because doing so can introduce inaccuracies, but in this particular case that concern isn’t overly important as this a demo of how it could be done if needed.

This demo script function reprojects the rasters to the WGS84 coordinate system and saves them as new GeoTIFF files:

    # reprojects the rasters so they are in the WGS84 / Pseudo-Mercator geographic coordinate system, which will allow GPS coordinates to be used to extract values from them (https://gis.stackexchange.com/questions/346745/how-to-reproject-raster-image-from-wgs84-pseudo-mercator-to-ecef-to-enu-in-pytho)
def Reproject_Rasters(self):
import rioxarray
import os

models = ['soil_depth','water_capacity']

for model in models:

model_input = os.path.join(main_dir, 'Data', '{}.tif').format(model)

# opens the raster
rds = rioxarray.open_rasterio(model_input)

# sets the coordinate system that the raster will be reprojected to
crs = 'EPSG:4326'

# reprojects the raster to the desired coordinate system
projected = rds.rio.reproject(crs)

model_output = os.path.join(main_dir, 'Data', '{}_epsg{}_reprojected.tif').format(model, crs)

# saves the reprojected raster as a raster
projected.rio.to_raster(model_output)

## Sample Raster Values

Now that the rasters are in the correct projection, they can be sampled with the previously generated coordinates.

This demo script function loops over each raster and samples it at the randomly generated coordinates. A bilinear interpolation is used when doing so because the data is not categorical. Once both rasters have been sampled, the data is saved to a CSV file:

    # extracts values from the rasters at the previously generated random coordinates, then combines the data into a single dataframe and saves it as a CSV file
def Extract_Values(self):
import pygmt
import pandas as pd
import os

soil_depth_data = os.path.join(main_dir, 'Data', 'soil_depth_epsg4326_reprojected.tif')
water_capacity_data = os.path.join(main_dir, 'Data', 'water_capacity_epsg4326_reprojected.tif')
rasters = {'soil_depth':soil_depth_data, 'water_capacity':water_capacity_data}

coordinates = os.path.join(main_dir, 'Data', 'random_us_land_coordinates.csv')
df_coordinates = pd.read_csv(coordinates, sep='\t')

# dataframe that will hold the values extracted from both rasters
df_unified_raster_data = pd.DataFrame()
df_unified_raster_data['longitude'] = df_coordinates.longitude
df_unified_raster_data['latitude'] = df_coordinates.latitude

# iterates through each raster and extracts data from them using the random coordinates, then adds the data to the df_unified_raster_data dataframe
for name, raster in rasters.items():

# creates a dataframe of the random coordinates and the values of the raster at those coordinates
df_track = pygmt.grdtrack(
# reads a dataframe of only longitudes and latitudes to get coordinates
points = df_coordinates,
# reads the raster
grid = raster,
# uses bilinear because soil depth and avalible water holding capacity are not catagorical
interpolation = 'l',
# name of the column in the new "df_track" dataframe that will hold the extracted raster values
newcolname = name
)

# adds the extracted raster values to the unified dataframe
df_unified_raster_data[name] = df_track[name]

unified_raster_data_output = os.path.join(main_dir, 'Data', 'unified_raster_data.csv')
df_unified_raster_data.to_csv(unified_raster_data_output, sep='\t', index=False)

## Create Linear Regression Graph

Now that we have our data, it’s time to visualize it. Linear regressions are a common way to explore potential relationships between datasets, so that’s what will be plotted next.

This demo script function uses the Python library Seaborn to create a scatter-plot of available water holding capacity as a function of soil depth. A linear regression of the data is then plotted on top of it and histograms with density curves are displayed in the margins.

    # creates a scatter plot of avalible water holding capacity as a function soil depth, and plots a linear regression line through the points. Histograms are plotted in the margins of the graph
def Create_Graph(self):
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import os

unified_raster_data = os.path.join(main_dir, 'Data', 'unified_raster_data.csv')

df_unified_raster = pd.read_csv(unified_raster_data, sep='\t')
df_unified_raster = df_unified_raster.dropna()

# sets the data for independant variable
x = df_unified_raster.soil_depth
# sets the data for the dependant variable
y = df_unified_raster.water_capacity

# sets the color plaette for the graph background
sns.set_style("darkgrid")

# creates a scatter plot with a linear regression line. Histograms are plotted in the margins and have a density curve plotted over the bins
g_reg = sns.jointplot(
data = df_unified_raster,
x = x,
y = y,
# plots a linear regression line
kind = "reg",
# sets the regression line and confidence interval color to something other than the default blue
line_kws = {'color':'red'},
# sets the scatterplot point opacity and size <opacity><size>
joint_kws = {'scatter_kws':dict(alpha=0.5, s=15)},
)

# creates rug plots at the bottom of each marginal histogram to more show a more granual data distribution
g_reg.plot_marginals(
# creates a rug plot
sns.rugplot,
color='royalblue',
# sets the height of the rug plot lines
height=.05,
)

# replaces the automatically applied axis labels with custom ones using bold font
g_reg.ax_joint.set_xlabel('$\\bf{Soil\ Depth\ (cm)}$')
g_reg.ax_joint.set_ylabel('$\\bf{Avail.\ Water\ Holding\ Capacity\ (cm)}$')

graph_output = os.path.join(main_dir, 'Results', 'soil-depth_vs_water_capacity_linear_regression_demo.png')
# dpi is the resolution of the saved image
plt.savefig(graph_output, dpi=150)

## Result

This tutorial makes no attempt to interpret the regression plot, nor does it assert accuracy of the results.

I hope this tutorial has been helpful for anyone looking to sample values from rasters using specific coordinates.

## Complete Code

'''
PyGMT v0.4.1

This script domonstrates how to extract values from rasters using specific coordinates and then apply the values to explore the relationship between soil depth and avalible water holding capacity.

The script automatically downloads rasters of soil depth and avalible water holding capacity for the contiguous continential United States from the University of California, Davis SoilWeb website.
It then reprojects the rasters to the WGS84 geographic coordinate system so that gps coordinates can be used to pull data from it. Next, random coordinates are generated within the extent of the state of Colorado,
and they are used to extract values from the two rasters. Finally, the values are regressed against each other and plotted on a graph.
'''

# main directory for the demo files
main_dir = r'C:\Users\USER\Desktop\Grid_Track_Demo'

# controls whether the project rasters are automatically downloaded
# controls whether the rasters are reprojected
reproject_rasters = True
# controls whether a CSV of random coordinates within the state of Colorado is created
get_random_coordinates = True

# class that holds all the functions related to extracting values from rasters with specific coordinates
class Grid_Track():

# automatically downloads soil depth and avalible water holding capacity rasters from the UC Davis SoilWeb website
import requests
import os

# urls of the rasters to be downloaded
file_urls = {
'soil_depth':'https://soilmap2-1.lawr.ucdavis.edu/800m_grids/rasters/soil_depth.tif',
'water_capacity':'https://soilmap2-1.lawr.ucdavis.edu/800m_grids/rasters/water_storage.tif'
}

for name, url in file_urls.items():

# creates a response object, but because stream is set to True it only downloads the response headers, while keeping the connection open
r = requests.get(url, stream = True)

file_save_name = os.path.join(main_dir, 'Data', '{}.tif'.format(name))

# downloads a portion of the file data that is 1024 bytes large, writes it to the file, and repeats this until the whole file is downloaded
with open(file_save_name, 'wb') as tif:
for chunk in r.iter_content(chunk_size=1024):
if chunk:
tif.write(chunk)

# generates a set number of random coordinates within the state of Colorado, then saves them to a CSV file
def Get_Random_Land_Coordinates(self):
import random
import pandas as pd
import os

# creates the dataframe that will hold the coordinates
df_random_coordinates = pd.DataFrame(columns = ['longitude', 'latitude'])
# number of random coordinates to generate
n_random_coordinates = 500

for i in range(n_random_coordinates):
# random longitude
lon = random.uniform(-109.03711, -102.05859)
lon = round(lon, 5)
# random latitude
lat = random.uniform(37.01855, 41.00789)
lat = round(lat, 5)

# adds the coordinates to the dataframe
df_random_coordinates = df_random_coordinates.append({'longitude':lon, 'latitude':lat}, ignore_index=True)

random_us_land_coordinates = os.path.join(main_dir, 'Data', 'random_us_land_coordinates.csv')
df_random_coordinates.to_csv(random_us_land_coordinates, sep='\t', index=False)

# reprojects the rasters so they are in the WGS84 geographic coordinate system, which will allow GPS coordinates to be used to extract values from them (https://gis.stackexchange.com/questions/346745/how-to-reproject-raster-image-from-wgs84-pseudo-mercator-to-ecef-to-enu-in-pytho)
def Reproject_Rasters(self):
import rioxarray
import os

models = ['soil_depth','water_capacity']

for model in models:

model_input = os.path.join(main_dir, 'Data', '{}.tif').format(model)

# opens the raster
rds = rioxarray.open_rasterio(model_input)

# sets the coordinate system that the raster will be reprojected to
crs = 'EPSG:4326'

# reprojects the raster to the desired coordinate system
projected = rds.rio.reproject(crs)

model_output = os.path.join(main_dir, 'Data', '{}_epsg{}_reprojected.tif').format(model, crs)

# saves the reprojected raster as a raster
projected.rio.to_raster(model_output)

# extracts values from the rasters at the previously generated random coordinates, then combines the data into a single dataframe and saves it as a CSV file
def Extract_Values(self):
import pygmt
import pandas as pd
import os

soil_depth_data = os.path.join(main_dir, 'Data', 'soil_depth_epsg4326_reprojected.tif')
water_capacity_data = os.path.join(main_dir, 'Data', 'water_capacity_epsg4326_reprojected.tif')
rasters = {'soil_depth':soil_depth_data, 'water_capacity':water_capacity_data}

coordinates = os.path.join(main_dir, 'Data', 'random_us_land_coordinates.csv')
df_coordinates = pd.read_csv(coordinates, sep='\t')

# dataframe that will hold the values extracted from both rasters
df_unified_raster_data = pd.DataFrame()
df_unified_raster_data['longitude'] = df_coordinates.longitude
df_unified_raster_data['latitude'] = df_coordinates.latitude

# iterates through each raster and extracts data from them using the random coordinates, then adds the data to the df_unified_raster_data dataframe
for name, raster in rasters.items():

# creates a dataframe of the random coordinates and the values of the raster at those coordinates
df_track = pygmt.grdtrack(
# reads a dataframe of only longitudes and latitudes to get coordinates
points = df_coordinates,
# reads the raster
grid = raster,
# uses bilinear because soil depth and avalible water holding capacity are not catagorical
interpolation = 'l',
# name of the column in the new "df_track" dataframe that will hold the extracted raster values
newcolname = name
)

# adds the extracted raster values to the unified dataframe
df_unified_raster_data[name] = df_track[name]

unified_raster_data_output = os.path.join(main_dir, 'Data', 'unified_raster_data.csv')
df_unified_raster_data.to_csv(unified_raster_data_output, sep='\t', index=False)

# class that holds all the functions pretaining to graphing the data
class Create_Graphs():

# creates a scatter plot of avalible water holding capacity as a function soil depth, and plots a linear regression line through the points. Histograms are plotted in the margins of the graph
def Create_Graph(self):
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import os

unified_raster_data = os.path.join(main_dir, 'Data', 'unified_raster_data.csv')

df_unified_raster = pd.read_csv(unified_raster_data, sep='\t')
df_unified_raster = df_unified_raster.dropna()

# sets the data for independant variable
x = df_unified_raster.soil_depth
# sets the data for teh dependant variable
y = df_unified_raster.water_capacity

# sets the color plaette for the graph background
sns.set_style("darkgrid")

# creates a scatter plot with a linear regression line. Histograms are plotted in the margins and have a density curve plotted over the bins
g_reg = sns.jointplot(
data = df_unified_raster,
x = x,
y = y,
# plots a linear regression line
kind = "reg",
# sets the regression line and confidence interval color to something other than the default blue
line_kws = {'color':'red'},
# sets the scatterplot point opacity and size <opacity><size>
joint_kws = {'scatter_kws':dict(alpha=0.5, s=15)},
)

# creates rug plots at the bottom of each marginal histogram to more show a more granual data distribution
g_reg.plot_marginals(
# creates a rug plot
sns.rugplot,
color='royalblue',
# sets the height of the rug plot lines
height=.05,
)

# replaces the automatically applied axis labels with custom ones using bold font
g_reg.ax_joint.set_xlabel('$\\bf{Soil\ Depth\ (cm)}$')
g_reg.ax_joint.set_ylabel('$\\bf{Avail.\ Water\ Holding\ Capacity\ (cm)}$')

graph_output = os.path.join(main_dir, 'Results', 'soil-depth_vs_water_capacity_linear_regression_demo.png')
# dpi is the resolution of the saved image
plt.savefig(graph_output, dpi=150)

grid_track = Grid_Track()

for function, toggle in toggles.items():
if toggle == True:
function()

grid_track.Extract_Values()

graph = Create_Graphs()
graph.Create_Graph()

#### RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa


text:
# Alternative implies powers up to the fifth are well-defined

This article gives the statement and possibly, proof, of an implication relation between two magma properties. That is, it states that every magma satisfying the first magma property (i.e., alternative magma) must also satisfy the second magma property (i.e., magma in which powers up to the fifth are well-defined)
View all magma property implications | View all magma property non-implications
Get more facts about alternative magma|Get more facts about magma in which powers up to the fifth are well-defined

## Statement

Suppose $(S,*)$ is an alternative magma, i.e., it satisfies the following two identities:

$x * (x * y) = (x * x) * y \ \forall \ x,y \in S$

and

$x * (y * y) = (x * y) * y \ \forall \ x,y \in S$

These are respectively termed the left-alternative law and right-alternative law.

Then cubes, fourth powers, and fifth powers are well-defined in $S$. In other words, if $x^2$ denotes $x*x$, we have the following for all $a \in S$:

1. Cubes are well-defined: $a^2 * a = a * a^2$, and this is denoted as $a^3$.
2. Fourth powers are well-defined: $a^3 * a = a^2 * a^2 = a * a^3$, and this is denoted as $a^4$.
3. Fifth powers are well-defined: $a^4 * a = a^3 * a^2 = a^2 * a^3 = a * a^4$ and this is denoted as $a^5$.

## Proof

As above, we assume $(S,*)$ is an alternative magma and $a$ is an arbitrary element of $S$.

### Cubes are well-defined

To prove: $a * a^2 = a^2 * a$.

Proof: This follows from either of the alternative laws, setting $x = y = a$.

### Fourth powers are well-defined

We note that even after removing the edges labeled "Flex", the graph is still connected. This shows that fourth powers are well-defined

To prove: $a^3 * a = a^2 * a^2 = a * a^3$.

Proof: We first show that $a^3 * a = a^2 * a^2$. Consider:

$\! a^3 * a = (a^2 * a) * a$

By the right-alternative law, setting $x = a^2, y = a$, we obtain that:

$\! a^3 * a = a^2 * (a * a) = a^2 * a^2$

We now show that $a^2 * a^2 = a * a^3$. We have:

$\! a^2 * a^2 = (a * a) * a^2$

By the left-alternative law, setting $x = a, y = a^2$, we obtain:

$\! a^2 * a^2 = a * (a * a^2) = a * a^3$.

Thus, we have shown that all three expressions are equal.

### Fifth powers are well-defined

We note that even after removing the edges labeled "Flex", the graph is still connected. This proves that fifth powers are well-defined.

To prove: $a^4 * a = a^3 * a^2 = a^2 * a^3 = a * a^4$.

Proof:

We first show that $a^4 * a = a^3 * a^2$. Note that:

$\! a^4 * a = (a^3 * a) * a = a^3 * (a * a) = a^3 * a^2$

where, in an intermediate step, we used the right-alternative law with $x = a^3, y = a$.

We next show that $a^3 * a^2 = a * a^4$. Note that:

$\! a^3 * a^2 = (a * a^2) * a^2 = a * (a^2 * a^2) = a * a^4$

where, in an intermediate step, we used the right-alternative law with $x = a, y = a^2$.

We finally show that $a * a^4 = a^2 * a^3$. Note that:

$\! a * a^4 = a * (a * a^3) = (a * a) * a^3 = a^2 * a^3$

where, in an intermediate step, we used the left-alternative law with $x = a, y = a^3$.

This completes the proof.

format: plain


text:
# Announcing the Shimmer Network and Token

Announcements Nov 16, 2021

An Alternate Reality Awaits

TL;DR:
In order to accelerate the adoption of IOTA and validate its path to full decentralization, we are officially introducing Shimmer, an incentivized staging network with its own native token ($SMR). You can stake your IOTA tokens to get Shimmer tokens before the genesis launch. Join the Shimmer network to get early access to key innovations before they get released on the IOTA mainnet. Stake. Earn. Govern. Build. After the successful completion of the IOTA mainnet upgrade earlier this year, the IOTA team and community have been focused on a series of upgrades to turn IOTA into a fully decentralized, programmable multi-asset ledger. Our primary objective right now is to empower our ecosystem with new opportunities which are only made possible thanks to IOTA’s technical innovations and unique ledger architecture. In order to achieve this objective and extend the range of possibilities with IOTA, the network is in the process of undergoing some major mainnet upgrades: 1. Programmable multi-asset ledger, with the introduction of output types and tokenization on the base layer. You can read more about it and the technical RFC here. 2. Smart Contracts, with the introduction of IOTA Smart Contracts, for which we have recently released the beta version. 3. Full decentralization, with the IOTA 2.0 protocol. 4. Sharding and further optimizations. Each of these phases introduces many highly-anticipated features that elevate IOTA to new levels of functionality and adoption; but each phase also introduces potential risks, uncertainties and potential bugs related to the network upgrades, application integrations and token migrations. Considering the enormous value of the IOTA economy today, we have to ensure that every release candidate has been publicly validated and tested by the community, and thoroughly battle-tested by adversaries. Looking at the available options to launch yet another testnet (for which activity usually subsides after initial excitement) or yet another Bug Bounty program (they are usually difficult to structure in ways that satisfies everyone, with no budget ever being seen as sufficient), we have opted for a third option: Launching an incentivized staging network with its own token. Today we are happy to announce Shimmer, the incentivized staging network for IOTA. ## Why Shimmer? Every major upgrade of a distributed ledger (DLT) network is faced with the same challenge: How do we ensure that there was enough public testing, stress tests and even attacks to safely upgrade the mainnet with new features? With these networks holding billions in token value, this is not an easy challenge to overcome. For example, the Chrysalis release required nearly five months of public validation before the eventual mainnet release. As we’ve seen with the success of the first incentivized Ethereum testnet in 2016, or the Kusama network and Polkadot, defining incentives is essential to increase public participation and validation and shorten release timelines. In fact, the entire DeFi ecosystem can be seen as a large innovation playground meant to battle test and validate dApps and new financial building blocks. After all, “testing in prod” is more than just a meme – it’s a mindset to accelerate the adoption of new innovations; knowing full well what the associated risks are. In a similar spirit, we are accelerating the development and adoption of IOTA, while making sure that every upgrade intended for the IOTA mainnet has been carefully tested, audited and reviewed for release. While we want to be fast and deploy releases as early as possible, it is of utmost importance to protect a token economy with considerable value locked into and the hundreds of thousands of IOTA users. This is why we are launching Shimmer. An innovation playground for builders to get early access to IOTA’s innovations, Shimmer is also an open, permissionless network with the right token incentives for adversaries to attack. Together with our community we want to embark on a journey into the unknown, to be bold and to progress faster; much faster than previously possible. ### The objectives of Shimmer are: 1. Accelerate the adoption of our technologies by giving builders early access and inviting them to launch their dApps on Shimmer, making them automatically ready to migrate once an upgrade reaches the IOTA mainnet. 2. Build developer tooling, documentation and integrations early, making potential migrations for dApps and third parties (like exchanges and DeFi platforms) a smooth experience. 3. A new token economy that rewards participation of the community and adversaries. 4. Incentivized testing and public validation. This ensures that all major upgrades pose no significant risk to token holders or applications in the ecosystem, making upgrades quick, secure and painless for all network participants. 5. Become a fully community-governed network that maximizes for decentralization and utilizes DAO’s to fund initiatives and govern the network. 6. Make it easier for our community to participate in a more transparent development process. Have fun building together. ## What is Shimmer? The Shimmer network will be the official, incentivized staging network of IOTA. It will be an essential part of IOTA’s path to increased utility, ecosystem growth and full decentralization. Shimmer will help to publicly validate every major upcoming upgrade before they reach the IOTA network. Shimmer will also play an essential role in ensuring that every upgrade of the network will be followed by a smooth and secure transition for all token holders and applications. Especially for the upgrade to IOTA 2.0 (full decentralization and the Coordicide), we need to make sure that the transition is carefully planned and executed. Shimmer will be a guide for IOTA and all of its network participants, helping to minimize risk and maximize the safety of all future network upgrades. All development goes through four phases: new features are being developed, tested in a limited test environment, released on Shimmer to be validated in a public environment, to be released on IOTA Launched as an open and permissionless network, anyone is able to join the Shimmer network, build on it, and even attack it. In this way, Shimmer will become a long-term staging network that enables the IOTA ecosystem to test new solutions faster with higher stability than typical testnets. With Shimmer, the IOTA universe will benefit from a rapid development environment for faster innovation cycles. Ultimately, it is up to the community to realize the potential of Shimmer. The landscape of Shimmer applications may begin small, but – depending on the community’s involvement – it is expected to grow as more discover its full potential and want to participate. There is an entire ecosystem of new tokenization, digital assets, NFT and DeFi use cases to build. Partners and service providers already integrated with IOTA will easily be able to integrate Shimmer and the Shimmer token with no significant development overhead. For the launch, the following IOTA applications and tooling will offer full support for Shimmer: • Firefly Wallet • Node Software • Permanode • All libraries and tooling ## The Shimmer Token ($SMR)

The Shimmer network will have its own native token: \$SMR. The token will be the economic backbone of the Shimmer network, facilitating transactions and interactions within the emerging ecosystem. We leave it up to the pioneers and the early adopters of Shimmer to provide utility to the token by being the first to launch new DeFi, NFT, DAOs and other dApps.

We will also introduce staking rewards to the Shimmer network. By staking your Shimmer tokens you will earn staking rewards for securing the network. With Shimmer we don’t just want to develop new technical innovations, but also economic ones and find ways to further improve and optimize our emerging crypto-economic networks.

### Shimmer Tokenomics:

• Stake your Shimmer tokens and earn rewards
• Be an early adopter of the Shimmer dApp ecosystem and be part of new yield opportunities launched on the Shimmer network. Every dApp that will launch on the IOTA network has a clear incentive to also build on Shimmer. Even beyond that, Shimmer will evolve into its own ecosystem and community.
• Govern and be a part of shaping the future of Shimmer

## Launching the Shimmer Token Economy with IOTA

The Shimmer token will be fairly launched by distributing all tokens to anyone staking IOTA tokens over a three-month staking period. This means that there is no pre-mine or allocation reserved for specific entities. The IOTA token is the launchpad for the Shimmer token.

The Shimmer token distribution will be determined through staking IOTA tokens within the IOTA Firefly wallet. In an upcoming Firefly release, users will be able to easily stake their IOTA tokens within the wallet and receive Shimmer token rewards into the same wallet. The terms are fairly simple: For every 1 MIOTA you stake, you will receive 1 Shimmer Token every ~10 seconds. Staking rewards will be accessible within your Firefly wallet. Tokens can only be transferred with the actual launch of the Shimmer network in the near future.

IOTA Staking summary for Shimmer:

• Staking Reward: 1 MIOTA = 1 Shimmer Token
• Distribution: every ~10 seconds
• Maximum staking duration: 90 days
• Liquid staking, you can easily unstake your tokens. There is no lockup of any kind
• After the Shimmer network launch, users will be able to stake their Shimmer tokens on the Shimmer network

You can calculate potential rewards using a rewards calculator on the Shimmer website here.

IOTA Staking will begin shortly. We will only share the exact date 24 hours in advance, to make it as fair as possible for the community. If you believe in the future of decentralization and want to be an early adopter of Shimmer, don’t miss this opportunity to be a part of the launch of the Shimmer token economy.

Embark on a journey into an alternate reality together with us.

Let’s build.

Follow us on our official channels and get all the latest Shimmer news!


text:
# Math Help - |3x+4|-|2x+3|>2

1. ## |3x+4|-|2x+3|>2

|3x+4|-|2x+3|>2
solve!

2. Originally Posted by lebanon
|3x+4|-|2x+3|>2
solve!
You command us?!

Hmmm... show your trying effort for solving the problem...

3. One simple way is to first move it to:

$|3x + 4| > 2 + |2x + 3|$

Then, graph both on graph paper and look for the solutions manually.

4. Originally Posted by lebanon
|3x+4|-|2x+3|>2

solve!
$3x+4$ and $2x+3$ are linear expressions (thanks HallsofIvy!)

If you solve the equation $(3x+4)=(2x+3)\Rightarrow\ x=-1$

They are equations of lines if we write y = expression, with different slopes, hence $(3x+4)>(2x+3)$ to the right of $x=-1$

and $(2x+3)>(3x+4)$ to the left of $x=-1$

If $(3x+4)>(2x+3)$ you need to solve for $(3x+4)-(2x+3)>2$

If $(2x+3)>(3x+4)$ you need to solve for $(2x+3)-(3x+4)>2$

You need both solutions.

5. Originally Posted by Archie Meade
$3x+4$ and $2x+3$ are linear equations.
Well, no, they are not. They are linear expressions!
If you solve the equations, $(3x+4)=(2x+3)\Rightarrow\ x=-1$

They are equations of lines with different slopes, hence $(3x+4)>(2x+3)$ to the right of $x=-1$

and $(2x+3)>(3x+4)$ to the left of $x=-1$

If $(3x+4)>(2x+3)$ you need to solve for $(3x+4)-(2x+3)>2$

If $(2x+3)>(3x+4)$ you need to solve for $(2x+3)-(3x+4)>2$

You need both solutions.


text: A block of glass of mass 250g floats in mercury. What volume of glass lies under the surface of the mercury? (Density of the mercury is 13.6×10^3kgm^-3). (3marks)


text:
# Stein's method

Stein's method is a general method in probability theory to obtain bounds on the distance between two probability distributions with respect to a probability metric. It was introduced by Charles Stein, who first published it 1972,[1] to obtain a bound between the distribution of a sum of $m$-dependent sequence of random variables and a standard normal distribution in the Kolmogorov (uniform) metric and hence to prove not only a central limit theorem, but also bounds on the rates of convergence for the given metric.

## History

At the end of the 1960s, unsatisfied with the by-then known proofs of a specific central limit theorem, Charles Stein developed a new way of proving the theorem for his statistics lecture.[2] The seminal paper[1] was presented in 1970 at the sixth Berkeley Symposium and published in the corresponding proceedings.

Later, his Ph.D. student Louis Chen Hsiao Yun modified the method so as to obtain approximation results for the Poisson distribution,[3] therefore the method is often referred to as Stein-Chen method. Whereas moderate attention was given to the new method in the 70s, it has undergone major development in the 80s, where many important contributions were made and on which today's view of the method are largely based. Probably the most important contributions are the monograph by Stein (1986), where he presents his view of the method and the concept of auxiliary randomisation, in particular using exchangeable pairs, and the articles by Barbour (1988) and Götze (1991), who introduced the so-called generator interpretation, which made it possible to easily adapt the method to many other probability distributions. An important contribution was also an article by Bolthausen (1984) on a long-standing open problem around the so-called combinatorial central limit theorem, which surely helped the method to become widely known.[citation needed]

In the 1990s the method was adapted to a variety of distributions, such as Gaussian processes by Barbour (1990), the binomial distribution by Ehm (1991), Poisson processes by Barbour and Brown (1992), the Gamma distribution by Luk (1994), and many others.

## The basic approach

### Probability metrics

Stein's method is a way to bound the distance of two probability distributions in a specific probability metric. To be tractable with the method, the metric must be given in the form

$(1.1)\quad d(P,Q) = \sup_{h\in\mathcal{H}}\left|\int h dP - \int h dQ \right| = \sup_{h\in\mathcal{H}}\left|E h(W) - E h(Y) \right|$

Here, $P$ and $Q$ are probability measures on a measurable space $\mathcal{X}$, $W$ and $Y$ are random variables with distribution $P$ and $Q$ respectively, $E$ is the usual expectation operator and $\mathcal{H}$ is a set of functions from $\mathcal{X}$ to the real numbers. This set has to be large enough, so that the above definition indeed yields a metric. Important examples are the total variation metric, where we let $\mathcal{H}$ consist of all the indicator functions of measurable sets, the Kolmogorov (uniform) metric for probability measures on the real numbers, where we consider all the half-line indicator functions, and the Lipschitz (first order Wasserstein; Kantorovich) metric, where the underlying space is itself a metric space and we take the set $\mathcal{H}$ to be all Lipschitz-continuous functions with Lipschitz-constant 1. However, note that not every metric can be represented in the form (1.1).

In what follows we think of $P$ as a complicated distribution (e.g. a sum of dependent random variables), which we want to approximate by a much simpler and tractable distribution $Q$ (e.g. the standard normal distribution to obtain a central limit theorem).

### The Stein operator

We assume now that the distribution $Q$ is a fixed distribution; in what follows we shall in particular consider the case where $Q$ is the standard normal distribution, which serves as a classical example of the application of Stein's method.

First of all, we need an operator $\mathcal{A}$ which acts on functions $f$ from $\mathcal{X}$ to the real numbers, and which 'characterizes' the distribution $Q$ in the sense that the following equivalence holds:

$(2.1)\quad E (\mathcal{A}f)(Y) = 0\text{ for all } f \quad \iff \quad Y \text{ has distribution } Q.$

We call such an operator the Stein operator. For the standard normal distribution, Stein's lemma exactly yields such an operator:

$(2.2)\quad E\left(f'(Y)-Yf(Y)\right) = 0\text{ for all } f\in C_b^1 \quad \iff \quad Y \text{ has standard normal distribution.}$

thus we can take

$(2.3)\quad (\mathcal{A}f)(x) = f'(x) - x f(x)$

We note that there are in general infinitely many such operators and it still remains an open question, which one to choose. However, it seems that for many distributions there is a particular good one, like (2.3) for the normal distribution.

There are different ways to find Stein operators. But by far the most important one is via generators. This approach was, as already mentioned, introduced by Barbour and Götze. Assume that $Z=(Z_t)_{t\geq0}$ is a (homogeneous) continuous time Markov process taking values in $\mathcal{X}$. If $Z$ has the stationary distribution $Q$ it is easy to see that, if $\mathcal{A}$ is the generator of $Z$, we have $E (\mathcal{A}f)(Y) = 0$ for a large set of functions $f$. Thus, generators are natural candidates for Stein operators and this approach will also help us for later computations.

### Setting up the Stein equation

Observe now that saying that $P$ is close to $Q$ with respect to $d$ is equivalent to saying that the difference of expectations in (1.1) is close to 0, and indeed if $P=Q$ it is equal to 0. We hope now that the operator $\mathcal{A}$ exhibits the same behavior: clearly if $P=Q$ we have $E (\mathcal{A}f)(W)=0$ and hopefully if $P\approx Q$ we have $E (\mathcal{A}f)(W) \approx 0$.

To make this statement rigorous we could find a function $f$, such that, for a given function $h$,

$(3.1)\quad E(\mathcal{A}f)(W)=E h(W) - Eh(Y),$

so that the behavior of the right hand side is reproduced by the operator $\mathcal{A}$ and $f$. However, this equation is too general. We solve instead the more specific equation

$(3.2)\quad (\mathcal{A}f)(x)= h(x) - Eh(Y), \qquad\text{for all }x,$

which is called Stein equation. Replacing $x$ by $W$ and taking expectation with respect to $W$, we are back to (3.1), which is what we effectively want. Now all the effort is worth only if the left hand side of (3.1) is easier to bound than the right hand side. This is, surprisingly, often the case.

If $Q$ is the standard normal distribution and we use (2.3), the corresponding Stein equation is

$(3.3)\quad f'(x) - x f(x) = h(x) - Eh(Z), \qquad\text{for all }x,$

which is just an ordinary differential equation.

### Solving the Stein equation

Now, in general, we cannot say much about how the equation (3.2) is to be solved. However, there are important cases, where we can.

Analytic methods. We see from (3.3) that equation (3.2) can in particular be a differential equation (if $Q$ is concentrated on the integers, it will often turn out to be a difference equation). As there are many methods available to treat such equations, we can use them to solve the equation. For example, (3.3) can be easily solved explicitly:

$(4.1)\quad f(x) = e^{x^2/2}\int_{-\infty}^x [h(s)-E h(Y)]e^{-s^2/2}ds.$

Generator method. If $\mathcal{A}$ is the generator of a Markov process $(Z_t)_{t\geq 0}$as explained before, we can give a general solution to (3.2):

$(4.2)\quad f(x) = -\int_0^\infty [E^x h(Z_t)-E h(Y)] dt.$

where $E^x$ denotes expectation with respect to the process $Z$ being started in $x$. However, one still has to prove that the solution (4.2) exists for all desired functions $h\in\mathcal{H}$.

### Properties of the solution to the Stein equation

After showing the existence of a solution to (3.2) we can now try to analyze its properties. Usually, one tries to give bounds on $f$ and its derivatives (which has to be carefully defined if $\mathcal{X}$ is a more complicated space) or differences in terms of $h$ and its derivatives or differences, that is, inequalities of the form

$(5.1)\quad ||D^k f|| \leq C_{k,l} ||D^l h||,$

for some specific $k,l=0,1,2,\dots$ (typically $k\geq l$ or $k\geq l-1$, respectively, depending on the form of the Stein operator) and where often $||\cdot||$ is taken to be the supremum norm. Here, $D^k$ denotes the differential operator, but in discrete settings it usually refers to a difference operator. The constants $C_{k,l}$ may contain the parameters of the distribution $Q$. If there are any, they are often referred to as Stein factors or magic factors.

In the case of (4.1) we can prove for the supremum norm that

$(5.2)\quad ||f||_\infty\leq \min\{\sqrt{\pi/2}||h||_\infty,2||h'||_\infty\},\quad ||f'||_\infty\leq \min\{2||h||_\infty,4||h'||_\infty\},\quad ||f''||_\infty\leq 2 ||h'||_\infty,$

where the last bound is of course only applicable if $h$ is differentiable (or at least Lipschitz-continuous, which, for example, is not the case if we regard the total variation metric or the Kolmogorov metric!). As the standard normal distribution has no extra parameters, in this specific case, the constants are free of additional parameters.

Note that, up to this point, we did not make use of the random variable $W$. So, the steps up to here in general have to be calculated only once for a specific combination of distribution $Q$, metric $d$ and Stein operator $\mathcal{A}$. However, if we have bounds in the general form (5.1), we usually are able to treat many probability metrics together. Furthermore as there is often a particular 'good' Stein operator for a distribution (e.g., no other operator than (2.3) has been used for the standard normal distribution up to now), one can often just start with the next step below, if bounds of the form (5.1) are already available (which is the case for many distributions).

### An abstract approximation theorem

We are now in a position to bound the left hand side of (3.1). As this step heavily depends on the form of the Stein operator, we directly regard the case of the standard normal distribution.

Now, at this point we could directly plug in our random variable $W$ which we want to approximate and try to find upper bounds. However, it is often fruitful to formulate a more general theorem using only abstract properties of $W$. Let us consider here the case of local dependence.

To this end, assume that $W=\sum_{i=1}^n X_i$ is a sum of random variables such that the $E W = 0$ and variance $Var W = 1$. Assume that, for every $i=1,\dots,n$, there is a set $A_i\subset\{1,2,\dots,n\}$, such that $X_i$ is independent of all the random variables $X_j$ with $j\not\in A_i$. We call this set the 'neighborhood' of $X_i$. Likewise let $B_i\subset\{1,2,\dots,n\}$ be a set such that all $X_j$ with $j\in A_i$ are independent of all $X_k$, $k\not\in B_i$. We can think of $B_i$ as the neighbors in the neighborhood of $X_i$, a second-order neighborhood, so to speak. For a set $A\subset\{1,2,\dots,n\}$ define now the sum $X_A := \sum_{j\in A} X_j$.

Using basically only Taylor expansion, it is possible to prove that

$(6.1)\quad \left|E(f'(W)-Wf(W))\right| \leq ||f''||_\infty\sum_{i=1}^n \left( \frac{1}{2}E|X_i X_{A_i}^2| + E|X_i X_{A_i}X_{B_i \setminus A_i}| + E|X_i X_{A_i}| E|X_{B_i}| \right)$

Note that, if we follow this line of argument, we can bound (1.1) only for functions where $||h'||_{\infty}$ is bounded because of the third inequality of (5.2) (and in fact, if $h$ has discontinuities, so will $f''$). To obtain a bound similar to (6.1) which contains only the expressions $||f||_{\infty}$ and $||f'||_{\infty}$, the argument is much more involved and the result is not as simple as (6.1); however, it can be done.

Theorem A. If $W$ is as described above, we have for the Lipschitz metric $d_W$ that

$(6.2)\quad d_W(\mathcal{L}(W),N(0,1)) \leq 2\sum_{i=1}^n \left( \frac{1}{2}E|X_i X_{A_i}^2| + E|X_i X_{A_i}X_{B_i \setminus A_i}| + E|X_i X_{A_i}| E|X_{B_i}| \right).$

Proof. Recall that the Lipschitz metric is of the form (1.1) where the functions $h$ are Lipschitz-continuous with Lipschitz-constant 1, thus $||h'||\leq 1$. Combining this with (6.1) and the last bound in (5.2) proves the theorem.

Thus, roughly speaking, we have proved that, to calculate the Lipschitz-distance between a $W$ with local dependence structure and a standard normal distribution, we only need to know the third moments of $X_i$ and the size of the neighborhoods $A_i$ and $B_i$.

### Application of the theorem

We can treat the case of sums of independent and identically distributed random variables with Theorem A. So assume now that $E X_i = 0$, $Var X_i = 1$ and $W=n^{-1/2}\sum X_i$. We can take $A_i=B_i=\{i\}$ and we obtain from Theorem A that

$(7.1)\quad d_W(\mathcal{L}(W),N(0,1)) \leq \frac{5 E|X_1|^3}{n^{1/2}}.$

## Connections to other methods

• Lindeberg's method. Lindeberg (1922) introduced in a seminal article a method, where the difference in (1.1) is directly bounded. This method usually also heavily relies on Taylor expansion and thus shows some similarities with Stein's method.
• Tikhomirov's method. Clearly the approach via (1.1) and (3.1) does not involve characteristic functions. However, Tikhomirov (1980) presented a proof of a central limit theorem based on characteristic functions and a differential operator similar to (2.3). The basic observation is that the characteristic function $\psi(t)$ of the standard normal distribution satisfies the differential equation $\psi'(t)+t\psi(t) = 0$ for all $t$. Thus, if the characteristic function $\psi_W(t)$ of $W$ is such that $\psi'_W(t)+t\psi_W(t)\approx 0$ we expect that $\psi_W(t)\approx \psi(t)$ and hence that $W$ is close to the normal distribution. Tikhomirov states in his paper that he was inspired by Stein's seminal paper.

## Notes

1. ^ a b Stein, C. (1972). "A bound for the error in the normal approximation to the distribution of a sum of dependent random variables". Proceedings of the Sixth Berkeley Symposium on Mathematical Statistics and Probability: 583–602. MR 402873. Zbl 0278.60026.
2. ^ Charles Stein: The Invariant, the Direct and the "Pretentious". Interview given in 2003 in Singapore
3. ^ Chen, L.H.Y. (1975). "Poisson approximation for dependent trials". Annals of Probability 3 (3): 534–545. doi:10.1214/aop/1176996359. JSTOR 2959474. MR 428387. Zbl 0335.60016.

## References

• Barbour, A. D. (1988). "Stein's method and Poisson process convergence". J. Appl. Probab. (Applied Probability Trust) 25A: 175–184. doi:10.2307/3214155. JSTOR 3214155.
• Barbour, A. D. (1990). "Stein's method for diffusion approximations". Probab. Theory Related Fields 84 (3): 297–322. doi:10.1007/BF01197887.
• Barbour, A. D. and Brown, T. C. (1992). "Stein's method and point process approximation". Stochastic Process. Appl. 43 (1): 9–31. doi:10.1016/0304-4149(92)90073-Y.
• Bolthausen, E. (1984). "An estimate of the remainder in a combinatorial central limit theorem". Z. Wahrsch. Verw. Gebiete 66 (3): 379–386. doi:10.1007/BF00533704.
• Ehm, W. (1991). "Binomial approximation to the Poisson binomial distribution". Statistics & Probability Letters 11 (1): 7–16. doi:10.1016/0167-7152(91)90170-V.
• Götze, F. (1991). "On the rate of convergence in the multivariate CLT". Annals of Probability 19 (2): 724–739. doi:10.1214/aop/1176990448.
• Lindeberg, J. W. (1922). "Eine neue Herleitung des Exponentialgesetzes in der Wahrscheinlichkeitsrechung". Math. Z. 15 (1): 211–225. doi:10.1007/BF01494395.
• Luk, H. M. (1994). Stein's method for the gamma distribution and related statistical applications. Dissertation.
• Stein, C. (1986). Approximate computation of expectations. Institute of Mathematical Statistics Lecture Notes, Monograph Series, 7. ISBN 0-940600-08-0.
• Tikhomirov, A. N. (1980). "Convergence rate in the central limit theorem for weakly dependent random variables". Teor. Veroyatnost. I Primenen. 25: 800–818. English translation in Theory Probab. Appl. 25 (1980–81): 790–809.

## Literature

The following text is advanced, and gives a comprehensive overview of the normal case

• Chen, L.H.Y., Goldstein, L., and Shao, Q.M (2011). Normal approximation by Stein's method. www.springer.com. ISBN 978-3-642-15006-7.

Another advanced book, but having some introductory character, is

• ed. Barbour, A.D. and Chen, L.H.Y. (2005). An introduction to Stein's method. Lecture Notes Series, Institute for Mathematical Sciences, National University of Singapore 4. Singapore University Press. ISBN 981-256-280-X.

A standard reference is the book by Stein,

• Stein, C. (1986). Approximate computation of expectations. Institute of Mathematical Statistics Lecture Notes, Monograph Series, 7. Hayward, Calif.: Institute of Mathematical Statistics. ISBN 0-940600-08-0.

which contains a lot of interesting material, but may be a little hard to understand at first reading.

Despite its age, there are few standard introductory books about Stein's method available. The following recent textbook has a chapter (Chapter 2) devoted to introducing Stein's method:

• Ross, Sheldon and Peköz, Erol (2007). A second course in probability. www.ProbabilityBookstore.com. ISBN 978-0-9795704-0-7.

Although the book

• Barbour, A. D. and Holst, L. and Janson, S. (1992). Poisson approximation. Oxford Studies in Probability 2. The Clarendon Press Oxford University Press. ISBN 0-19-852235-5.

is by large parts about Poisson approximation, it contains nevertheless a lot of information about the generator approach, in particular in the context of Poisson process approximation.

The following textbook has a chapter (Chapter 10) devoted to introducing Stein's method of Poisson approximation:


text:
# Operation Black Lotus

During the recent battles between the US Marine Corp and Chinese forces it has come to the attention of the US that China was working on a b...

File Description

During the recent battles between the US Marine Corp and Chinese forces it has come to the attention of the US that China was working on a biological agent called "Black Lotus" which is a non-lethal nerve agent which incapacitates people for a 24 hour period. This agent was developed in a facility, located in Guangxi Province 75 km's South from the town of Yanshuo, which has been abandoned due to the re-allocation of military resources to confront the US threat.

Screenshots
OPERATION BLACK LOTUS
=====================
Clan: thR - Australia (www.clan-thr.com)

MAP Details
-----------

Setting: Jungle/Bushland, Villages and Industrial/Factory Locations
Multiplayer: YES
Singleplayer: NO (not until Single Player plugin is released for the BF2 Editor)
Map Size: 512x512 (1024x1024km in game)
Player Size(s): 16/32/64
Total # of SPawns: 10 (5 for 16 player, 8 for 32 Player & 10 for 64 Player)
Sides: USMC vs China
Commander Assets: UAV (All), Scan (All) & Artillery (32 & 64 ONLY)
Lightmaps: Terrain (Medium)& Objects (10% High Detail, 10% Medium, 80% Low - didn't have the time to wait for all lightmaps to be generated in High/Final detail)

Mission Outline
---------------

During the recent battles between the US Marine Corp and Chinese forces it has come to the attention of the US that China was working on a biological agent called "Black Lotus" which is a non-lethal nerve agent which incapacitates people for a 24 hour period. This agent was developed in a facility, located in Guangxi Province 75 km's South from the town of Yanshuo, which has been abandoned due to the re-allocation of military resources to confront the US threat.

USMC is tasked with the temporary capture of the abondoned facility and holding this facility till the necessary information is gathered on this biological agent. The initial incursion will be via paradrop within the area of the facility. Re-inforcements will come via additional paradrops if required to recapture the facility.

China has a small military contingent in the area, they have been informed by local farmers of "soliders falling from the sky". Chinese forces are being deployed to remove the threat of a possible invasion from their southern coast line.

INSTALLATION
------------

Put the map folder from the .ZIP file into:

[EA Games location Folder]\Battlefield 2\mods\bf2\Levels\

------------------------------
***IMPORTANT***

This map file can be placed on any file download service as long as the ZIP file remains intact as originally made and includes this text file.

Please do not modify this map in any way, shape or form.

------------------------------

I would love some feed back on what people think of this map and I will answer any questions about the map. For feedback please contact me on the email address at the top of this text file.

Cheers,

thR WhiteShadow


text:
# Is there a reliable recursive formula for a simple moving average (moving mean)?

I've tried some recursive moving average formulae (to reuse a previous output instead of summing the whole n-long set for every i) I've managed to find but none of them produces the same results as a bare moving mean does. Is there a reliable recursive formula which would produce exactly (or almost exactly) the same output as a bare moving mean?

-
It seems that you are using some kind of software. If this is true, please tell us, it is easier to give an answer then. –  mpiktas Mar 16 '12 at 4:23
I program in Scala. –  Ivan Mar 16 '12 at 4:26

Just try to remove the last value of the window and add the new one.

If

$$MA(t)=\frac{1}{w}\sum\limits_{i=t-w+1}^t{y_i}$$

then

$$MA(t+1)=MA(t)+\frac{y(t+1)-y(t-w+1)}{w}.$$

-
Yes, this formula looks reasonable but somehow the result I get is always below the non-recursive moving mean. And the difference looks constant. Perhaps I have a bug in my code, the difference would hardly be constant otherwise. –  Ivan Mar 16 '12 at 4:37
The possible reason might be the following. If the values of y(t) are relatively small and w is big, divisions for sum(y(t))/w and (y(t)+y(t-w))/w have different precision orders. (for example if y(t) is approximately 0.001, and n is 10000, division 0.001/10000 is less accurate, compared to 10/10000). Then if you add real numbers with different precisions, the smaller one is truncated. –  chab Mar 16 '12 at 4:54
This formula is not correct because it subtracts the new value rather than adds it! –  whuber Mar 16 '12 at 16:15
Yes, you was right. Just corrected it. –  chab Mar 17 '12 at 13:05
Thank you! (+1). I have taken the liberty of also correcting a slight indexing error. –  whuber Mar 17 '12 at 14:34


text:
# American Institute of Mathematical Sciences

March  2013, 12(2): 735-754. doi: 10.3934/cpaa.2013.12.735

## Long-time dynamics of the parabolic $p$-Laplacian equation

 1 Department of Mathematics, Faculty of Science, Hacettepe University, Beytepe 06800, Ankara, Turkey, Turkey

Received  July 2011 Revised  March 2012 Published  September 2012

In this paper, we study the long-time behaviour of solutions of Cauchy problem for the parabolic $p$-Laplacian equation with variable coefficients. Under the mild conditions on the coefficient of the principal part and without upper growth restriction on the source function, we prove that this problem possesses a compact and invariant global attractor in $L^2(R^n)$.
Citation: Pelin G. Geredeli, Azer Khanmamedov. Long-time dynamics of the parabolic $p$-Laplacian equation. Communications on Pure and Applied Analysis, 2013, 12 (2) : 735-754. doi: 10.3934/cpaa.2013.12.735
##### References:
 [1] R. Temam, "Infinite-Dimensional Dynamical Systems in Mechanics and Physics," Applied Mathematical Sciences, 68, Springer-Verlag, New York, 1988. [2] A. V. Babin and M. I. Vishik, Attractors of differential evolution equations in unbounded domain, Proc. Roy. Soc. Edinburg, 116A (1990), 221-243. doi: 10.1017/S0308210500031498. [3] A. V. Babin and M. I. Vishik, "Attractors of Evolution Equations," Studies in Mathematics and its Applications, 25, North-Holland Publishing Co., Amsterdam, 1992. [4] E. Feireisl, Ph. Laurencot, F. Simondon and H. Toure, Compact attractors for reaction diffusion equations in $R^n$, C. R. Acad. Sci. Paris Ser. I, 319 (1994), 147-151. [5] B. Wang, Attractors for reaction diffusion equations in unbounded domains, Physica D, 128 (1999), 41-52. [6] M. Efendiev and S. Zelik, The attractor for a nonlinear reaction-diffusion system in an unbounded domain, Comm. Pure Appl. Math., 54 (2001), 625-688. doi: 10.1002/cpa.1011. [7] J. M. Arrieta, J. W. Cholewa, T. Dlotko and A. Rodriguez-Bernal, Asymptotic behavior and attractors for reaction diffusion equations in unbounded domains, Nonlinear Analysis: Theory, Methods & Applications, 56 (2004), 515 - 554. doi: 10.1016/j.na.2003.09.023. [8] A. N. Carvalho, J. W. Cholewa and T. Dlotko, Global attractors for problems with monotone operators, Boll. Unione Mat. Ital. Sez. B Artic. Ric. Mat., 2 (1999), 693-706. [9] A. N. Carvalho and C. B. Gentile, Asymptotic behavior of non-linear parabolic equations with monotone principial part, J. Math. Anal. Appl., 280 (2003), 252-272. doi: 10.1016/S0022-247X(03)00037-4. [10] M. Nakao and N. Aris, On global attractor for nonlinear parabolic equation of $m$-Laplacian type, J. Math. Anal. Appl., 331 (2007), 793-809. doi: 10.1016/j.jmaa.2006.08.044. [11] M. Yang, C. Sun and C. Zhong, Global attractors for $p$-Laplacian equation, J. Math. Anal. Appl., 337 (2007), 1130-1142. doi: 10.1016/j.jmaa.2006.04.085. [12] M. Nakao and C. Chen, On global attractor for a nonlinear parabolic equation of $m$-Laplacian type in $R^n$, Funkcialaj Ekvacioj, 50 (2007), 449-468. doi: 10.1619/fesi.50.449. [13] C. Chen, L. Shi and H. Wang, Existence of a global attractors in $L^p$ for $m$-Laplacian parabolic equation in $R^n$, Boundary Value Problems, 2009 (2009), 1-17. doi: 10.1155/2009/563767. [14] A. Kh. Khanmamedov, Existence of a global attractor for the parabolic equation with nonlinear Laplacian principal part in an unbounded domain, J. Math. Anal. Appl., 316 (2006), 601-615. doi: 10.1016/j.jmaa.2005.05.003. [15] A. Kh. Khanmamedov, Global attractors for one dimensional $p$-Laplacian equation, Nonlinear Analysis: Theory, Methods & Applications, 71 (2009), 155-171. doi: 10.1016/j.na.2008.10.037. [16] M. Yang, C. Sun and C. Zhong, Existence of a global attractor for a $p$-Laplacian equation in $R^n$, Nonlinear Analysis: Theory, Methods and Applications, 66 (2007), 1-13. doi: 10.1016/j.na.2005.11.004. [17] C. T. Anh and T. D. Ke, Long time behavior for quasilinear parabolic equations involving weighted p-Laplacian operators, Nonlinear Analysis: Theory, Methods & Applications, 71 (2009), 4415-4422. doi: 10.1016/j.na.2009.02.125. [18] C. T. Anh and T. D. Ke, On quasilinear parabolic equations involving weighted p-Laplacian operators, Nonlinear Differential Equations and Applications, 17 (2010), 195-212. doi: 10.1007/s00030-009-0048-3. [19] A. Kh. Khanmamedov, Global attractors for 2-D wave equations with displacement-dependent damping, Math. Methods Appl. Sci., 33 (2010), 177-187. doi: 10.1002/mma.1161. [20] R. E. Showalter, "Monotone Operators in Banach Space and Nonlinear Partial Differential Equations," Mathematical Surveys Monographs, 49, American Mathematical Society, 1997. [21] J. Simon, Compact sets in the space $L_p(0, T;B)$, Annali Mat. Pura Appl., 146 (1987), 65-96. doi: 10.1007/BF01762360. [22] M. A. Krasnoselskii and Y. B. Rutickii, "Convex Functions and Orlicz Spaces," P. Noordhoff Ltd., Groningen, 1961. [23] J.-L. Lions and E. Magenes, "Non-homogeneous Boundary Value Problems and Applications," 1, Springer-Verlag, New York-Heidelberg, 1972. [24] O. A. Ladyzhenskaya, On the determination of minimal global attractors for the Navier-Stokes equations and other partial differential equations, Uspekhi Mat. Nauk, 42 (1987), 25- 60; Russian Math. Surveys, 42 (1987), 27-73 (English Transl.). doi: 10.1070/RM1987v042n06ABEH001503.

show all references

##### References:
 [1] R. Temam, "Infinite-Dimensional Dynamical Systems in Mechanics and Physics," Applied Mathematical Sciences, 68, Springer-Verlag, New York, 1988. [2] A. V. Babin and M. I. Vishik, Attractors of differential evolution equations in unbounded domain, Proc. Roy. Soc. Edinburg, 116A (1990), 221-243. doi: 10.1017/S0308210500031498. [3] A. V. Babin and M. I. Vishik, "Attractors of Evolution Equations," Studies in Mathematics and its Applications, 25, North-Holland Publishing Co., Amsterdam, 1992. [4] E. Feireisl, Ph. Laurencot, F. Simondon and H. Toure, Compact attractors for reaction diffusion equations in $R^n$, C. R. Acad. Sci. Paris Ser. I, 319 (1994), 147-151. [5] B. Wang, Attractors for reaction diffusion equations in unbounded domains, Physica D, 128 (1999), 41-52. [6] M. Efendiev and S. Zelik, The attractor for a nonlinear reaction-diffusion system in an unbounded domain, Comm. Pure Appl. Math., 54 (2001), 625-688. doi: 10.1002/cpa.1011. [7] J. M. Arrieta, J. W. Cholewa, T. Dlotko and A. Rodriguez-Bernal, Asymptotic behavior and attractors for reaction diffusion equations in unbounded domains, Nonlinear Analysis: Theory, Methods & Applications, 56 (2004), 515 - 554. doi: 10.1016/j.na.2003.09.023. [8] A. N. Carvalho, J. W. Cholewa and T. Dlotko, Global attractors for problems with monotone operators, Boll. Unione Mat. Ital. Sez. B Artic. Ric. Mat., 2 (1999), 693-706. [9] A. N. Carvalho and C. B. Gentile, Asymptotic behavior of non-linear parabolic equations with monotone principial part, J. Math. Anal. Appl., 280 (2003), 252-272. doi: 10.1016/S0022-247X(03)00037-4. [10] M. Nakao and N. Aris, On global attractor for nonlinear parabolic equation of $m$-Laplacian type, J. Math. Anal. Appl., 331 (2007), 793-809. doi: 10.1016/j.jmaa.2006.08.044. [11] M. Yang, C. Sun and C. Zhong, Global attractors for $p$-Laplacian equation, J. Math. Anal. Appl., 337 (2007), 1130-1142. doi: 10.1016/j.jmaa.2006.04.085. [12] M. Nakao and C. Chen, On global attractor for a nonlinear parabolic equation of $m$-Laplacian type in $R^n$, Funkcialaj Ekvacioj, 50 (2007), 449-468. doi: 10.1619/fesi.50.449. [13] C. Chen, L. Shi and H. Wang, Existence of a global attractors in $L^p$ for $m$-Laplacian parabolic equation in $R^n$, Boundary Value Problems, 2009 (2009), 1-17. doi: 10.1155/2009/563767. [14] A. Kh. Khanmamedov, Existence of a global attractor for the parabolic equation with nonlinear Laplacian principal part in an unbounded domain, J. Math. Anal. Appl., 316 (2006), 601-615. doi: 10.1016/j.jmaa.2005.05.003. [15] A. Kh. Khanmamedov, Global attractors for one dimensional $p$-Laplacian equation, Nonlinear Analysis: Theory, Methods & Applications, 71 (2009), 155-171. doi: 10.1016/j.na.2008.10.037. [16] M. Yang, C. Sun and C. Zhong, Existence of a global attractor for a $p$-Laplacian equation in $R^n$, Nonlinear Analysis: Theory, Methods and Applications, 66 (2007), 1-13. doi: 10.1016/j.na.2005.11.004. [17] C. T. Anh and T. D. Ke, Long time behavior for quasilinear parabolic equations involving weighted p-Laplacian operators, Nonlinear Analysis: Theory, Methods & Applications, 71 (2009), 4415-4422. doi: 10.1016/j.na.2009.02.125. [18] C. T. Anh and T. D. Ke, On quasilinear parabolic equations involving weighted p-Laplacian operators, Nonlinear Differential Equations and Applications, 17 (2010), 195-212. doi: 10.1007/s00030-009-0048-3. [19] A. Kh. Khanmamedov, Global attractors for 2-D wave equations with displacement-dependent damping, Math. Methods Appl. Sci., 33 (2010), 177-187. doi: 10.1002/mma.1161. [20] R. E. Showalter, "Monotone Operators in Banach Space and Nonlinear Partial Differential Equations," Mathematical Surveys Monographs, 49, American Mathematical Society, 1997. [21] J. Simon, Compact sets in the space $L_p(0, T;B)$, Annali Mat. Pura Appl., 146 (1987), 65-96. doi: 10.1007/BF01762360. [22] M. A. Krasnoselskii and Y. B. Rutickii, "Convex Functions and Orlicz Spaces," P. Noordhoff Ltd., Groningen, 1961. [23] J.-L. Lions and E. Magenes, "Non-homogeneous Boundary Value Problems and Applications," 1, Springer-Verlag, New York-Heidelberg, 1972. [24] O. A. Ladyzhenskaya, On the determination of minimal global attractors for the Navier-Stokes equations and other partial differential equations, Uspekhi Mat. Nauk, 42 (1987), 25- 60; Russian Math. Surveys, 42 (1987), 27-73 (English Transl.). doi: 10.1070/RM1987v042n06ABEH001503.
 [1] Linfang Liu, Xianlong Fu. Existence and upper semicontinuity of (L2, Lq) pullback attractors for a stochastic p-laplacian equation. Communications on Pure and Applied Analysis, 2017, 6 (2) : 443-474. doi: 10.3934/cpaa.2017023 [2] Bo You, Yanren Hou, Fang Li, Jinping Jiang. Pullback attractors for the non-autonomous quasi-linear complex Ginzburg-Landau equation with $p$-Laplacian. Discrete and Continuous Dynamical Systems - B, 2014, 19 (6) : 1801-1814. doi: 10.3934/dcdsb.2014.19.1801 [3] Xuping Zhang. Pullback random attractors for fractional stochastic $p$-Laplacian equation with delay and multiplicative noise. Discrete and Continuous Dynamical Systems - B, 2022, 27 (3) : 1695-1724. doi: 10.3934/dcdsb.2021107 [4] T. F. Ma, M. L. Pelicer. Attractors for weakly damped beam equations with $p$-Laplacian. Conference Publications, 2013, 2013 (special) : 525-534. doi: 10.3934/proc.2013.2013.525 [5] Jacson Simsen, José Valero. Global attractors for $p$-Laplacian differential inclusions in unbounded domains. Discrete and Continuous Dynamical Systems - B, 2016, 21 (9) : 3239-3267. doi: 10.3934/dcdsb.2016096 [6] Kerstin Does. An evolution equation involving the normalized $P$-Laplacian. Communications on Pure and Applied Analysis, 2011, 10 (1) : 361-396. doi: 10.3934/cpaa.2011.10.361 [7] Robert Stegliński. On homoclinic solutions for a second order difference equation with p-Laplacian. Discrete and Continuous Dynamical Systems - B, 2018, 23 (1) : 487-492. doi: 10.3934/dcdsb.2018033 [8] Michael Filippakis, Alexandru Kristály, Nikolaos S. Papageorgiou. Existence of five nonzero solutions with exact sign for a $p$-Laplacian equation. Discrete and Continuous Dynamical Systems, 2009, 24 (2) : 405-440. doi: 10.3934/dcds.2009.24.405 [9] Tomás Caraballo, Marta Herrera-Cobos, Pedro Marín-Rubio. Global attractor for a nonlocal p-Laplacian equation without uniqueness of solution. Discrete and Continuous Dynamical Systems - B, 2017, 22 (5) : 1801-1816. doi: 10.3934/dcdsb.2017107 [10] Mohammad A. Rammaha, Daniel Toundykov, Zahava Wilstein. Global existence and decay of energy for a nonlinear wave equation with $p$-Laplacian damping. Discrete and Continuous Dynamical Systems, 2012, 32 (12) : 4361-4390. doi: 10.3934/dcds.2012.32.4361 [11] Stanislav Nikolaevich Antontsev, Serik Ersultanovich Aitzhanov, Guzel Rashitkhuzhakyzy Ashurova. An inverse problem for the pseudo-parabolic equation with p-Laplacian. Evolution Equations and Control Theory, 2022, 11 (2) : 399-414. doi: 10.3934/eect.2021005 [12] Shun Uchida. Solvability of doubly nonlinear parabolic equation with p-laplacian. Evolution Equations and Control Theory, 2022, 11 (3) : 975-1000. doi: 10.3934/eect.2021033 [13] Anhui Gu. Weak pullback mean random attractors for non-autonomous $p$-Laplacian equations. Discrete and Continuous Dynamical Systems - B, 2021, 26 (7) : 3863-3878. doi: 10.3934/dcdsb.2020266 [14] Xin-Guang Yang, Marcelo J. D. Nascimento, Maurício L. Pelicer. Uniform attractors for non-autonomous plate equations with $p$-Laplacian perturbation and critical nonlinearities. Discrete and Continuous Dynamical Systems, 2020, 40 (3) : 1937-1961. doi: 10.3934/dcds.2020100 [15] Pavel Jirásek. On Compactness Conditions for the $p$-Laplacian. Communications on Pure and Applied Analysis, 2016, 15 (3) : 715-726. doi: 10.3934/cpaa.2016.15.715 [16] Dimitri Mugnai. Bounce on a p-Laplacian. Communications on Pure and Applied Analysis, 2003, 2 (3) : 371-379. doi: 10.3934/cpaa.2003.2.371 [17] Vitali Liskevich, Igor I. Skrypnik, Zeev Sobol. Estimates of solutions for the parabolic $p$-Laplacian equation with measure via parabolic nonlinear potentials. Communications on Pure and Applied Analysis, 2013, 12 (4) : 1731-1744. doi: 10.3934/cpaa.2013.12.1731 [18] Ronghua Jiang, Jun Zhou. Blow-up and global existence of solutions to a parabolic equation associated with the fraction p-Laplacian. Communications on Pure and Applied Analysis, 2019, 18 (3) : 1205-1226. doi: 10.3934/cpaa.2019058 [19] Phuong Le. Symmetry of singular solutions for a weighted Choquard equation involving the fractional $p$-Laplacian. Communications on Pure and Applied Analysis, 2020, 19 (1) : 527-539. doi: 10.3934/cpaa.2020026 [20] Fuensanta Andrés, Julio Muñoz, Jesús Rosado. Optimal design problems governed by the nonlocal $p$-Laplacian equation. Mathematical Control and Related Fields, 2021, 11 (1) : 119-141. doi: 10.3934/mcrf.2020030

2020 Impact Factor: 1.916