text:
# Iterating hash values to a log file

•
•
•
•
•
•

While working on my last script, I was trying to figure out the best way to write the values stored in a hash table for the purposes of splatting out to a log file.

Consider:

$parameters = @{}$parameters.Add("Parameter1","Value1")$parameters.Add("Parameter2","Value2")$parameters.Add("Parameter3","Value3")

I was using a modified version of my logging function, which is basically a wrapper for Add-Content with parameters for log detail/types, colors, and output display.

One of the “display” things I wanted to fix was to make sure that each parameter showed up on its own line in console output or in the log file.  To that end, this didn’t work:

So, instead of printing the objects in the table, it just prints, “Hi, I’m a hashtable.”  Not the most useful thing if you’re trying to capture detailed data. I also tried a few other things:

What I ended up doing to get the display the way I wanted:

$parameters.GetEnumerator() | % { Write-Log -LogLevel DEBUG -ConsoleOutput -Message "Parameter Name:$($_.Name); Paramater Value:$($_.Value)" } [2019-01-15 10:37:09] [DEBUG] :: Parameter Name:Parameter2; Parameter Value: Value2 [2019-01-15 10:37:09] [DEBUG] :: Parameter Name:Parameter1; Parameter Value: Value1 [2019-01-15 10:37:09] [DEBUG] :: Parameter Name:Parameter3; Parameter Value: Value3 Using the GetEnumerator() method on the hash returned the parameter key/value pair, and allowed me to reference them independently using$_.Name (Key) and $_.Value (Value). Armed with the appropriate data, I could capture each parameter / value pair in the hash table and send them to either the display or log file. Semi-pro tip: You’ll notice that I had added my parameters to the hash table using the Add() method in a one order, but the system returned them to me in a different order. It didn’t matter from the splatting perspective, but if you want to set a defined order that values are stored, you can use the [ordered] property when creating the hash: $orderedhash.Add("Parameter1","Value1")
$orderedhash.Add("Parameter2","Value2")$orderedhash.Add("Parameter3","Value3")
$orderedhash.Add("Parameter4","Value4")$orderedhash

Name Value
---- -----
Parameter1 Value1
Parameter2 Value2
Parameter3 Value3
Parameter4 Value4

That’s all for now!


text:
# [NTG-context] indenting of first paragraph in (sub)section

Vyatcheslav Yatskovsky yatskovsky at gmail.com
Mon Dec 11 20:08:06 CET 2006

Hello,

I' trying to figure out why

\setupindenting[first,medium,yes]

does not indents the FIRST paragraph of a section or subsection.

An example follows.

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

\setupbodyfont[lbr,11pt]

\setuppapersize[A4]
\setuplayout[width=17cm,height=28cm, topspace=1cm, header=1cm, footer=1cm, location=middle]

\setupitemize[n,joinedup]
\setuppagenumbering[location=]

\setupwhitespace[medium]
\setupindenting[first,medium,yes]

\showframe

\starttext

\section{INTRODUCTION}

\subsection{Rationale}

Anyone who has been around the computer industry for a decade or more is well aware of this phenomenon: machines are getting exponentially more powerful per unit cost, yet users do not perceive this improvement in the applications that they purchase. For example, while word processors are clearly faster today than they were 21 years ago, they aren't 16,384 times faster as Moore's Law would suggest. Part of the problem, of course, is that some of the additional processing power has been employed to support new features (such as a bit-mapped display), but a large part of the reason software users aren't seeing an increase in speed is because many of today's programmers don't take the time to write efficient software, or they simply {\it don't know} how to write fast code.

\stoptext

--
С наилучшими пожеланиями,
Vyatcheslav                          mailto:yatskovsky at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.ntg.nl/pipermail/ntg-context/attachments/20061211/ff87c637/attachment.html

format: plain


text:
# References

Allaire, J., Cheng, J., Xie, Y., McPherson, J., Chang, W., Allen, J., … Arslan, R. (2017). Rmarkdown: Dynamic documents for r. Retrieved from https://CRAN.R-project.org/package=rmarkdown

AlMuhayfith, F. E., Alzaid, A. A., & Omair, M. A. (2016). On bivariate poisson regression models. Journal of King Saud University - Science, 28(2), 178–189. https://doi.org/10.1016/j.jksus.2015.09.003

Altun, Y., Johnson, M., & Hofmann, T. (2003). Investigating loss functions and optimization methods for discriminative learning of label sequences. In Proceedings of the 2003 conference on empirical methods in natural language processing (pp. 145–152). Association for Computational Linguistics.

Betancourt, M. (2016). Diagnosing suboptimal cotangent disintegrations in hamiltonian monte carlo. Retrieved from https://arxiv.org/abs/1604.00695

Betancourt, M. (2017). A conceptual introduction to hamiltonian monte carlo. Retrieved from https://arxiv.org/abs/1701.02434

Brooks, S., & Gelman, A. (1997). General methods for monitoring convergence of iterative simulations. Journal of Computational and Graphical Statistics, 7, 434–455.

Gelman, A., & Hill, J. (2006). Data analysis using regression and multilevel/hierarchical models (1st ed.). Cambridge, England: Cambridge University Press.

Gelman, A., & Rubin, D. (1992). Inference from iterative simulation using multiple sequences. Statistical Science, 7, 457–511.

Gelman, A., Carlin, J. B., Stern, H. S., Dunson, D. B., Vehtari, A., & Rubin, D. B. (2014). Bayesian data analysis (3rd ed.). Boca Raton, FL: CRC Press.

Griffiths, R., & Milne, R. (1978). A class of bivariate poisson processes. Journal of Multivariate Analysis, 8(3), 380–395. https://doi.org/10.1016/0047-259X(78)90061-1

Grolemund, G. (2016, November). Extracting Data From the Web Part 2. Retrieved from https://www.rstudio.com/resources/webinars/extracting-data-from-the-web-part-2/

Grolemund, G., Spinu, V., & Wickham, H. (2016). Lubridate: Make dealing with dates a little easier. Retrieved from https://CRAN.R-project.org/package=lubridate

Groll, A., Kneib, T., Mayr, A., & Schauberger, G. (2016). Who’s the favourite? A bivariate poisson model for the uefa european football championship 2016. Retrieved from http://nbn-resolving.de/urn/resolver.pl?urn=nbn:de:bvb:19-epub-29028-8

Guo, J., Gabry, J., & Goodrich, B. (2017). Rstan: R interface to stan. Retrieved from https://CRAN.R-project.org/package=rstan

Hoffman, M. D., & Gelman, A. (2014). The no-u-turn sampler: Adaptively setting path lengths in hamiltonian monte carlo. Journal of Machine Learning Research, 15, 1351–1381.

Johnson, P. E. (2016). PortableParallelSeeds: Allow replication of simulations on parallel and serial computers. Retrieved from https://CRAN.R-project.org/package=portableParallelSeeds

Karlis, D., & Ntzoufras, I. (2003). Analysis of sports data by using bivariate poisson models. The Statistician, 52, 381–393.

Karlis, D., & Ntzoufras, I. (2005). Bivariate poisson and diagonal inflated bivariate poisson regression models in r. Journal of Statistical Software, 14(10), 1–17.

Kawamura, K. (1973). The structure of bivariate poisson distribution. Kodai Math. Sem. Rep., 25(2), 246–256. https://doi.org/10.2996/kmj/1138846776

R Core Team. (2017). R: A language and environment for statistical computing. Vienna, Austria: R Foundation for Statistical Computing. Retrieved from https://www.R-project.org/

Roy, N., & McCallum, A. (2001). Toward optimal active learning through monte carlo estimation of error reduction. In International conference on machine learning (pp. 441–448). Williamstown: International Machine Learning Society.

Schloerke, B., Crowley, J., Cook, D., Briatte, F., Marbach, M., Thoen, E., … Larmarange, J. (2016). GGally: Extension to ’ggplot2’. Retrieved from https://CRAN.R-project.org/package=GGally

Stan Development Team. (2016a). Brief guide to stan’s warnings. Retrieved from http://mc-stan.org/misc/warnings.html

Stan Development Team. (2016b). RStan: The r interface to stan. Retrieved from https://cran.r-project.org/web/packages/rstan/vignettes/rstan.html

Stan Development Team. (2016c). Stan modeling language: User’s guide and reference manual. Retrieved from http://mc-stan.org/documentation/

Whitaker, G. (2011, May). The bivariate poisson distribution and its applications to football (PhD thesis). Newcastle University.

Wickham, H. (2016a). Plyr: Tools for splitting, applying and combining data. Retrieved from https://CRAN.R-project.org/package=plyr

Wickham, H. (2016c). Rvest: Easily harvest (scrape) web pages. Retrieved from https://CRAN.R-project.org/package=rvest


text:
※ Zoom meeting

ID: 834 5325 6158

Passcode: 662766

In this talk, we will consider whether a machine can be trained to recognize patterns in mathematics. As a case study, some basic invariants in number theory such as the class number of a real quadratic field and the rank of an elliptic curve will be tested through machine-learning tools. We will observe that machine-learning classifiers perform surprisingly well with high accuracy (> 0.97).


text:
# Tohelp you identify the course assistants when they are holding office hours in room 206D of the Psychology Resource Office (PRO),

###### Question:

Tohelp you identify the course assistants when they are holding office hours in room 206D of the Psychology Resource Office (PRO), they will be wearing (insert color) name tags. Therefore, PSY 301 students should only ask people wearing that color name tag for PSY 301 help while in PRO

### The weight of mr nazeer is 7 times that of his son. What's the ratio of their weights?

The weight of mr nazeer is 7 times that of his son. What's the ratio of their weights?...

### PLS HELP I'LL MARK YOU BRAINLIST

PLS HELP I'LL MARK YOU BRAINLIST $PLS HELP I'LL MARK YOU BRAINLIST$...

### Who knows how to do this I TRULY NEED HELP

Who knows how to do this I TRULY NEED HELP $Who knows how to do this I TRULY NEED HELP$...

### Multiply. write your answer as a fraction in simplest form. 10/11×3/7×1/2 explain

Multiply. write your answer as a fraction in simplest form. 10/11×3/7×1/2 explain...

### I need help asapWhat inequality does this graph represent?Explain how you determined the inequality that is represented by the

I need help asap What inequality does this graph represent? Explain how you determined the inequality that is represented by the given graph. What was your thought process? What is a real-world situation that can be modeled using this graph or part of the graph? In your answer, include how you wou...

### Identify and explain FIVE recommendations to address teenage pregnancy.

Identify and explain FIVE recommendations to address teenage pregnancy....

### Due soon the greater of two consecutive integers is nine more than twice the lesser integer. what are

Due soon the greater of two consecutive integers is nine more than twice the lesser integer. what are the two integers? (enter your answers as a comma-separated list.)...

### BLM, THIS IS A FACT, T F EVEN IS A BLUE LIFE ANYWAYS, THE ONLY BLUE LIVES THAT MATTER ARE THE SMURFS,

BLM, THIS IS A FACT, T F EVEN IS A BLUE LIFE ANYWAYS, THE ONLY BLUE LIVES THAT MATTER ARE THE SMURFS, PROVE ME WRONG....

### You buy an item for $74.95, and the sales tax is 4.5%. You give the clerk four$20 bills. Figure the following amounts:-The amount of

You buy an item for $74.95, and the sales tax is 4.5%. You give the clerk four$20 bills. Figure the following amounts: -The amount of sales tax -The total cost including tax -The amount of change you should receive....

### An elevator ascends, goes up at a rate of 750 feet per min. is the height to which the elevator ascends

An elevator ascends, goes up at a rate of 750 feet per min. is the height to which the elevator ascends proportional to the number of mins it takes to get there...

### The axis of symmetry for a function in the form f(x) = x2 + 4x − 5 is x = −2. what are the coordinates of the vertex of the

The axis of symmetry for a function in the form f(x) = x2 + 4x − 5 is x = −2. what are the coordinates of the vertex of the graph?...

### I’ll mark you brainliest if you get it right

I’ll mark you brainliest if you get it right $I’ll mark you brainliest if you get it right$...

### 3. In selecting potential warehouse sites, it is important to consider issues such as geographical and

3. In selecting potential warehouse sites, it is important to consider issues such as geographical and infrastructure conditions, natural resources and labor availability, local industry and tax regulations, and public interest. For each of the following industries, give specific but brief examples ...

### Mud, silt, and clay are all examples of

Mud, silt, and clay are all examples of...

### Why might a governor be reluctant to call for federal troops to combat domestic violence in a city in their state?

Why might a governor be reluctant to call for federal troops to combat domestic violence in a city in their state?...

### Assume that, for safety, the car is launched with an initial velocity that is 10% greater than the minimum launch speed, and

Assume that, for safety, the car is launched with an initial velocity that is 10% greater than the minimum launch speed, and maintains this velocity throughout its motion What will be the magnitude of the force of the track on the car when the car is at the top of the loop?...


text:
# Lyman-alpha

## Simulating Lyman-alpha Emitters

Below plots show first results of our new radiative transfer code for meshless structures applied to individual halos in the IllustrisTNG simulations. Lyman-alpha emitter after radiative transfer. Surface brightness in erg/s/cm$^2$/arcsec$^2$. Lyman-alpha emitter after radiative transfer. Artificially lowered neutral hydrogen density by a factor of $10$, revealing the radiative transfer smoothing out the emission from the star forming regions. Surface brightness in erg/s/cm$^2$/arcsec$^2$. The neutral hydrogen column density responsible for scattering out the injected photons in star forming regions.

## IGM Interaction of Lyman-alpha Emitters Spectra

Lyman-alpha emitters (LAEs) show a rich variety of spectral shapes due to the emission line’s resonant nature and typically high optical depths. While there is a large body of literature exploring how small-scale density and velocity distributions can explain this variety of features in spectra, the intergalactic medium (IGM) has often been neglecting as a contributing factor for such features. Above sketch helps visualizing how the IGM density and velocity structure along a line-of-sight give rise to an attenuation profile possibly shaping the arising spectrum.

## Radiative Transfer on Voronoi Meshes

An increasing amount of astrophysical and cosmological simulations are carried out on a moving unstructed mesh defined by the Voronoi tessellation. Lately, we expanded the priorly used code in Behrens et al., 2019 (public version here) to work on such meshless structure. This will ensure the code’s relevance in the future and application to new simulations that would not have been able to be processed with prior code due to the larger memory requirement due to an intermediate interpolation step.

## Clustering Distortions from Lyman-alpha Radiative Transfer

Introduction Lyman-$\alpha$ emitters and their intensity map are powerful probes of the large-scale structure. Given typically very high optical depths, scatterings with neutral hydrogen have a non-negligible impact on the observed distribution of Lyman-$\alpha$ photons. To study this in detail, we run a suit of radiative transfer (RT) simulations on the Illustris simulation and investigate two possible distortion effects arising from RT in real space as well as in redshift space for the two-point correlation function.

## Clustering Distortions from Lyman-alpha Radiative Transfer - A short introduction

The dimensionally split power spectrum/two-point correlation are standard tools for constraining the cosmological model from redshift surveys. Given the Lyman-alpha emission line, I will try to motivate what significant distortions from the line's …

## Clustering Distortions from Lyman-alpha Radiative Transfer

Lyman-alpha based emission line surveys are prone to errors in their interpretation due to the complex radiative transfer for this line. We address this issue by running full radiative transfer simulations on the Illustris simulations and generate …

## Cosmological radiative transfer simulations of Lyman-alpha emission: the impact on the galaxy clustering

Lyman-alpha emitters and their intensity map are powerful probes of the large-scale structure at optical and near-infrared wavelength as HETDEX plans. However, the fact that the Lyman-alpha photons are scattered due to the neutral hydrogen has …

## Impacts of the Large Scale Structure on Detected Lyman Alpha Emitters

In 1967 Partridge and Peebles theorized that young galaxies at high redshifts emitting Lyman-α photons might be a suitable tracer of large-scale structure. Those distant galaxies of high Lyman-α emission, so-called Lyman Alpha Emitters (LAEs) can be used to constrain the cosmological standard model at high redshifts and furthermore allow insight for the environment of those galaxies. The Lyman-α line corresponds to the energy difference from the ground state to the first excited state of neutral hydrogen.

## Radiative Transfer Simulations of Lyman Alpha Emitters on Cosmological Scales

Lyman-alpha emitters can be used as probes of the large-scale structure at intermediate redshifts. Recent work discusses a possible distortion from radiative transfer effects of the resonant Lyman-alpha line on the observed clustering statistics, …


text:
# Matlab Project

Design a Matlab code to calculate the pressure drop in 3 pipes

Attachments:

Related Questions in Investment Analysis and Portfolio Management
• Integrating liquidity into the mean variance optimization (Solved) December 23, 2012

. A Matlab code that implements selected Liquidity Metrics (Turnover, Bid Ask spread, Percentage Volumes) as specified in the Andrew Lo Paper in a monthly period. (in the excel file there...

Solution Preview :
• Matlab code to integrate liquidity into the standard optimization... December 23, 2012

Given the description provided by A.J. Lo in the paper attached about introducing liquidity into mean variance optimization, I would need Matlab codes to perform the three approaches on...

• Fianance Help... (Solved) January 22, 2014

costs are $775,000 per year. The tax rate is 35 percent, and we require a return of 11 percent on this project . 1. Calculate the base-case cash flow and NPV 2. What is the sensitivity of... Solution Preview : Calculation of depreciation per annum Cost of the project$ 1,675,000 Useful Life (Years) 6 Salvage Value 0 Depreciation per annum \$ 279,167 Cash Inflows after tax Sales (units) 91,000...
• NPV and IRR (Solved) May 26, 2012

QUESTION 4 (30 marks) Pirates Limited ow ns two acres of derelict land near to the centre of a major city. The company has received an invoice for R50 000 from consultants who were given...

• Pirates Limited owns two acres of derelict land near to the centre of a... (Solved) October 30, 2015

Pirates Limited owns two acres of derelict land near to the centre of a major city. The company has received an invoice for R50 000 from consultants that were given the task of analysing,...

Solution Preview :
Solution is attached. This assignment requires to analyse two projects and identify which project should be selected. This is done by using the concept of Net Present Value and Internal Rate...


text:
By Murray Bourne, 17 Aug 2006

This was not made very obvious when I installed IE7:

OS Updates--Do not reinstall any version of Microsoft Windows in any way after you install Internet Explorer 7. Do not upgrade in place or upgrade to a new edition. The workaround is to remove Internet Explorer 7 Beta, install operating system updates, and then reinstall Internet Explorer.

(Found at IE7's Release Notes.)

Hmm - of course, several updates have automatically installed themselves since then. So should I expect a blue screen of death sometime soon...?

1. Vinod says:

I've got a copy of Ubuntu Linux with your name on it!

2. Murray says:

Thanks, Vinod. Bring on open source... ^_^

### Comment Preview

HTML: You can use simple tags like <b>, <a href="...">, etc.

To enter math, you can can either:

1. Use simple calculator-like input in the following format (surround your math in backticks, or qq on tablet or phone):
a^2 = sqrt(b^2 + c^2)
(See more on ASCIIMath syntax); or
2. Use simple LaTeX in the following format. Surround your math with $$ and $$.
$$\int g dx = \sqrt{\frac{a}{b}}$$
(This is standard simple LaTeX.)

NOTE: You can't mix both types of math entry in your comment.


text:
Proving calculus concepts with set theory/sequences

1. Jul 1, 2012

Cinitiator

1. The problem statement, all variables and given/known data
How is the field of mathematics which focuses on defining the calculus concepts (such as limits) using the set theory and/or sequences called? Where numbers are seen as discrete, and concepts like limits are defined in these terms.

2. Relevant equations

3. The attempt at a solution
Googling, without much success.

2. Jul 1, 2012


text:
# Wydawnictwa / Banach Center Publications / Wszystkie tomy

## A note on the differences of the consecutive powers of operators

### Tom 38 / 1997

Banach Center Publications 38 (1997), 381-383 DOI: 10.4064/-38-1-381-383

#### Streszczenie

We present two examples. One of an operator T such that ${T^n(T-I)}_{n=1}^∞$ is precompact in the operator norm and the spectrum of T on the unit circle consists of an infinite number of points accumulating at 1, and the other of an operator T such that ${T^n(T-I)}_{n=1}^∞$ is convergent to zero but T is not power bounded.

#### Autorzy

• Andrzej Święch

## Przeszukaj wydawnictwa IMPAN

Zbyt krótkie zapytanie. Wpisz co najmniej 4 znaki.

Odśwież obrazek


text:
# Thread: This is an easy answer but i dont get it.

1. ## This is an easy answer but i dont get it.

OK, $t_{ab}=ax+b$. I have to prove this is a subgroup of S4. Now, Ive already proved closure by composition $t_{ab}=ax+b$ with $t_{cd}=cx+d$ to yield $(ac)x+(ad+b)$.

Now, the identities wrt composition are $a=1$ and $b=0$. What is the inverse!? How would you find the inverse wrt composition here?

Thanks!

2. Originally Posted by sfspitfire23
OK, $t_{ab}=ax+b$. I have to prove this is a subgroup of S4. Now, Ive already proved closure by composition $t_{ab}=ax+b$ with $t_{cd}=cx+d$ to yield $(ac)x+(ad+b)$.

Now, the identities wrt composition are $a=1$ and $b=0$. What is the inverse!? How would you find the inverse wrt composition here?

Thanks!
A subroup of...who??

Anyway, it must be that $T_{\alpha \beta}T_{ab}=x \Longrightarrow (a\alpha)x+(a\beta +b)=x$

Well, now just solve the above for $\alpha\,,\,\,\beta$

Tonio

3. So there indeed will be 2 inverses?

4. Originally Posted by sfspitfire23
So there indeed will be 2 inverses?

Of course not: this is a group. What gave you that idea?

Tonio


text:
# utilities¶

Utilities for the PDB2PQR software suite.

Code author: Todd Dolinsky

Code author: Yong Huang

Code author: Nathan Baker

pdb2pqr.utilities.add(coords1, coords2)[source]

Add one 3-dimensional point to another.

Parameters: coords1 ([float, float, float]) – coordinates of form [x,y,z] coords2 ([float, float, float]) – coordinates of form [x,y,z] list of coordinates equal to coords2 + coords1 numpy.ndarray
pdb2pqr.utilities.analyze_connectivity(map_, key)[source]

Analyze the connectivity of a given map using the key value.

Parameters: map (dict) – map to analyze key (str) – key value list of connected values to the key list
pdb2pqr.utilities.angle(coords1, coords2, coords3)[source]

Get the angle between three coordinates.

Parameters: coords1 ([float, float, float]) – first coordinate set coords2 ([float, float, float]) – second (vertex) coordinate set coords3 ([float, float, float]) – third coordinate set angle between the atoms (in degrees) float
pdb2pqr.utilities.cross(coords1, coords2)[source]

Find the cross-product of one 3-dimensional point with another.

Parameters: coords1 ([float, float, float]) – coordinates of form [x,y,z] coords2 ([float, float, float]) – coordinates of form [x,y,z] list of coordinates equal to coords2 cross coords1 numpy.ndarray
pdb2pqr.utilities.dihedral(coords1, coords2, coords3, coords4)[source]

Calculate the dihedral angle from four atoms’ coordinates.

Parameters: coords1 ([float, float, float]) – one of four coordinates of form [x,y,z] coords2 ([float, float, float]) – one of four coordinates of form [x,y,z] coords3 ([float, float, float]) – one of four coordinates of form [x,y,z] coords4 ([float, float, float]) – one of four coordinates of form [x,y,z] the angle (in degrees) float
pdb2pqr.utilities.distance(coords1, coords2)[source]

Calculate the distance between two coordinates.

Parameters: coords1 ([float, float, float]) – coordinates of form [x,y,z] coords2 ([float, float, float]) – coordinates of form [x,y,z] distance between the two coordinates float
pdb2pqr.utilities.dot(coords1, coords2)[source]

Find the dot-product of one 3-dimensional point with another.

Parameters: coords1 ([float, float, float]) – coordinates of form [x,y,z] coords2 ([float, float, float]) – coordinates of form [x,y,z] list of coordinates equal to the inner product of coords2 with coords1 numpy.ndarray
pdb2pqr.utilities.factorial(num)[source]

Returns the factorial of the given number.

Parameters: num (int) – number for which to compute factorial factorial of number int
pdb2pqr.utilities.normalize(coords)[source]

Normalize a set of coordinates to unit vector.

Parameters: coords ([float, float, float]) – coordinates of form [x,y,z] normalized coordinates numpy.ndarray
pdb2pqr.utilities.shortest_path(graph, start, end, path=[])[source]

Find the shortest path between two nodes.

Uses recursion to find the shortest path from one node to another in an unweighted graph. Adapted from http://www.python.org/doc/essays/graphs.html

Parameters: graph (dict) – a mapping of the graph to analyze, of the form {0: [1,2], 1:[3,4], …} . Each key has a list of edges. start (str) – the ID of the key to start the analysis from end (str) – the ID of the key to end the analysis path (list) – optional argument used during the recursive step to keep the current path up to that point list of the shortest path or None if start and end are not connected list
pdb2pqr.utilities.sort_dict_by_value(inputdict)[source]

Sort a dictionary by its values.

Parameters: inputdict (dict) – the dictionary to sort list of keys sorted by value list
pdb2pqr.utilities.subtract(coords1, coords2)[source]

Suntract one 3-dimensional point from another.

Parameters: coords1 ([float, float, float]) – coordinates of form [x,y,z] coords2 ([float, float, float]) – coordinates of form [x,y,z] list of coordinates equal to coords2 - coords1 numpy.ndarray


text:
Linear approximations

In single variable calculus we had: $\Delta f\approx f^{\prime}\cdot \Delta x.$ The previous expression can be made precise but we won’t do that. This is a motivational paragraph, so we’ll talk about how calculators and computers handle the calculation of $$\sin x$$, $$e^{x^3}$$ and similar functions.

The electronic devices are quite good at adding, subtracting, and multiplying numbers. The electricity can be tricked into doing basic operations using logic gates. However, it is not easy to make a logic gate that calculates $$e^{x\cos x}$$. In general, for non-linear functions $$f$$ calculators use approximation techniques.

The memories of calculators are manufactured already with the list of values f(0), f(0.00001), f(0.00002), and a few other values of f. The derivatives of f at these points are also stored in the memory. When a user asks for evaluation of $$f(x)$$, the calculator posses the value some $$x_0$$ that is close to $$x$$. This means that the difference $$\Delta x=x-x_0$$ is small, and the approximation $$f(x)-f(x_0)=\Delta f\approx f^{\prime}(x_0)\cdot \Delta x$$ is quite accurate. The calculator returns $$f(x_0)+\Delta f$$ and the user is left impressed and recommends the calculator to friends and family.

Assume that we now have a function $$g$$ of two variables and that we know the value of $$g$$ at $$(x_0,y_0)$$ as well as $$g_x(x_0,y_0)$$ and $$g_y(x_0,y_0)$$. Let us assume that $$(x,y)$$ is close to $$(x_0,y_0)$$. Denote $$\Delta g=g(x,y)-g(x_0,y_0)$$, $$\Delta x=x-x_0$$, and $$\Delta y=y-y_0$$. Then we have: $\Delta g= \Big(g(x,y)-g(x_0,y)\Big)+\Big(g(x_0,y)-g(x_0,y_0)\Big).$ Let us examine the difference: $$g(x,y)-g(x_0,y)$$. The value of $$y$$ does not change. This is really good news, because we may consider this difference as a function of $$x$$ and apply our knowledge from single variable calculus. Since $$y$$ is fixed, the appropriate derivative that we will use is the derivative with respect to $$x$$. We obtain: $$g(x,y)-g(x_0,y)=g_x(x_0,y)\Delta x$$. Similarly, we have $$g(x_0,y)-g(x_0,y_0)=g_y(x_0,y_0)\Delta y$$. We also notice that $$g_x(x_0,y)\approx g_x(x_0,y_0)$$. $\Delta g\approx g_x\Delta x+ g_y\Delta y=\langle g_x(x_0,y_0),g_y(x_0,y_0)\rangle \cdot \langle \Delta x, \Delta y\rangle.$ The last expression is written in the form of dot product of vectors $$\langle g_x,g_y\rangle$$ and $$\langle \Delta x, \Delta y\rangle$$. In this form it is analogous to the formula from the beginning of this section.

Example

Find a function $$f$$ such that $$\nabla f=\langle x^2+y,x+y^3\rangle$$.

Example

Let $$f(x,y)=(x^4+y^2)\ln(x^2+y^4)$$. Find an approximate value of $$f(0.98,0.3)$$.

2005-2018 IMOmath.com | imomath"at"gmail.com | Math rendered by MathJax


text:
The Physics Behind Bungee Jumping

1. Mar 18, 2004

toosm:)ey

Hey, this is my first time on the forum and I have to do a project about bungee jumping.

I need to talk about Hooke's Law, calculate The Conservation of Energy and the Conservation of Momentum...

I know that F=k*x, but I am still a little unsure on how to relate it to bungee jumping.

Assuming that there is no loss of energy due to friction, air resistance etc etc, I am confused on how the conservation of momentum and conservation of energy relate to bungee jumping. I would like to know how to calculate these topics for bungee jumping.

Of course, this is my homework, so I am not expecting you to do it for me, although it would be a great help!

Thankyou!

Smiley

2. Mar 18, 2004

Before you jump, you're at a certain height above the ground. We can attribute to this height a certain amount of potential energy. When you jump off, this energy starts to be converted into kinetic energy, and you speed up while you fall. Then the bungee cord kicks in and starts transforming the kinetic energy and potential energy to elastic energy, which is stored in the cord and why it stretches. Once you stop, most (hopefully there'll still be SOME left so you don't smash into the ground) of the potential energy and all of the kinetic energy (hence, stopped) has been converted to elastic energy.

It's all about the energy! If you idealize your world enough, the calculations are pretty simple, too.

Does that help?

3. Mar 18, 2004

toosm:)ey

Yes! Thankyou!

Potential = m*g*h (mass * gravity * height) ?
Kinetic = 0.5 * m * v^2 (mass * velocity^2) ?
Elastic potential = ???

4. Mar 18, 2004

$$\textrm{Elastic Energy} = \frac{1}{2}kx^2$$
where k is an empirically determined constant and x is the displacement off of the rest position of the cord.

5. Mar 18, 2004

toosm:)ey

How do I find k?

6. Mar 18, 2004

I imagine the manufacturers of bungee cords are required to publish them. If not, you just test it by putting a few weights of known mass on the cord and measure how far it stretches. The graph of displacement off of rest position vs. mass will yield a straight line, the slope of which can be used to calculate the constant.

7. Mar 18, 2004

toosm:)ey

Wicked! Thanks! You're a great help!

If I have any more questions, I'll come back, for now, I think I am good =)

Thanks again

8. Mar 18, 2004

toosm:)ey

Okay, I think I have things figured out so far. Could you check it for me please?

Height of bridge = 100m
Rope Length = 60m
Elongation = 50% (30m)
Mass = 75kg

To find k in (F=kx)

F=m*g F=(75kg)x(9.81m/s^2) F=735.75N

F=k*x 735.75N=k(30m) k=24.525

That good so far?

As the rope is 60m, does this mean that the equilibrium is at 60m? And because the rope does not compress, the equilibrium is also at 60m to 100m high?

The person is at his maximum speed at 60m? How do I find his maximum speed? I know speed=distance/time, but I do not know the time.

I'd like to go bungee jumping and see, but I don't have time for that!

~Thanks for all your help!

Last edited: Mar 18, 2004
9. Mar 18, 2004

Yes, your calculations are correct.

How are you getting your data? It's generally advisable to use many data points in order to minimize error, although it is quite possible to determine the constant from a single point, as you just demonstrated.

Oh, and you might want to stick the units on the constant.

10. Mar 18, 2004

toosm:)ey

I made my data up... It's a hypothetical experiment. If there is no air resistance/drag, then he will be at terminal velocity at 60m?

The units for the constant are (N/m)?

Last edited: Mar 18, 2004
11. Mar 19, 2004

Chen

No, the maximum (or minimum) velocity is achieved when the acceleration is zero. This is because the acceleration is the derivative of the velocity, and as you know f(x) has a maximum (or minimum, or "twist") when f'(x) = 0.

This happens when the force that the rope makes on the person is equivalent to the gravitational force, but in the opposite direction. As you probably realize, this is exactly the equilibrium point, 90 meters below the bridge. (Of course, in this case the person doesn't stay still at the equilibrium point, since he still has kinetic energy.)

Last edited: Mar 19, 2004
12. Mar 19, 2004

I think that now that we got this discussion of maximum velocity going on, we should more precisely define a few things.

Imagine the guy isn't dropping. Imagine that he's simply hanging from the rope. The guy will be resting when the force is zero (thank you, Captain Obvious), and this will happen when the elastic force is exactly equal and opposite the gravitational force, i.e. kx = mg, x = mg/k, where x is the displacement from the cord if there were zero mass on it. So there is a difference between the rest position of the cord and the equilibrium position of the cord. They're different by a factor of mg/k. Note that this shift has no bearing on the remaining calculations, i.e. F still equals -kX, where X is defined as (x - mg/k).

That being said, the maximum velocity will be as Chen said, at the equilibrium position. It's not difficult to see by writing the full differential equation (it's not as scary as it sounds) for the motion of the bungee jumper and then deriving the equations of motion.

There's probably one other thing to keep in mind. I might be wrong about this, but I've never seen many bungee cords that compressed. So the elastic force should be F = -kX for X >= mg/k and F = 0 for X < mg/k, at which point the jumper is in free fall and the rope just kind of loops up. It complicates things, but it's not very difficult to deal with.

And yes, the spring constant will have units N/m.

13. Mar 19, 2004

toosm:)ey

Using

mass = 75kg
height, before = 200m, after = 140m

Energy before = Energy After

Potential + Kinetic = Potential + Kinetic
mgh + 0.5mv^2 = mgh + 0.5mv^2

(75)(9.81)(200) +(0.5)(75)(0^2) = (75)(9.81)(140) + (0.5)(75)(v^2)
147150J + 0 = 103005J + 37.5v^2
44145J = 37.5v^2
v^2 = 1177.2
v = 34.31m/s

This is the velocity at 140m (a 60m dive)... I think. Can anyone see a flaw in my calculations?

velocity = displacement / time
time = displacement / velocity
time = 60m / 34.31m/s
time = 1.75 s

The jumper is 40m above ground at 1.75 seconds.

Now for when the rope has elastic potential energy at maximum displacement:

Energy Before = Energy After
147150J = Potential + Kinetic + Elastic
147150J = mgh + 0.5mv^2 + 0.5kx^2
147150J = (75)(9.81)(h) + 0.5(75)(0^2) + 0.5(k)(x^2)

We need the height, the constant in the rope, and the maximum displacement,x,

Using F=kx and F=mg to determine k.

mg=kx
(75)(9.81)=kx

The maximum elasticity of the rope is 50%, so a rope that is 60m will stretch a maximum of 30m, before it loses it's elasticity (Hooke's Law). So, x = 30m.

735.75=-k(30)
k=-24.525N/m

147150J = (75)(9.81)(h) + 0.5(75)(0^2) + 0.5(-k)(30^2)
147150J = (735.75)(h) + 0 + -11036.25
735.75h =158186.25
h = 215m

However, how can it be 215m? it would be 15 metres above where it started... This is where I am confused.

14. Mar 19, 2004

Chen

That would be the first mistake. Generally speaking:

$$\Delta V \Delta t = \Delta X$$

In our case, however, the person's velocity is not constant. So the equation above is not true for large time intervals (it can only be used to calculate the momentary displacement).

You need to use the more general formula of:

$$X = X_0 + V_0 t + \frac {1}{2} at^2$$

Luckily for you, the initial displacement is 0 and so is the initial velocity. So finding the time should be a problem. :)

15. Mar 19, 2004

Chen

If the maximum elasticity of the rope is 50%, I'm afraid our jumper will not live to see another day. Because only when the rope is elongated by 50%, it exerts enough force to cancel the weight of the person. Until that point, the gravitational force was still stronger than the rope's force. This means that only at 50% the person's acceleration is zero, but as I explained above this is also the point in which the person has the maximum velocity. The rope must elongate by more than 50%, or it would tear apart. (In this specific case)

The second mistake is that your equation implies that the person is resting at 50% elongation, which is not true as I said. What you need to do is express h as a function of x (or x as a function of h), so that your equation only has one variable. The answer for x is only the minimum elastic range of the rope, if you want your daredevil jumper to survive.

Last edited: Mar 19, 2004
16. Mar 19, 2004

What level of math can you do? Can you solve the differential equation

$$m\ddot{y} = -mg - (y + \frac{mg}{k})$$

?

17. Mar 19, 2004

toosm:)ey

I am assuming that a is the acceleration, v is velocity, and t is time. Without the acceleration or time, I can't find the velocity.

I am in High School Calculus. We have learnt how to differentiate equations, but not those with so many variables.

Once the rope begins the elongate, the jumper loses velocity because his kinetic energy is transferred to elastic energy. His maximum velocity is at 140m, when there is no elastic potential energy. His maximum velocity is still 34.31m/s.

Energy Before = Energy After.

Susbsequent to a long night of thinking about it, my equation did not contain all the energies. Thermal (frictional) eenrgy was not included, which is huge because of the anture of bungee ropes. All those little stretchy things inside the rope rub against each other. In a rope of 60m, the thermal energy will be large? Of course, there are many other types of trace energies that are not counted for. But as they are so little, it would not alter my answer tremendously.

Last edited: Mar 19, 2004
18. Mar 19, 2004

toosm:)ey

But I do not know how much energy is Elastic energy because I do not know the ropes k value.

19. Mar 20, 2004

Chen

That is not precise. Once the rope begins to elongate, it does acquire elastic potential energy. But at first that energy comes at the expense of gravitational potential energy, not at the expense of kinetic energy. In fact, even when the elastic energy is growing, so does the kinetic energy until some point. That point is the equilibrium, in our case 50% elongation. Only then does the force of the rope begin to outbalance the weight of the person, which means his acceleration is now negative (he is decelerating). Only then does the kinetic energy begin to decrease.

His maximum velocity is not necessarily at the point where he has no elastic energy, it is at the point where he has the minimum of potential energy, which includes both elastic and gravitational energy. If you write down the equation of the person's potential energy (which is preserved, if we ignore friction and heat) you will get:

$$\Sigma E_p = E_{gra} + E_{els} = mgh + \frac{1}{2}kx^2$$

If you express h as a function of x you will get:

$$\Sigma E_p = mg(200 - x) + \frac{1}{2}kx^2$$

To find the minimal potential energy, get the derivative of the function and see where it is zero:

$${E'}_p = -mg + kx = 0$$
$$x = \frac{mg}{k}$$

This is the point where the potential energy of the diver is minimal, and therefore it is the point where his kinetic energy (and velocity) is maximal.

Do you understand or should I explain it a different way?

20. Mar 21, 2004

toosm:)ey

I understand... you're right

However, because of the lack of time, I don't have time to do all those calculations....

My website is at http://ca.geocities.com/physicsroxmysox/ [Broken], I am sure you can find lots of mistakes in my work, because you're all really intelligent at Physics!

Thankyou for all your help! I'll be sure to come back if I need any help

~Smiley

Last edited by a moderator: May 1, 2017


text:
### Frodo: Take off the ring! Practical, Quantum-Secure Key Exchange from LWE

Joppe Bos, Craig Costello, Léo Ducas, Ilya Mironov, Michael Naehrig, Valeria Nikolaenko, Ananth Raghunathan, and Douglas Stebila

##### Abstract

Lattice-based cryptography offers some of the most attractive primitives believed to be resistant to quantum computers. Following increasing interest from both companies and government agencies in building quantum computers, a number of works have proposed instantiations of practical post-quantum key exchange protocols based on hard problems in ideal lattices, mainly based on the Ring Learning With Errors (R-LWE) problem. While ideal lattices facilitate major efficiency and storage benefits over their non-ideal counterparts, the additional ring structure that enables these advantages also raises concerns about the assumed difficulty of the underlying problems. Thus, a question of significant interest to cryptographers, and especially to those currently placing bets on primitives that will withstand quantum adversaries, is how much of an advantage the additional ring structure actually gives in practice. Despite conventional wisdom that generic lattices might be too slow and unwieldy, we demonstrate that LWE-based key exchange is quite practical: our constant time implementation requires around 1.3ms computation time for each party; compared to the recent NewHope R-LWE scheme, communication sizes increase by a factor of 4.7$\times$, but remain under 12 KiB in each direction. Our protocol is competitive when used for serving web pages over TLS; when partnered with ECDSA signatures, latencies increase by less than a factor of 1.6$\times$, and (even under heavy load) server throughput only decreases by factors of 1.5$\times$ and 1.2$\times$ when serving typical 1 KiB and 100 KiB pages, respectively. To achieve these practical results, our protocol takes advantage of several innovations. These include techniques to optimize communication bandwidth, dynamic generation of public parameters (which also offers additional security against backdoors), carefully chosen error distributions, and tight security parameters.

Note: Full version of ACM CCS 2016 proceedings paper. Updated with correct communication sizes in Table 4.

Available format(s)
Category
Public-key cryptography
Publication info
Published elsewhere. MAJOR revision.ACM CCS 2016
DOI
10.1145/2976749.2978425
Keywords
key exchangelattice-based cryptographyLWE
Contact author(s)
mironov @ google com
History
2017-02-27: last of 3 revisions
See all versions
Short URL
https://ia.cr/2016/659

CC BY

BibTeX

@misc{cryptoeprint:2016/659,
author = {Joppe Bos and Craig Costello and Léo Ducas and Ilya Mironov and Michael Naehrig and Valeria Nikolaenko and Ananth Raghunathan and Douglas Stebila},
title = {Frodo: Take off the ring! Practical, Quantum-Secure Key Exchange from LWE},
howpublished = {Cryptology ePrint Archive, Paper 2016/659},
year = {2016},
doi = {10.1145/2976749.2978425},
note = {\url{https://eprint.iacr.org/2016/659}},
url = {https://eprint.iacr.org/2016/659}
}

Note: In order to protect the privacy of readers, eprint.iacr.org does not use cookies or embedded third party content.


text:
# Homework Help: Graph Problem

1. May 10, 2004

### mustang

Problem 12.
Sketch the graph of k(x)=x^4-64x^2.

2. May 11, 2004

### Muon12

Hmmm. Just graph the function of k? Well, to start off, you should make a chart of respective values for x such as:k(x) when x= 0,1,2,3,4,5,6,...n to as many values as you need to. For this problem, I recommend that you at least go from k(-8) to k(8), because there are zeros at those k values. Other than that, just work the problem out... set maximum horizontal and vertical values for the graph. The values are rather large in this problem, so make the vertical limits large enough to show the overall shape. That's all I suppose. Oh, and use a calculator if you can. This won't be fun if you try to do it by hand :yuck:.

Last edited: May 11, 2004
3. May 11, 2004

### Parth Dave

how much calculus do you know? There is a process using the derivatives of functions to allow you to sketch any function.

4. May 11, 2004

### arildno

We have:
$$x^{4}-64x^{2}=x^{2}(x^{2}-64)=x^{2}(x+8)(x-8)$$

Note the following:
$$\begin{itemize} \item -\infty\leq{x}\leq{-8}\rightarrow{k}(x)\geq{0}\\ \item -8\leq{x}\leq{8}\rightarrow{k}(x)\leq{0} \item 8\leq{x}\leq{\infty}\rightarrow{k}(x)\geq{0} \end{itemize}$$

5. May 11, 2004

### dlgoff

If you know any computer programing languages (perhaps Basic), you could write a simple loop program to give you some values or even plot it for you.

Regards

6. May 12, 2004

### Chen

It's been a while since I was asked to sketch function graphs, but here's what I think we used to do. First option is to follow these steps:

1) Find for which X the function is defined.

2) Find the intersection points of the function with the X and Y axes.

3) Find all minimum, maximum and "twist" (not sure what the English term is) points of the function.

4) Find for which X the function is ascending and for which X it is descending.

5) Find the asymptotes of the function if it has any.

So for your function: $$f(x) = x^4 - 64x^2 = x^2(x^2 - 64) = x^2(x + 8)(x - 8)$$

1) Any X.

2) (0, 0); (8, 0); (-8, 0).

3) $$f'(x) = 4x^3 - 128x = 4x(x^2 - 32) = 4x(x + \sqrt{32})(x - \sqrt{32})$$
$$f''(x) = 12x^2 - 128$$
Minimums: (-$\sqrt{32}$, -1024); ($\sqrt{32}$, -1024).
Maximum: (0, 0).

4) Descending: x < -$\sqrt{32}$; 0 < x < $\sqrt{32}$.
Ascending: -$\sqrt{32}$ < x < 0; $\sqrt{32}$ < x.

5) The function has no asymptotes.

Now draw your axes, mark the meaningful points we found, and considert the descending/ascending regions to complete the graph.

The second option is to buy a graphic calculator.

Good luck,


text:
# Relation between type-checking decidability, typability decidability and strong normalization

Yo! This is probably a stupid question, however I've never seen it written down explicitly if, for instance, decidability of type-checking is equivalent to the strong normalization property. Therefore I'm asking this question to clarify all possible relations between type-checking, typability and strong normalization.

Let me explain my motivation. For type theories (I'm being intentionally vague here, but I'm interested mainly in dependent type theories), strong normalization is used to prove the decidability of type-checking. On the other side, any typed systems that I know that have one of these properties also have the other one. However I've never seen explicitly stated that strong normalization is equivalent to decidability of type-checking.

Analogously, to prove typability, one usually (maybe always), reduces a term to a normal form. However it's know that typability is not true for dependent type theories, whereas strong normalization may hold.

By decidability of type-checking, I mean that for any given type $A$, context $\Gamma$ and untyped term $a$, it's possible to decide in a finite number of steps whether $\Gamma \vdash a: A$ is true or not.

By decidability of typability, I mean that for any given untyped term $a$, it's possible to decide in a finite number of steps whether there exist a context $\Gamma$ and a type $A$ such that $\Gamma \vdash a: A$ is true.

1)Is it true that decidability of type-checking is equivalent to every term being strongly normalizable?

2)More generally, what's the relation between decidability of type-checking, typability and strong normalization? Which one implies the other?

EDIT

Given the unsatisfaction regarding the level of generality of my question (which I was unaware of), I would like to delimit it only to Pure Type Systems. Of course, additional comments or counterexamples regarding other type theories will be of great utility.

• With no restrictions whatsoever? What if we take the trivial type system where every term has every type? That's trivially decidable but not normalizing. I fear that, in general, unless more constraints are put on the type system, there might be no relations among the notions you cite. – chi Apr 30 '17 at 23:19
• @chi I'm sorry. I wasn't aware of the level of generality of the definition of a typed system. What I had in mind was something like a fragment of Martin-Löf (extensional) type theory with universes. I believe, therefore, that Pure Typed Systems would be the correct bound in my question. – user40276 May 2 '17 at 3:39
• What do you mean that Expansion Postponement has been settled? The link is not available anymore. My understanding so far is that it is known to be true for a subclass of PTS (semi-full I think) but it is still an open conjecture for the general case. – Saroupille Jul 26 '19 at 8:02

I'll give a more focused and technical answer to Martin's. If we're interested in dependent type theories, then neither direction is obvious, but both are generally assumed to hold. However the direction Decidable $\Rightarrow$ Normalizing is open, I believe, even for relatively well understood systems, though we do have partial results. This question explores some of the same issues.

More technically: a good technical framework for these questions is the setting of Pure Type Systems in which normalization does imply decidability of type checking. The result is folklore, but non-trivial, since a strategy for when to apply the conversion rule needs to be found. The obvious strategy is to normalize inferred types before all applications of the application rule. There are some subtleties even here, where the correctness of a natural (more efficient) strategy called expansion postponment was open for a while, but has been settled since.

There are type systems which are normalizing but undecidable, most notably the system with intersection types which types exactly the normalizing terms, and so must be undecidable (since otherwise it could be used to identify normalizing terms). It would be tempting to say here that the system is defective in the sense that it is not type directed, i.e. the terms do not contain enough information to figure out the type.

Now the converse, which would suggest non-normalizing systems are undecidable, is far from obvious: it was even open for a while for the famous $Type:Type$ system of Martin-Löf! This case was solved by giving an example of a looping combinator, which allows writing arbitrary computations.

However the general problem is still open for general pure type systems, though it is widely believed to be true, and some partial results have been shown in this direction, e.g. here.

• Thanks for your answer. What about decidability of typability? – user40276 May 2 '17 at 3:59
• @user40276 this is a pretty different question. With annotations on the abstractions, typeability and type-inference are equally hard. Without annotations, things get undecidable almost immediately, regardless of termination, as explained in the answers here: cs.stackexchange.com/questions/12691/… – cody May 2 '17 at 13:14

(1) False. Counter example: Java, Scala, Haskell, ...

(2) No general relations hold, really depends on the details of the language/typing system. There is one exception: for sane languages and typing systems, I imagine that decidability of type inference (which I assume is what you mean by "typability") trivially implies type-checking. But I would not be surprised if one could concoct a crazy system where even that implication doesn't hold.

• Thanks for your answer. Typability refers to the process of finding a type such that a term belongs to it and not all these types. – user40276 May 2 '17 at 3:55
• How does this relate to the conventional concept of type-inference? – Martin Berger May 2 '17 at 8:20
• A specific example where decidable type-inference does not entail decidable type-checking: rank-2 polymorphic lambda calculus. There exist inference algorithms for this language, however they are not stable under the addition of type signatures. That is, we do not have that Γ⊢a:A entails Γ⊢(a::A):A where I'm using :: for the object-language's phrasing of "a has type A". Thus, even though we can infer A for a, we cannot always check a against A. – wren romano May 3 '17 at 5:41
• @wrenromano Interesting. System F has undecidable inference and checking, and rank-2 polymorphic lambda calculus is a subsystem (of sorts). Have you got a reference for this phenomenon? – Martin Berger May 3 '17 at 13:50
• Sorry. My comment is wrong as I have written, it should be: "Typability refers to the process of finding a type such that the given term belongs to it and not all these types". Decidability of type-inference implies decidability of typability. I'm almost sure that the reciprocal assertion does not hold, but I'm not aware of a counter-example. – user40276 May 4 '17 at 1:24


text:
## Bibliography

[DimockWestmacottMullerTurbakWellsXX]

Flow-Based Function Customization in the Presence of Representation Pollution, by Allyn Dimock, Ian Westmacott, Robert Muller, Franklyn Turbak and Joe Wells. Submitted, November 16, 2000.

Abstract: The CIL compiler for core Standard ML compiles whole ML programs using a novel typed intermediate language that supports the generation of type-safe customized data representations. In this paper, we present empirical data comparing the relative efficacy of several different customization strategies for function representations. We develop a cost model to interpret dynamic counts of operations required for each strategy. One of our results is data showing that compiling with a function representation strategy that makes customization decisions based on the presence or absence of free variables of a function and which removes representation pollution by introducing multiway dispatch (what we call the selective sink splitting strategy) can produce better code than that produced by a defunctionalizing strategy similar to that in the literature.

[DimockWestmacottMullerTurbakWellsConsidine00a]

Program Representation Size in an Intermediate Language with Intersection and Union Types, by Allyn Dimock, Ian Westmacott, Robert Muller, Franklyn Turbak, Joe Wells and Jeff Considine. To appear in the proceedings of the Third International Workshop on Types in Compilation, Montreal, CA, September 22, 2000.

Abstract: The CIL compiler for core Standard ML compiles whole programs using the CIL typed intermediate language with flow labels and intersection and union types. Flow labels embed flow information in the types and intersection and union types support precise polyvariant type and flow information, without the use of type-level abstraction or quantification.

Compile-time representations of CIL types and terms are potentially large compared to those for similar types and terms in systems based on quantified types. The listing-based nature of intersection and union types, together with flow label annotations on types, contribute to the size of CIL types. The CIL term representation duplicates portions of the program where intersection types are introduced and union types are eliminated. This duplication makes it easier to represent type information and to introduce multiple representation conventions, but incurs a compile-time space cost.

This paper presents empirical data on the compile-time space costs of using CIL. These costs can be made tractable using standard hash-consing techniques. Surprisingly, the duplicating nature of CIL has acceptable compile-time space performance in practice on the benchmarks and flow analyses that we have investigated. Increasing the precision of flow analysis can significantly reduce compile-time space costs. There is also preliminary evidence that the flow information encoded in CIL's type system can effectively guide data customization.

This paper supersedes an earlier version [DimockWestmacottMullerTurbakWellsConsidine00b] which appeared in an informal proceedings of the workshop.

[DimockWestmacottMullerTurbakWellsConsidine00b]

Space Issues in Compiling with Intersection and Union Types, by Allyn Dimock, Ian Westmacott, Robert Muller, Franklyn Turbak, Joe Wells and Jeff Considine. In the Informal Proceedings of the Third International Workshop on Types in Compilation, Montreal, CA, September 22, 2000. The Informal Proceedings were published as CMU Technical Report CMU-CS-00-161.

Abstract: The CIL compiler for core Standard ML compiles whole programs using the CIL typed intermediate language with flow labels and intersection and union types. Flow labels embed flow information in the types and intersection and union types support precise polyvariant type and flow information, without the use of type-level abstraction or quantification.

Compile-time representations of CIL types and terms are potentially large compared to those for similar types and terms in systems based on quantified types. The listing-based nature of intersection and union types, together with flow label annotations on types, contribute to the size of CIL types. The CIL term representation duplicates portions of the program where intersection types are introduced and union types are eliminated. This duplication makes it easier to represent type information and to introduce multiple representation conventions, but incurs a compile-time space cost.

This paper presents empirical data on the compile-time space costs of using CIL. These costs can be made tractable using standard hash-consing techniques. Surprisingly, the duplicating nature of CIL has acceptable compile-time space performance in practice on the benchmarks and flow analyses that we have investigated. Increasing the precision of flow analysis can significantly reduce compile-time space costs. There is also preliminary evidence that the flow information encoded in CIL's type system can effectively guide data customization.

This preliminary version of the paper is superseded by [DimockWestmacottMullerTurbakWellsConsidine00a].

[ WellsDimockMullerTurbak0X]

A Calculus with Polymorphic and Polyvariant Flow Types, by Joe Wells, Allyn Dimock, Robert Muller and Franklyn Turbak. To appear in the Journal of Functional Programming, Cambridge University Press.

Abstract: We present the CIL calculus, a typed lambda calculus which is intended to serve as the basis of an intermediate language for optimizing compilers for higher-order polymorphic programming languages. The language CIL has function, product, sum and recursive types. In addition, CIL has a novel formulation of intersection and union types and flow labels on both terms and types. The calculus is formulated to support the integration of polyvariant flow information in a polymorphically typed program representation. These flow types can guide a compiler in generating customized data representations in a strongly typed setting. We prove that the calculus satisfies confluence and subject reduction properties.

This paper supersedes [WellsDimockMullerTurbak97].

[ZhouMuller0X]

Sufficient Conditions for the Existence of Unique Minimal Fixpoints of Nonmonotomic Functions, by Yuli Zhou and Robert Muller, To appear in the Logic Journal of the IGPL, Oxford University Press.

Abstract: We prove several lattice theoretical fixpoint theorems based on the classical theorem of Knaster and Tarski. These theorems give sufficient conditions for a system of generally nonmonotonic functions on a complete lattice to define a unique minimal fixpoint. The primary objective of this paper is to develop a domain theoretic framework to study the semantics of logic programs as well as various rule-based systems where the rules define generally nonmonotonic functions on lattices.

This paper supersedes [ZhouMuller90].

[MullerWells0X]

Two Applications of Standardization and Evaluation in Combinatory Reduction Systems, by Robert Muller and Joe Wells. Revised version under review.

Abstract: This paper presents two worked applications of a general framework that can be used to support reasoning about the operational equality relation defined by a programming language semantics. The framework, based on Combinatory Reduction Systems, facilitates the proof of standardization theorems for programming calculi. The importance of standardization theorems to programming language semantics was shown by Plotkin: standardization together with confluence guarantee that two terms equated in the calculus are semantically equal. The framework is applied to the call-by-value lambda calculus and to an untyped version of the CIL calculus. The latter is a basis for an intermediate language being used in a compiler.

This and the following paper are companion papers.

[WellsMuller0X]

Standardization and Evaluation in Combinatory Reduction Systems, by Joe Wells and Robert Muller. Working paper.

Abstract: A rewrite system has standardization iff for any rewrite sequence there is an equivalent one which contracts the redexes in a standard order. Standardization is extremely useful for finding normalizing strategies and proving that a rewrite system for a programming language is sound with respect to the language's operational semantics.

Although for some rewrite systems the standard-order can be simple, e.g., left-to-right or outermost-first, many systems need a more delicate order. There are abstract notions of standard order which always apply, but proofs (often quite difficult) are required that the rewrite system satisfies a number of axioms and not much guidance is provided for finding a concrete order that satisfies the abstract definition.

This paper gives a framework based on combinatory reduction systems (CRS's) which is general enough to handle many programming languages. If the CRS is orthogonal and fully extended and a good redex ordering can be found, then a standard order is obtained together with the standardization theorem. If the CRS also satisfies further criteria, then a good redex ordering is mechanically obtained from the rewrite rules. If the CRS is a constructor system and satisfies an additional requirement, then definitions of value and evaluation providing an operational semantics are automatically obtained together with a Plotkin/Wadsworth/Felleisen-style standardization theorem.

This and the preceding paper are companion papers.

[WestmacottMullerAmtoftWells0X]

Region Inference with Rank-2 Intersection Types and its Formalization in Isabelle, by Ian Westmacott, Robert Muller, Torben Amtoft and Joe Wells. Working paper.

Abstract: This working paper develops a Tofte-Talpin style region inference system for terms in a polymorphic programming language with rank-2 intersection types. This subsumes core ML. Region inference systems translate untyped programs into equivalent programs containing explicit storage management annotations that allocate and deallocate storage in a stack-like manner. We prove the soundness of our translation with respect to the operational semantics. Except where noted, all of the definitions, axioms, lemmas and theorems appearing in this paper have been formalized in Isabelle and all proofs have been mechanically verified.

[TurbakDimockMullerWells97]

Compiling with Polymorphic and Polyvariant Flow Types, by Franklyn Turbak, Allyn Dimock, Robert Muller and Joe Wells, in the Proceedings of the First International Workshop on Types in Compilation, Amsterdam, June, 1997.

Abstract: Optimizing compilers for function-oriented and object-oriented languages exploit type and flow information for efficient implementation. Although type and flow information (both control and data flow) are inseparably intertwined, compilers usually compute and represent them separately. Partially, this has been a result of the usual polymorphic type systems using universal and existential quantifiers, which are difficult to use in combination with flow annotations.

In the Church Project, we are experimenting with intermediate languages that integrate type and flow information into a single flow type framework. This integration facilitates the preservation of flow and type information through program transformations. In this paper we describe CIL, an intermediate language supporting polymorphic types and polyvariant flow information and describe its application in program optimiziation. We are experimenting with this intermediate language in a flow and type-directed compiler for a functional language. The types of CIL encode flow information (1) via labels that approximate sources and sinks of values and (2) via intersection and union types, finitary versions of universal and existential types that support type polymorphism and (in combination with the labels) polyvariant flow analysis. Accurate flow types expose opportunities for a wide range of optimizing program transformations.

[DimockMullerTurbakWells97]

Strongly Typed Flow-Directed Representation Transformations, by Allyn Dimock, Robert Muller, Franklyn Turbak and Joe Wells, in the Proceedings of the International Conference on Functional Programming, Amsterdam, June, 1997.

Abstract: We present a new framework for transforming data representations in a strongly typed intermediate language. Our method allows both value producers (sources) and value consumers (sinks) to support multiple representations, automatically inserting any required code. % to handle these possibilities. Specialized representations can be easily chosen for particular source/sink pairs. The framework is based on these techniques:

1. Flow annotated types encode the flows-from'' (source) and flows-to'' (sink) information of a flow graph.
2. Intersection and union types support (a) encoding precise flow information, (b) separating flow information so that transformations can be well typed, (c) automatically reorganizing flow paths to enable multiple representations.
As an instance of our framework, we provide a function representation transformation that encompasses both closure conversion and inlining. Our framework is adaptable to data other than functions.

[WellsDimockMullerTurbak97]

A Typed Intermediate Language for Flow-Directed Compilation , by Joe Wells, Allyn Dimock, Robert Muller and Franklyn Turbak, in the Proceedings of TAPSOFT'97: Theory and Practice of Software Development TAPSOFT (CAAP/FASE), 7th International Joint Conference, Lille, France, April, 1997.

Abstract: We present a typed intermediate language for optimizing compilers for function-oriented and polymorphically typed programming languages (e.g., ML). The language CIL is a typed lambda calculus with product, sum, intersection, and union types as well as function types annotated with flow labels. A novel formulation of intersection and union types supports encoding flow information in the typed program representation. This flow information can direct optimization.

This paper is superseded by [WellsDimockMullerTurbak99].

[Muller94]

A Staging Calculus and its Application to the Verification of Translators (Preliminary Report), in the Proceedings of the 21st Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages , pp. 389 - 396.

Abstract: We develop a calculus in which the computation steps required to execute a computer program can be separated into discrete stages. The calculus, denoted lambda-2, is embedded within the pure untyped lambda calculus. The main result of the paper is a characterization of sufficient conditions for confluence for terms in the calculus. The condition can be taken as a correctness criterion for translators that perform reductions in one stage leaving residual redexes over for subsequent computation stages. As an application of the theory, we verify the correctness of a macro expansion algorithm. The expansion algorithm is of some interest in its own right since it solves the problem of desired variable capture using only the familiar capture avoiding substitutions.

[Bruce,Crabtree,Dimock,Muller,Murtagh,vanGent93]

Safe and Decidable Type Checking in an Object-Oriented Language , by Kim B. Bruce, Jon Crabtree, Allyn Dimock, Robert Muller, Thomas P. Murtagh, Robert van Gent, in the Proceedings of the ACM OOPSLA '93 Conference on Object-Oriented Programming Systems, Languages and Applications.

Abstract: Over the last several years, much interesting work has been done in modelling object-oriented programming languages in terms of extensions of the bounded second-order lambda calculus, $F_{\le}$. Unfortunately, it has recently been shown by Pierce (\cite{Pierce92}) that type checking $F_{\le}$ is undecidable. Moreover he showed that the undecidability arises in the seemingly simpler problem of determining whether one type is a subtype of another. In \cite{Bruce92,BrPOPL93}, the first author introduced a statically-typed, functional, object-oriented programming language, TOOPL, which supports classes, objects, methods, instance variables, subtypes, and inheritance. The semantics of TOOPL is based on $F_{\le}$, so the question arises whether type checking in this language is decidable. In this paper we show that type checking for TOOPLE, a minor variant of TOOPL (Typed Object-Oriented Programming Language), is decidable. The proof proceeds by showing that subtyping is decidable, that all terms of TOOPLE have minimum types (which are in fact computable), and then using these two results to show that type checking is decidable. Interestingly, conditional statements introduce significant problems which necessitated the computation of generalized least upper bounds of types. The interaction of the least upper bounds with the implicit recursion in object and class definitions and the contravariant nature of function spaces makes the computation of appropriate least upper bounds more subtle than might be expected. Our algorithm fails to be polynomial in the size of the term because the size of the type of a term can be exponential in the size of the term. Nevertheless, it performs well in practice.

This paper concentrates on the language without instance variables, though the results can be extended to the full language, at the cost of some added complexity.

[Muller92]

M-LISP: A Representation Independent Dialect of LISP with Reduction Semantics, by Robert Muller, ACM Transactions on Programming Languages and Systems, Vol. 14, No. 4, October, 1992, pp. 589-616.

Abstract: In this paper we introduce M-LISP, a simple new dialect of LISP which is designed with an eye toward reconciling LISP's metalinguistic power with the structural style of operational semantics advocated by Plotkin [Plo75]. We begin by reviewing the original definition of LISP [Mc60] in an attempt to clarify the source of its metalinguistic power. We find that it arises from a problematic clause in this definition. We then define the abstract syntax and operational semantics of M-LISP, essentially a hybrid of M-expression LISP and Scheme. Next, we tie the operational semantics to the corresponding equational logic. As usual, provable equality in the logic implies operational equality. Having established this framework we then extend M-LISP with the metalinguistic eval and reify operators (the latter is a non-strict operator which converts its argument to its metalanguage representation.) These operators encapsulate the metalinguistic representation conversions that occur globally in S-expression LISP. We show that the naive versions of these operators render LISP's equational logic inconsistent. On the positive side, we show that a naturally restricted form of the eval operator is confluent and therefore is a conservative extension of M-LISP. Unfortunately, we must weaken the logic considerably to obtain a consistent theory of reification.

This paper supersedes [Muller91].

[MullerZhou92]

Abstract Interpretation in Weak Powerdomains, by Robert Muller and Yuli Zhou, in the Proceedings of the ACM Conference on LISP and Functional Programming, June 1992.

Abstract: We introduce a class of semantic domains, weak powerdomains, that are intended to serve as value spaces for abstract interpretations in which safety is a concern. We apply them to the analysis of PCF programs. In the classical abstract interpretation approach, abstract domains are constructed explicitly and the abstract semantics is then related to the concrete semantics. In the approach presented here, abstract domains are derived directly from concrete domains. The conditions for deriving the domains are intended to be as general as possible while still guaranteeing that the derived domain has sufficient structure so that it can be used as a basis for computing correct information about the concrete semantics. We prove three main theorems, the last of which ensures the correctness of abstract interpretation of PCF programs given safe interpretations of the constants. This generalizes earlier results obtained for the special case of strictness analysis.

[Muller91]

MLISP: Its Natural Semantics and Equational Logic (Extended Abstract), by Robert Muller, in the Proceedings of the ACM SIGPLAN and IFIP Symposium on Partial Evaluation and Semantics Based Program Manipulation , June 1991.

Abstract: The LISP evaluator is a virtual machine analog of the stored-program computer on which it executes --- it has universal power and dynamically constructed representations of programs can be converted by the eval operator into executable programs. In this paper we study the natural operational semantics and equational logic of a dialect of pure LISP and an extension which includes the eval operator and fexprs (i.e., non-strict functions whose arguments are passed by-representation). We begin by defining a natural operational semantics for the pure subset of M-LISP, a simple, representation-independent hybrid of McCarthy's original M-expression LISP and Scheme. We then establish the connection between the semantics and its equational logic in the usual way and prove that the logic is sound and consistent. With this as our setting we define the axioms and inference rules which give a deterministic operational semantics for the eval operator and fexprs. While the new constructions achieve the same ends as their S-expression LISP counterparts, they do so in somewhat different ways. The new versions encapsulate within the constructions the representation decoding which occurs globally in S-expression LISP. Turning to the equational logics we confirm the folklore that these constructs are in some sense unreasonable: as they are traditionally defined, neither construct is Church-Rosser (CR). On the positive side we show that a naturally restricted form of the eval operator is CR and therefore its equational theory is consistent.

This paper is superseded by [Muller92].

[ZhouMuller90]

Domain Theory for Nonmonotonic Functions, by Yuli Zhou and Robert Muller, Proceedings of the Second International Conference on Algebraic and Logic Programming, Nancy, France, October 1990.

Abstract: We prove several lattice theoretical fixpoint theorems based on the classical theorem of Knaster and Tarski. These theorems give sufficient conditions for a system of generally nonmonotonic functions on a complete lattice to define a unique minimal fixpoint. The primary objective of this paper is to develop a domain theoretic framework to study the semantics of logic programs as well as various rule-based systems where the rules define generally nonmonotonic functions on lattices.

This paper is superseded by [ZhouMuller98].

### Selected Technical Reports

[Boston College BCCS-97-03]

Proceedings of the First International Workshop on Types in Compilation (TIC97), Amsterdam, The Netherlands, June, 1997, published as Technical Report BCCS-97-03, Computer Science Department, Boston College.

Abstract: This is the informal proceedings of the TIC97 workshop.

[Harvard University CRCT TR-06-92]

Lecture Notes on Domain Theory, Harvard University CRCT Technical Report TR-06-92.

Abstract: What follows is a collection of lecture notes for a series of three lectures introducing Scott's {\em domain theory}. The lecture notes are not intended to serve as a primary reference but rather as a supplement to a more comprehensive treatment such as \cite{sc86} or \cite{st77}.

[Harvard University CRCT TR-08-91]

Abstract Semantics of First-Order Recursive Schemes, with Y. Zhou, Harvard University CRCT Technical Report TR-08-91.

Abstract: We develop a general framework for deriving abstract domains from concrete semantic domains in the context of first-order recursive schemes and prove several theorems which ensure the correctness (safety) of abstract computations. The abstract domains, which we call {\em Weak Hoare powerdomains}, subsume the roles of both the abstract domains and the collecting interpretations in the abstract interpretation literature.

[Harvard University CRCT TR-05-90]

Semantic Prototyping in M-LISP: A Representation Independent Dialect of LISP with Reduction Semantics, Harvard University CRCT Technical Report TR-05-90.

Abstract: In this paper we describe a new semantic metalanguage which simplifies prototyping of programming languages. The system integrates Paulson's semantic grammars within a new dialect of LISP, M-LISP, which has somewhat closer connections to the $\lambda$-calculus than other LISP dialects such as Scheme. The semantic grammars are expressed as attribute grammars. The generated parsers are M-LISP functions that can return denotational (i.e., higher-order) representations of abstract syntax. We illustrate the system with several examples and compare it to related systems.

[Harvard University CRCT TR-04-90]

Syntax Macros in M-LISP: A Representation Independent Dialect of LISP with Reduction Semantics, Harvard University CRCT Technical Report TR-04-90.

Abstract: In this paper we present an efficient algorithm for avoiding unintended name captures during syntax macro transcription in LISP. The algorithm is a hybrid of Kohlbecker's {\em Macro-by-Example} and {\em Hygienic} algorithms adapted for a representation-independent dialect of LISP. The adaptation yields a substantially different model of syntax macros than is found in S-expression LISP dialects. The most important difference is that $\lambda$-binding patterns become apparent when an abstraction is first (i.e., partially) transcribed in the syntax tree. This allows us to avoid a larger class of name captures than is possible in S-expression dialects such as Scheme where $\lambda$-binding patterns are not apparent until the tree is completely transcribed.


text:
# PID Control (with code), Verification, and Scheduling

by on September 22, 2014

Hi all
PID controllers are the workhorse of the controls world. PID controllers have the goal of taking some error in your system and reducing it to 0. While there are many other control strategies out there PID is probably the most common (unless you count human control) outside of just setting a setpoint. There are many advanced control strategies out there but in most cases they will do similar or worse than a PID and be much more complex. When the other methods do better it will often only be by a small amount. One exception is if you have a model of the device and its operating conditions you can create a feed forward controller (good for PhD students) that performs better. However in many cases using reactive control with a PID is the easiest and fastest approach to implement.

When we talk about PID control you should remember that each of the letters represents a different mode of the controller. The P is for proportional element, the I is for the integral element, and the D is for the derivative element. Each element has a “term”, that gets multiplied with those elements. We use K to be a generic constant value, so the constant terms (or gains) are KP, KI, and KD respectively. Depending on your application you may or may not have all three of the terms. In many application you will have just PD or PI terms.

So the basic question is: How do you convert the error in a system to form a better new command?

Click image to see clearer/larger version of equations.

There are many forms of the PID controller. But here are the two that most people will care about:

Note: e and e(t) are the error terms, this is defined as: e = desired_value – actual_value. Often the actual_value is coming from some sensor that you have to detect the current value.

The first is in continuous time:

$output(t) = \\(K_{P} * e(t)) + (K_{I} * \int_{0}^{t}e(t) d_{t}) + (K_{D} * \frac{\mathrm{d} }{\mathrm{d} t} e(t)) + bias$

The second is in discrete time, which is what is more commonly used in computer controlled applications:

$output = \\(K_{P}*e) + (K_{I} * (K_{I}\_prior + e * iteration\_time)) + (K_{D} * \frac{e - e\_prior}{iteration\_time}) + bias$

And here is some pseudo code for the discrete version of the PID controller:

error_prior = 0
integral = 0
KP = Some value you need to come up (see tuning section below)
KI = Some value you need to come up (see tuning section below)
KD = Some value you need to come up (see tuning section below)

while(1) {
error = desired_value – actual_value
integral = integral + (error*iteration_time)
derivative = (error – error_prior)/iteration_time
output = KP*error + KI*integral + KD*derivative + bias
error_prior = error
sleep(iteration_time)
}

While the discrete approach is more useful from an implementation perspective. When it comes to understanding and tuning your controller the continuous approach is important for you to understand.

Also while you usually do not see the bias term added to the filter, I like to put it in just in case everything else sums to 0 I will not have a 0 as the output. This is not strictly needed but it is nice to have in many cases. The bias term is usually a small value (<1).

## The Terms

So now we know the form of this controller we can look at what each term does.

### Proportional Term (KP)

The proportional term is your primary term for controlling the error. this directly scales your error, so with a small KP the controller will make small attempts to minimize the error, and with a large KP the controller will make a larger attempt. If the KP is too small you might never minimize the error (unless you are using D and I terms) and not be able to respond to changes affecting your system, and if KP is too large you can have an unstable (ie. weird oscillations) filter that severely overshoot the desired value.

### Integral Term (KI)

The integral term lets the controller handle errors that are accumulating over time. This is good when you need to handle errors steady state errors. The problem is that if you have a large KI you are trying to correct error over time so it can interfere with your response for dealing with current changes. This term is often the cause of instability in your PID controller.

### Derivative Term (KD)

The derivative term is looking at how your system is behaving between time intervals. This helps dampen your system to improve stability. Many motor controllers will only let you configure a PI controller.

## Which permutations of P, I, & D do I need?

In many applications you will not use all 3 terms. So why not just always use all 3 terms? The fewer terms you use the easier the controller is to understand and to implement. Also as you will soon see some modes can cause instability (ex. extreme vibrations) in the controls.

Just about every filter will have the P term. So lets just assume that KP is in our filter. Now the question is do I want to add just I, just D, or both into my filter.

If you want you can only have a P term. This is the simplest type of controller to tune since you only are playing with one value. The downside is that your controller will not smoothly correct itself for sudden and sustained error.

If you add a D term you will be more susceptible to noise and random values. So if you have very noisy data, or random impulses that your sensors measure, you might want to leave the D term out. The downside of leaving the D term out is that you are not responding to those random values that might be legitimate, so you will have a slower response time. An example of this is if your motor hits a rock it will take longer to increase your commanded value since you are not looking at how the error is changing with time. However if you are working on a robotic arm you might want the D term so you can quickly respond to changing forces.

The I term gets tricky. In many cases you will want the I term so you can recover from error that is slowly accumulating. The downside is that the I term is slow to respond. This slowness can lead to instability in your control.

## How to tune your filter?

Tuning a filter can be difficult since a device (say a motor) might need to respond to different conditions. For example if you tune your motor with no load it might not perform optimally with a load; and if you change the load you might need a different set of values to get optimal control. So often you are trying to find a set of parameters that works best in all cases and not necessarily optimal for any given case. There is another approach where you get different constants (the K values) to use in the filter and you choose which set to use based on the actual values in the system.

There are many ways to tune a PID controller. The two best ways that I know are manual (I know people don’t like manual things that relies on having an expert around) and Ziegler–Nichols method. With that said I have found that I can get better results by manually tuning a system, however you can use the Ziegler–Nichols method as a starting point. (The next two sub-sections are mostly taken from wikipedia).

### Manual Tuning

If the system is online, one tuning method is to first set KI and KD values to zero. Increase the KP until the output of the loop oscillates (or just performs well), then the KP should be set to approximately half of that value for a “quarter amplitude decay” type response. Then increase KI until any offset is corrected in sufficient time for the process. However, too much KI will cause instability. Finally, increase KD, if required, until the overshooting is minimized. However, too much KD will cause slow responses and sluggishness. A fast PID loop tuning usually overshoots slightly to reach the setpoint more quickly; however, some systems cannot accept overshoot, in which case an over-damped closed-loop system is required, which will require a KP setting significantly less than half that of the KP setting that was causing oscillation.

### Ziegler–Nichols

Another heuristic tuning method is formally known as the Ziegler–Nichols method, introduced by John G. Ziegler and Nathaniel B. Nichols in the 1940s. As in the method above, the KI and KD gains are first set to zero. The proportional gain is increased until it reaches the ultimate gain, KU, at which the output of the loop starts to oscillate. KU and the oscillation period PU are used to set the gains as shown:

## Verifying Control Parameters

You can verify that the selected gains are good by looking at the output waveform when a step command is applied. If there is a lot of initial ringing (constant changing) or overshoot in the beginning of motion, your gains are probably to high. If the initial command is slowly reaching the desired output you might need to increase your gains.

Plots showing common tuning problems followed by a good response curve. The blue lines are the command, and the red lines are the actual motor output.

In the image above starting from the left we can see:
1. Overshooting of the output motion, with a little signal ringing as it settles to the command. A little overshoot is often fine, but we do try to minimize overshoot while still having a responsive system.
2. Slow response of the output. We might want a faster response so the system will be less sluggish. As you make the system less sluggish you often increase the overshooting and potential for instability.
3. Highly unstable. Starts with a bunch of oscillation, followed by a large spike in command output. We want to avoid this!
4. Finally this right-most plot looks good. The motor output is directly on top of the commanded motion, with a very slight overshoot (if you look close).

The next step in checking the stability of the system you just tuned can be Bode plotting. Click here to learn about it

## Gain Scheduling

In the simplest terms gain scheduling lets you pick different sets of terms based on the performance of the system. So you could say that if the speed is less than or equal to some value use one set of PID terms, if the speed is greater than that value use a different set of PID terms. This is often used in non-linear systems so that you can simplify it to several (almost) linear portions. This is also good if there is some region of the controller where you need to be more aggressive.

I hope this was useful, and happy tuning!

[…] still have a high variability in your speed based on applied load). 2. You will need to tune the PID (or PI or PD) filter more than normally. The PID constants will often need to be much higher (I have seen 1000 times […]

Do the units for iteration_time matter? (e.g. milliseconds, vs. microseconds …etc.)

Hi
You want to choose an iteration time based on the responsiveness you need in your system. For example a robot moving at 5cm/s can have a much slower iteration/response time than a robot moving at 1m/s.

is the Manual Tuning process applicable for discrete system

Antoine Kharrat says:

hi is it possible to found a code where the parameters of the PID are tuned by neural networks

I dont know of anything in particular. If you google it you should be able to find some papers doing adaptive PID controllers using neural nets.

[…] For more information on tuning controllers visit my post on PID Controllers. […]

Some info is wrong. Too much derivative will only make a loop sluggish. You mean too much integral…That will cause overshoot

Thanks. I rewrote that line in the manual tuning section to be more clear.


text:
# Curious $\sum _{n=1}^{\infty} \frac{1}{n^2 - x^2}$ identity [duplicate]

Let $$F(x) = \sum _{n=1}^{\infty} \frac{1}{n^2 - x^2}$$

It seems that for odd integer $k$ $$F\left(\frac{k}{2}\right) = \frac{2}{k^2}$$ My evidence is strictly computational, and I have no idea how to approach a proper proof. So standard questions are:

• is it a known fact
• is it a fact
• is it curious
• what is a proof strategy

-

## marked as duplicate by Dominic Michaelis, Norbert, Dennis Gulko, vonbrand, Davide GiraudoMar 28 '13 at 11:00

math.stackexchange.com/questions/314986/… and put $a= ix$ –  Cortizol Mar 28 '13 at 8:39
Or more directly the question 141470 –  Raymond Manzoni Mar 28 '13 at 8:41
Thanks everyone. Sorry for being illiterate. –  user58697 Mar 28 '13 at 9:00


text:
One of the early achievements of Grothendieck’s theory of schemes was the (partial) computation of the étale fundamental group of a smooth projective curve in characteristic ${p}$. The result is that if ${X_0}$ is a curve of genus ${g}$ over an algebraically closed field of characteristic ${p}$, then its fundamental group is topologically generated by ${2g}$ generators. This is analogous to the characteristic zero case, where the topological fundamental group generated by ${2g}$ generators (subject to a single relation) by the theory of surfaces. Since this result uses many interesting techniques, I thought I would devote a few posts to discussing it.

To motivate étale ${\pi_1}$, let’s recall the following statement:

Theorem 1 Let ${X}$ be a nice topological space, and ${x_0 \in X}$. Then the functor ${p^{-1}(x_0)}$ establishes an equivalence of categories between covering spaces ${p: \overline{X} \rightarrow X}$ and ${\pi_1(X, x_0)}$-sets.

This is one way of phrasing the Galois correspondence between subgroups of ${\pi_1(X, x_0)}$ and connected covering spaces of ${X}$, but which happens to be more categorical and generalizable. The interpretation of ${\pi_1(X, x_0)}$ as classifying covering spaces is ultimately the one that will work in an algebraic context. One can’t talk about homotopy classes of loops in an algebraic variety. However, Grothendieck showed:

Theorem 2 Let ${X}$ be a connected scheme, and ${\overline{x_0} \rightarrow X}$ a geometric point. Then there is a unique profinite group ${\pi_1(X, \overline{x_0})}$ such that the fiber functor of liftings ${\overline{x_0} \rightarrow \overline{X}}$ establishes an equivalence of categories between (finite) étale covers ${p: \overline{X} \rightarrow X}$ and finite continuous ${\pi_1(X, x_0)}$-sets.

The intuition is that étale covers are supposed to be analogous to covering spaces (because, for complex varieties, étale morphisms are local isomorphisms on the analytifications). However, one wishes to retain finite type hypotheses in algebraic geometry, so it makes sense to classify finite étale covers. (Hereafter, the word étale cover will implicitly mean finite.)

I don’t actually want to get into the proof of this theorem! Grothendieck did it by inventing his own formalism for Galois theory, which encompasses both classical Galois theory (of either field extensions or covering spaces) and the étale ${\pi_1}$. The idea is that any suitably nice (by which one means artinian, and satisfying some other conditions) category with an appropriate “fiber functor” ${F}$ to the category of finite sets (here, the pre-images of one point) becomes equivalent (via ${F}$) to the category of finite continuous ${G}$-sets for ${G}$ a uniquely determined profinite group. In fact, ${G}$ is the group of automorphisms of the fiber functor. It is also the projective limit of the automorphism groups of Galois objects in this category.

Moreover, it turns out that, when one is working over the complex numbers, the étale fundamental group turns out to be the profinite completion of the usual fundamental group. This is one way of stating the so-called Riemann existence theorem:

Theorem 3 Let ${X}$ be a scheme of finite type over ${\mathrm{Spec} \mathbb{C}}$. Then the analytification functor establishes an equivalence of categories between the category of finite étale covers of ${X}$ and the category of finite covering spaces of the analytification.

In other words, we can use familiar transcendental techniques to compute the étale fundamental group of something in characterstic zero. The more interesting case is characteristic ${p}$.

Anyway, let’s accept this, and try to sketch the idea behind Grothendieck’s proof. Fix a smooth curve ${X_0}$ over a field of characteristic ${p}$. The first step is to lift ${X_0}$ to characteristic zero. The existence of the lifting is not trivial, but let’s assume it exists for now. In other words, choose a complete discrete valuation ring ${A}$ of characteristic zero whose residue field is the field of characteristic ${p}$ and a proper, smooth scheme ${X \rightarrow \mathrm{Spec} A}$ such that the special fiber is ${X_0}$.

Then, one can, using some of Grothendieck’s descent machinery, find relations between the fundamental groups of the special and general fiber. In particular, one can define a surjective “cospecialization” map between the general and specific fiber. But the general fiber is a curve in characteristic zero, and it has the same genus as ${X_0}$ by flatness of ${X \rightarrow \mathrm{Spec} A}$, so the usual transcendental methods allow one to compute ${\pi_1}$ of the general fiber. This will be the strategy.

This has been a short post, but it seems futile to actually start going into the technical details after a post intended to be an overview. Next time, I shall begin discussing the details, by discussing the process of lifting curves to characteristic zero.


text:
Opuscula Math. 33, no. 2 (2013), 283-291
http://dx.doi.org/10.7494/OpMath.2013.33.2.283

Opuscula Mathematica

# Inequalities for regularized determinants of operators with the Nakano type modulars

Michael Gil'

Abstract. Let $$\{p_k\}$$ be a nondecreasing sequence of integers, and $$A$$ be a compact operator in a Hilbert space whose eigenvalues and singular values are $$\lambda_k(A)$$ and $$s_k(A)$$ $$(k=1, 2, .... )$$, respectively. We establish upper and lower bounds for the regularized determinant $\prod_{k=1}^\infty (1-\lambda_k(A)){\rm exp}\;[\sum_{m=1}^{p_k-1} \frac{\lambda_k^m(A)}{m}],\mbox{ assuming that } \sum_{j=1}^{\infty} \frac{s_j^{p_j}(A/c)}{p_j}\lt \infty$ for a constant $$c\in (0,1)$$.

Keywords: Hilbert space, compact operators, regularized determinant, Nakano type modular.

Mathematics Subject Classification: 47B10, 47A55.

Full text (pdf)