text:
# Free-stream static pressure measurements in the Longshot hypersonic wind tunnel and sensitivity analysis

Free-stream static pressure measurements in the Longshot hypersonic wind tunnel and sensitivity... The performance of fast-response slender static pressure probes is evaluated in the short-duration, cold-gas, VKI Longshot hypersonic wind tunnel. Free-stream Mach numbers range between 9.5 and 12, and unit Reynolds numbers are within 3–10 × 106/m. Absolute pressure sensors are fitted within the probes, and an inexpensive calibration method, suited to low static pressure environments (200–1000 Pa), is described. Transfer functions relating the probe measurements p w to the free-stream static pressure p ∞ are established for the Longshot flow conditions based on numerical simulations. The pressure ratios p w /p ∞ are found to be close to unity for both laminar and turbulent boundary layers. Weak viscous effects characterized by small viscous interaction parameters $${\bar{\chi }}<1.5$$ χ ¯ < 1.5 are confirmed experimentally for probe aspect ratios of L/D > 16.5 by installing multiple pressure sensors in a single probe. The effect of pressure orifice geometry is also evaluated experimentally and found to be negligible for either straight or chamfered holes, 0.6–1 mm in diameter. No sensitivity to probe angle of attack could be evidenced for α < 0.33°. Pressure measurements are compared to theoretical predictions assuming an isentropic nozzle flow expansion. Significant deviations from this ideal case and the Mach 14 contoured nozzle design are uncovered. Validation of the static pressure measurements is obtained by comparing shock wave locations on Schlieren photographs to numerical predictions using free-stream properties derived from the static pressure probes. While these results apply to the Longshot wind tunnel, the present methodology and sensitivity analysis can guide similar investigations for other hypersonic test facilities. http://www.deepdyve.com/assets/images/DeepDyve-Logo-lg.png Experiments in Fluids Springer Journals

# Free-stream static pressure measurements in the Longshot hypersonic wind tunnel and sensitivity analysis

, Volume 57 (5) – Apr 16, 2016
13 pages

/lp/springer_journal/free-stream-static-pressure-measurements-in-the-longshot-hypersonic-cth3nszkdC
Publisher
Springer Berlin Heidelberg
Subject
Engineering; Engineering Fluid Dynamics; Fluid- and Aerodynamics; Engineering Thermodynamics, Heat and Mass Transfer
ISSN
0723-4864
eISSN
1432-1114
D.O.I.
10.1007/s00348-016-2137-5
Publisher site
See Article on Publisher Site

### Abstract

The performance of fast-response slender static pressure probes is evaluated in the short-duration, cold-gas, VKI Longshot hypersonic wind tunnel. Free-stream Mach numbers range between 9.5 and 12, and unit Reynolds numbers are within 3–10 × 106/m. Absolute pressure sensors are fitted within the probes, and an inexpensive calibration method, suited to low static pressure environments (200–1000 Pa), is described. Transfer functions relating the probe measurements p w to the free-stream static pressure p ∞ are established for the Longshot flow conditions based on numerical simulations. The pressure ratios p w /p ∞ are found to be close to unity for both laminar and turbulent boundary layers. Weak viscous effects characterized by small viscous interaction parameters $${\bar{\chi }}<1.5$$ χ ¯ < 1.5 are confirmed experimentally for probe aspect ratios of L/D > 16.5 by installing multiple pressure sensors in a single probe. The effect of pressure orifice geometry is also evaluated experimentally and found to be negligible for either straight or chamfered holes, 0.6–1 mm in diameter. No sensitivity to probe angle of attack could be evidenced for α < 0.33°. Pressure measurements are compared to theoretical predictions assuming an isentropic nozzle flow expansion. Significant deviations from this ideal case and the Mach 14 contoured nozzle design are uncovered. Validation of the static pressure measurements is obtained by comparing shock wave locations on Schlieren photographs to numerical predictions using free-stream properties derived from the static pressure probes. While these results apply to the Longshot wind tunnel, the present methodology and sensitivity analysis can guide similar investigations for other hypersonic test facilities.

### Journal

Experiments in FluidsSpringer Journals

Published: Apr 16, 2016

## You’re reading a free preview. Subscribe to read the entire article.

### DeepDyve is your personal research library

It’s your single place to instantly
that matters to you.

over 18 million articles from more than
15,000 peer-reviewed journals.

All for just $49/month ### Explore the DeepDyve Library ### Search Query the DeepDyve database, plus search all of PubMed and Google Scholar seamlessly ### Organize Save any article or search result from DeepDyve, PubMed, and Google Scholar... all in one place. ### Access Get unlimited, online access to over 18 million full-text articles from more than 15,000 scientific journals. ### Your journals are on DeepDyve Read from thousands of the leading scholarly journals from SpringerNature, Elsevier, Wiley-Blackwell, Oxford University Press and more. All the latest content is available, no embargo periods. DeepDyve ### Freelancer DeepDyve ### Pro Price FREE$49/month
\$360/year

Save searches from
PubMed

Create lists to

Export lists, citations


text:
# Calculus¶

Calculus-related methods.

This module implements a method to find Euler-Lagrange Equations for given Lagrangian.

sympy.calculus.euler.euler_equations(L, funcs=(), vars=())[source]

Find the Euler-Lagrange equations [R22] for a given Lagrangian.

Parameters

L : Expr

The Lagrangian that should be a function of the functions listed in the second argument and their derivatives.

For example, in the case of two functions $$f(x,y)$$, $$g(x,y)$$ and two independent variables $$x$$, $$y$$ the Lagrangian would have the form:

$L\left(f(x,y),g(x,y),\frac{\partial f(x,y)}{\partial x}, \frac{\partial f(x,y)}{\partial y}, \frac{\partial g(x,y)}{\partial x}, \frac{\partial g(x,y)}{\partial y},x,y\right)$

In many cases it is not necessary to provide anything, except the Lagrangian, it will be auto-detected (and an error raised if this couldn’t be done).

funcs : Function or an iterable of Functions

The functions that the Lagrangian depends on. The Euler equations are differential equations for each of these functions.

vars : Symbol or an iterable of Symbols

The Symbols that are the independent variables of the functions.

Returns

eqns : list of Eq

The list of differential equations, one for each function.

Examples

>>> from sympy import Symbol, Function
>>> from sympy.calculus.euler import euler_equations
>>> x = Function('x')
>>> t = Symbol('t')
>>> L = (x(t).diff(t))**2/2 - x(t)**2/2
>>> euler_equations(L, x(t), t)
[Eq(-x(t) - Derivative(x(t), (t, 2)), 0)]
>>> u = Function('u')
>>> x = Symbol('x')
>>> L = (u(t, x).diff(t))**2/2 - (u(t, x).diff(x))**2/2
>>> euler_equations(L, u(t, x), [t, x])
[Eq(-Derivative(u(t, x), (t, 2)) + Derivative(u(t, x), (x, 2)), 0)]

References

R22(1,2)

https://en.wikipedia.org/wiki/Euler%E2%80%93Lagrange_equation

## Singularities¶

This module implements algorithms for finding singularities for a function and identifying types of functions.

The differential calculus methods in this module include methods to identify the following function types in the given Interval: - Increasing - Strictly Increasing - Decreasing - Strictly Decreasing - Monotonic

sympy.calculus.singularities.is_decreasing(expression, interval=Reals, symbol=None)[source]

Return whether the function is decreasing in the given interval.

Parameters

expression : Expr

The target function which is being checked.

interval : Set, optional

The range of values in which we are testing (defaults to set of all real numbers).

symbol : Symbol, optional

The symbol present in expression which gets varied over the given range.

Returns

Boolean

True if expression is decreasing (either strictly decreasing or constant) in the given interval, False otherwise.

Examples

>>> from sympy import is_decreasing
>>> from sympy.abc import x, y
>>> from sympy import S, Interval, oo
>>> is_decreasing(1/(x**2 - 3*x), Interval.open(1.5, 3))
True
>>> is_decreasing(1/(x**2 - 3*x), Interval.Lopen(3, oo))
True
>>> is_decreasing(1/(x**2 - 3*x), Interval.Ropen(-oo, S(3)/2))
False
>>> is_decreasing(-x**2, Interval(-oo, 0))
False
>>> is_decreasing(-x**2 + y, Interval(-oo, 0), x)
False

sympy.calculus.singularities.is_increasing(expression, interval=Reals, symbol=None)[source]

Return whether the function is increasing in the given interval.

Parameters

expression : Expr

The target function which is being checked.

interval : Set, optional

The range of values in which we are testing (defaults to set of all real numbers).

symbol : Symbol, optional

The symbol present in expression which gets varied over the given range.

Returns

Boolean

True if expression is increasing (either strictly increasing or constant) in the given interval, False otherwise.

Examples

>>> from sympy import is_increasing
>>> from sympy.abc import x, y
>>> from sympy import S, Interval, oo
>>> is_increasing(x**3 - 3*x**2 + 4*x, S.Reals)
True
>>> is_increasing(-x**2, Interval(-oo, 0))
True
>>> is_increasing(-x**2, Interval(0, oo))
False
>>> is_increasing(4*x**3 - 6*x**2 - 72*x + 30, Interval(-2, 3))
False
>>> is_increasing(x**2 + y, Interval(1, 2), x)
True

sympy.calculus.singularities.is_monotonic(expression, interval=Reals, symbol=None)[source]

Return whether the function is monotonic in the given interval.

Parameters

expression : Expr

The target function which is being checked.

interval : Set, optional

The range of values in which we are testing (defaults to set of all real numbers).

symbol : Symbol, optional

The symbol present in expression which gets varied over the given range.

Returns

Boolean

True if expression is monotonic in the given interval, False otherwise.

Raises

NotImplementedError

Monotonicity check has not been implemented for the queried function.

Examples

>>> from sympy import is_monotonic
>>> from sympy.abc import x, y
>>> from sympy import S, Interval, oo
>>> is_monotonic(1/(x**2 - 3*x), Interval.open(1.5, 3))
True
>>> is_monotonic(1/(x**2 - 3*x), Interval.Lopen(3, oo))
True
>>> is_monotonic(x**3 - 3*x**2 + 4*x, S.Reals)
True
>>> is_monotonic(-x**2, S.Reals)
False
>>> is_monotonic(x**2 + y + 1, Interval(1, 2), x)
True

sympy.calculus.singularities.is_strictly_decreasing(expression, interval=Reals, symbol=None)[source]

Return whether the function is strictly decreasing in the given interval.

Parameters

expression : Expr

The target function which is being checked.

interval : Set, optional

The range of values in which we are testing (defaults to set of all real numbers).

symbol : Symbol, optional

The symbol present in expression which gets varied over the given range.

Returns

Boolean

True if expression is strictly decreasing in the given interval, False otherwise.

Examples

>>> from sympy import is_strictly_decreasing
>>> from sympy.abc import x, y
>>> from sympy import S, Interval, oo
>>> is_strictly_decreasing(1/(x**2 - 3*x), Interval.Lopen(3, oo))
True
>>> is_strictly_decreasing(1/(x**2 - 3*x), Interval.Ropen(-oo, S(3)/2))
False
>>> is_strictly_decreasing(-x**2, Interval(-oo, 0))
False
>>> is_strictly_decreasing(-x**2 + y, Interval(-oo, 0), x)
False

sympy.calculus.singularities.is_strictly_increasing(expression, interval=Reals, symbol=None)[source]

Return whether the function is strictly increasing in the given interval.

Parameters

expression : Expr

The target function which is being checked.

interval : Set, optional

The range of values in which we are testing (defaults to set of all real numbers).

symbol : Symbol, optional

The symbol present in expression which gets varied over the given range.

Returns

Boolean

True if expression is strictly increasing in the given interval, False otherwise.

Examples

>>> from sympy import is_strictly_increasing
>>> from sympy.abc import x, y
>>> from sympy import Interval, oo
>>> is_strictly_increasing(4*x**3 - 6*x**2 - 72*x + 30, Interval.Ropen(-oo, -2))
True
>>> is_strictly_increasing(4*x**3 - 6*x**2 - 72*x + 30, Interval.Lopen(3, oo))
True
>>> is_strictly_increasing(4*x**3 - 6*x**2 - 72*x + 30, Interval.open(-2, 3))
False
>>> is_strictly_increasing(-x**2, Interval(0, oo))
False
>>> is_strictly_increasing(-x**2 + y, Interval(-oo, 0), x)
False

sympy.calculus.singularities.monotonicity_helper(expression, predicate, interval=Reals, symbol=None)[source]

Helper function for functions checking function monotonicity.

Parameters

expression : Expr

The target function which is being checked

predicate : function

The property being tested for. The function takes in an integer and returns a boolean. The integer input is the derivative and the boolean result should be true if the property is being held, and false otherwise.

interval : Set, optional

The range of values in which we are testing, defaults to all reals.

symbol : Symbol, optional

The symbol present in expression which gets varied over the given range.

It returns a boolean indicating whether the interval in which

the function’s derivative satisfies given predicate is a superset

of the given interval.

Returns

Boolean

True if predicate is true for all the derivatives when symbol is varied in range, False otherwise.

sympy.calculus.singularities.singularities(expression, symbol)[source]

Find singularities of a given function.

Parameters

expression : Expr

The target function in which singularities need to be found.

symbol : Symbol

The symbol over the values of which the singularity in expression in being searched for.

Returns

Set

A set of values for symbol for which expression has a singularity. An EmptySet is returned if expression has no singularities for any given value of Symbol.

Raises

NotImplementedError

The algorithm to find singularities for irrational functions has not been implemented yet.

Notes

This function does not find non-isolated singularities nor does it find branch points of the expression.

Currently supported functions are:
• univariate rational (real or complex) functions

Examples

>>> from sympy.calculus.singularities import singularities
>>> from sympy import Symbol
>>> x = Symbol('x', real=True)
>>> y = Symbol('y', real=False)
>>> singularities(x**2 + x + 1, x)
EmptySet
>>> singularities(1/(x + 1), x)
FiniteSet(-1)
>>> singularities(1/(y**2 + 1), y)
FiniteSet(I, -I)
>>> singularities(1/(y**3 + 1), y)
FiniteSet(-1, 1/2 - sqrt(3)*I/2, 1/2 + sqrt(3)*I/2)

References

R23

https://en.wikipedia.org/wiki/Mathematical_singularity

## Finite difference weights¶

This module implements an algorithm for efficient generation of finite difference weights for ordinary differentials of functions for derivatives from 0 (interpolation) up to arbitrary order.

The core algorithm is provided in the finite difference weight generating function (finite_diff_weights), and two convenience functions are provided for:

• estimating a derivative (or interpolate) directly from a series of points

is also provided (apply_finite_diff).

• differentiating by using finite difference approximations

(differentiate_finite).

sympy.calculus.finite_diff.apply_finite_diff(order, x_list, y_list, x0=0)[source]

Calculates the finite difference approximation of the derivative of requested order at x0 from points provided in x_list and y_list.

Parameters

order: int

order of derivative to approximate. 0 corresponds to interpolation.

x_list: sequence

Sequence of (unique) values for the independent variable.

y_list: sequence

The function value at corresponding values for the independent variable in x_list.

x0: Number or Symbol

At what value of the independent variable the derivative should be evaluated. Defaults to 0.

Returns

The finite difference expression approximating the requested derivative order at x0.

Examples

>>> from sympy.calculus import apply_finite_diff
>>> cube = lambda arg: (1.0*arg)**3
>>> xlist = range(-3,3+1)
>>> apply_finite_diff(2, xlist, map(cube, xlist), 2) - 12
-3.55271367880050e-15

we see that the example above only contain rounding errors. apply_finite_diff can also be used on more abstract objects:

>>> from sympy import IndexedBase, Idx
>>> from sympy.calculus import apply_finite_diff
>>> x, y = map(IndexedBase, 'xy')
>>> i = Idx('i')
>>> x_list, y_list = zip(*[(x[i+j], y[i+j]) for j in range(-1,2)])
>>> apply_finite_diff(1, x_list, y_list, x[i])
((x[i + 1] - x[i])/(-x[i - 1] + x[i]) - 1)*y[i]/(x[i + 1] - x[i]) - (x[i + 1] - x[i])*y[i - 1]/((x[i + 1] - x[i - 1])*(-x[i - 1] + x[i])) + (-x[i - 1] + x[i])*y[i + 1]/((x[i + 1] - x[i - 1])*(x[i + 1] - x[i]))

Notes

Order = 0 corresponds to interpolation. Only supply so many points you think makes sense to around x0 when extracting the derivative (the function need to be well behaved within that region). Also beware of Runge’s phenomenon.

References

Fortran 90 implementation with Python interface for numerics: finitediff

sympy.calculus.finite_diff.as_finite_diff(derivative, points=1, x0=None, wrt=None)[source]

sympy.calculus.finite_diff.differentiate_finite(expr, *symbols, **kwargs)[source]

Differentiate expr and replace Derivatives with finite differences.

Parameters

expr : expression

*symbols : differentiate with respect to symbols

points: sequence or coefficient, optional

see Derivative.as_finite_difference

x0: number or Symbol, optional

see Derivative.as_finite_difference

wrt: Symbol, optional

see Derivative.as_finite_difference

evaluate : bool

kwarg passed on to diff, whether or not to evaluate the Derivative intermediately (default: False).

Examples

>>> from sympy import cos, sin, Function, differentiate_finite
>>> from sympy.abc import x, y, h
>>> f, g = Function('f'), Function('g')
>>> differentiate_finite(f(x)*g(x), x, points=[x-h, x+h])
-f(-h + x)*g(-h + x)/(2*h) + f(h + x)*g(h + x)/(2*h)

Note that the above form preserves the product rule in discrete form. If we want we can pass evaluate=True to get another form (which is usually not what we want):

>>> differentiate_finite(f(x)*g(x), x, points=[x-h, x+h], evaluate=True).simplify()
-((f(-h + x) - f(h + x))*g(x) + (g(-h + x) - g(h + x))*f(x))/(2*h)

differentiate_finite works on any expression:

>>> differentiate_finite(f(x) + sin(x), x, 2)
-2*f(x) + f(x - 1) + f(x + 1) - 2*sin(x) + sin(x - 1) + sin(x + 1)
>>> differentiate_finite(f(x) + sin(x), x, 2, evaluate=True)
-2*f(x) + f(x - 1) + f(x + 1) - sin(x)
>>> differentiate_finite(f(x, y), x, y)
f(x - 1/2, y - 1/2) - f(x - 1/2, y + 1/2) - f(x + 1/2, y - 1/2) + f(x + 1/2, y + 1/2)

sympy.calculus.finite_diff.finite_diff_weights(order, x_list, x0=1)[source]

Calculates the finite difference weights for an arbitrarily spaced one-dimensional grid (x_list) for derivatives at x0 of order 0, 1, …, up to order using a recursive formula. Order of accuracy is at least len(x_list) - order, if x_list is defined correctly.

Parameters

order: int

Up to what derivative order weights should be calculated. 0 corresponds to interpolation.

x_list: sequence

Sequence of (unique) values for the independent variable. It is useful (but not necessary) to order x_list from nearest to furthest from x0; see examples below.

x0: Number or Symbol

Root or value of the independent variable for which the finite difference weights should be generated. Default is S.One.

Returns

list

A list of sublists, each corresponding to coefficients for increasing derivative order, and each containing lists of coefficients for increasing subsets of x_list.

Examples

>>> from sympy import S
>>> from sympy.calculus import finite_diff_weights
>>> res = finite_diff_weights(1, [-S(1)/2, S(1)/2, S(3)/2, S(5)/2], 0)
>>> res
[[[1, 0, 0, 0],
[1/2, 1/2, 0, 0],
[3/8, 3/4, -1/8, 0],
[5/16, 15/16, -5/16, 1/16]],
[[0, 0, 0, 0],
[-1, 1, 0, 0],
[-1, 1, 0, 0],
[-23/24, 7/8, 1/8, -1/24]]]
>>> res[0][-1]  # FD weights for 0th derivative, using full x_list
[5/16, 15/16, -5/16, 1/16]
>>> res[1][-1]  # FD weights for 1st derivative
[-23/24, 7/8, 1/8, -1/24]
>>> res[1][-2]  # FD weights for 1st derivative, using x_list[:-1]
[-1, 1, 0, 0]
>>> res[1][-1][0]  # FD weight for 1st deriv. for x_list[0]
-23/24
>>> res[1][-1][1]  # FD weight for 1st deriv. for x_list[1], etc.
7/8

Each sublist contains the most accurate formula at the end. Note, that in the above example res[1][1] is the same as res[1][2]. Since res[1][2] has an order of accuracy of len(x_list[:3]) - order = 3 - 1 = 2, the same is true for res[1][1]!

>>> from sympy import S
>>> from sympy.calculus import finite_diff_weights
>>> res = finite_diff_weights(1, [S(0), S(1), -S(1), S(2), -S(2)], 0)[1]
>>> res
[[0, 0, 0, 0, 0],
[-1, 1, 0, 0, 0],
[0, 1/2, -1/2, 0, 0],
[-1/2, 1, -1/3, -1/6, 0],
[0, 2/3, -2/3, -1/12, 1/12]]
>>> res[0]  # no approximation possible, using x_list[0] only
[0, 0, 0, 0, 0]
>>> res[1]  # classic forward step approximation
[-1, 1, 0, 0, 0]
>>> res[2]  # classic centered approximation
[0, 1/2, -1/2, 0, 0]
>>> res[3:]  # higher order approximations
[[-1/2, 1, -1/3, -1/6, 0], [0, 2/3, -2/3, -1/12, 1/12]]

Let us compare this to a differently defined x_list. Pay attention to foo[i][k] corresponding to the gridpoint defined by x_list[k].

>>> from sympy import S
>>> from sympy.calculus import finite_diff_weights
>>> foo = finite_diff_weights(1, [-S(2), -S(1), S(0), S(1), S(2)], 0)[1]
>>> foo
[[0, 0, 0, 0, 0],
[-1, 1, 0, 0, 0],
[1/2, -2, 3/2, 0, 0],
[1/6, -1, 1/2, 1/3, 0],
[1/12, -2/3, 0, 2/3, -1/12]]
>>> foo[1]  # not the same and of lower accuracy as res[1]!
[-1, 1, 0, 0, 0]
>>> foo[2]  # classic double backward step approximation
[1/2, -2, 3/2, 0, 0]
>>> foo[4]  # the same as res[4]
[1/12, -2/3, 0, 2/3, -1/12]

Note that, unless you plan on using approximations based on subsets of x_list, the order of gridpoints does not matter.

The capability to generate weights at arbitrary points can be used e.g. to minimize Runge’s phenomenon by using Chebyshev nodes:

>>> from sympy import cos, symbols, pi, simplify
>>> from sympy.calculus import finite_diff_weights
>>> N, (h, x) = 4, symbols('h x')
>>> x_list = [x+h*cos(i*pi/(N)) for i in range(N,-1,-1)] # chebyshev nodes
>>> print(x_list)
[-h + x, -sqrt(2)*h/2 + x, x, sqrt(2)*h/2 + x, h + x]
>>> mycoeffs = finite_diff_weights(1, x_list, 0)[1][4]
>>> [simplify(c) for c in  mycoeffs]
[(h**3/2 + h**2*x - 3*h*x**2 - 4*x**3)/h**4,
(-sqrt(2)*h**3 - 4*h**2*x + 3*sqrt(2)*h*x**2 + 8*x**3)/h**4,
6*x/h**2 - 8*x**3/h**4,
(sqrt(2)*h**3 - 4*h**2*x - 3*sqrt(2)*h*x**2 + 8*x**3)/h**4,
(-h**3/2 + h**2*x + 3*h*x**2 - 4*x**3)/h**4]

Notes

If weights for a finite difference approximation of 3rd order derivative is wanted, weights for 0th, 1st and 2nd order are calculated “for free”, so are formulae using subsets of x_list. This is something one can take advantage of to save computational cost. Be aware that one should define x_list from nearest to furthest from x0. If not, subsets of x_list will yield poorer approximations, which might not grand an order of accuracy of len(x_list) - order.

References

R24

Generation of Finite Difference Formulas on Arbitrarily Spaced Grids, Bengt Fornberg; Mathematics of computation; 51; 184; (1988); 699-706; doi:10.1090/S0025-5718-1988-0935077-0

sympy.calculus.util.AccumBounds[source]
class sympy.calculus.util.AccumulationBounds[source]

# Note AccumulationBounds has an alias: AccumBounds

AccumulationBounds represent an interval $$[a, b]$$, which is always closed at the ends. Here $$a$$ and $$b$$ can be any value from extended real numbers.

The intended meaning of AccummulationBounds is to give an approximate location of the accumulation points of a real function at a limit point.

Let $$a$$ and $$b$$ be reals such that a <= b.

$$\left\langle a, b\right\rangle = \{x \in \mathbb{R} \mid a \le x \le b\}$$

$$\left\langle -\infty, b\right\rangle = \{x \in \mathbb{R} \mid x \le b\} \cup \{-\infty, \infty\}$$

$$\left\langle a, \infty \right\rangle = \{x \in \mathbb{R} \mid a \le x\} \cup \{-\infty, \infty\}$$

$$\left\langle -\infty, \infty \right\rangle = \mathbb{R} \cup \{-\infty, \infty\}$$

$$oo$$ and $$-oo$$ are added to the second and third definition respectively, since if either $$-oo$$ or $$oo$$ is an argument, then the other one should be included (though not as an end point). This is forced, since we have, for example, $$1/AccumBounds(0, 1) = AccumBounds(1, oo)$$, and the limit at $$0$$ is not one-sided. As x tends to $$0-$$, then $$1/x -> -oo$$, so $$-oo$$ should be interpreted as belonging to $$AccumBounds(1, oo)$$ though it need not appear explicitly.

In many cases it suffices to know that the limit set is bounded. However, in some other cases more exact information could be useful. For example, all accumulation values of cos(x) + 1 are non-negative. (AccumBounds(-1, 1) + 1 = AccumBounds(0, 2))

A AccumulationBounds object is defined to be real AccumulationBounds, if its end points are finite reals.

Let $$X$$, $$Y$$ be real AccumulationBounds, then their sum, difference, product are defined to be the following sets:

$$X + Y = \{ x+y \mid x \in X \cap y \in Y\}$$

$$X - Y = \{ x-y \mid x \in X \cap y \in Y\}$$

$$X * Y = \{ x*y \mid x \in X \cap y \in Y\}$$

There is, however, no consensus on Interval division.

$$X / Y = \{ z \mid \exists x \in X, y \in Y \mid y \neq 0, z = x/y\}$$

Note: According to this definition the quotient of two AccumulationBounds may not be a AccumulationBounds object but rather a union of AccumulationBounds.

Note

The main focus in the interval arithmetic is on the simplest way to calculate upper and lower endpoints for the range of values of a function in one or more variables. These barriers are not necessarily the supremum or infimum, since the precise calculation of those values can be difficult or impossible.

Examples

>>> from sympy import AccumBounds, sin, exp, log, pi, E, S, oo
>>> from sympy.abc import x

>>> AccumBounds(0, 1) + AccumBounds(1, 2)
AccumBounds(1, 3)

>>> AccumBounds(0, 1) - AccumBounds(0, 2)
AccumBounds(-2, 1)

>>> AccumBounds(-2, 3)*AccumBounds(-1, 1)
AccumBounds(-3, 3)

>>> AccumBounds(1, 2)*AccumBounds(3, 5)
AccumBounds(3, 10)

The exponentiation of AccumulationBounds is defined as follows:

If 0 does not belong to $$X$$ or $$n > 0$$ then

$$X^n = \{ x^n \mid x \in X\}$$

otherwise

$$X^n = \{ x^n \mid x \neq 0, x \in X\} \cup \{-\infty, \infty\}$$

Here for fractional $$n$$, the part of $$X$$ resulting in a complex AccumulationBounds object is neglected.

>>> AccumBounds(-1, 4)**(S(1)/2)
AccumBounds(0, 2)

>>> AccumBounds(1, 2)**2
AccumBounds(1, 4)

>>> AccumBounds(-1, oo)**(-1)
AccumBounds(-oo, oo)

Note: $$<a, b>^2$$ is not same as $$<a, b>*<a, b>$$

>>> AccumBounds(-1, 1)**2
AccumBounds(0, 1)

>>> AccumBounds(1, 3) < 4
True

>>> AccumBounds(1, 3) < -1
False

Some elementary functions can also take AccumulationBounds as input. A function $$f$$ evaluated for some real AccumulationBounds $$<a, b>$$ is defined as $$f(\left\langle a, b\right\rangle) = \{ f(x) \mid a \le x \le b \}$$

>>> sin(AccumBounds(pi/6, pi/3))
AccumBounds(1/2, sqrt(3)/2)

>>> exp(AccumBounds(0, 1))
AccumBounds(1, E)

>>> log(AccumBounds(1, E))
AccumBounds(0, 1)

Some symbol in an expression can be substituted for a AccumulationBounds object. But it doesn’t necessarily evaluate the AccumulationBounds for that expression.

Same expression can be evaluated to different values depending upon the form it is used for substitution. For example:

>>> (x**2 + 2*x + 1).subs(x, AccumBounds(-1, 1))
AccumBounds(-1, 4)

>>> ((x + 1)**2).subs(x, AccumBounds(-1, 1))
AccumBounds(0, 4)

Notes

Do not use AccumulationBounds for floating point interval arithmetic calculations, use mpmath.iv instead.

References

R25

https://en.wikipedia.org/wiki/Interval_arithmetic

R26

http://fab.cba.mit.edu/classes/S62.12/docs/Hickey_interval.pdf

property delta

Returns the difference of maximum possible value attained by AccumulationBounds object and minimum possible value attained by AccumulationBounds object.

Examples

>>> from sympy import AccumBounds
>>> AccumBounds(1, 3).delta
2

intersection(other)[source]

Returns the intersection of ‘self’ and ‘other’. Here other can be an instance of FiniteSet or AccumulationBounds.

Examples

>>> from sympy import AccumBounds, FiniteSet
>>> AccumBounds(1, 3).intersection(AccumBounds(2, 4))
AccumBounds(2, 3)

>>> AccumBounds(1, 3).intersection(AccumBounds(4, 6))
EmptySet

>>> AccumBounds(1, 4).intersection(FiniteSet(1, 2, 5))
FiniteSet(1, 2)

property max

Returns the maximum possible value attained by AccumulationBounds object.

Examples

>>> from sympy import AccumBounds
>>> AccumBounds(1, 3).max
3

property mid

Returns the mean of maximum possible value attained by AccumulationBounds object and minimum possible value attained by AccumulationBounds object.

Examples

>>> from sympy import AccumBounds
>>> AccumBounds(1, 3).mid
2

property min

Returns the minimum possible value attained by AccumulationBounds object.

Examples

>>> from sympy import AccumBounds
>>> AccumBounds(1, 3).min
1

sympy.calculus.util.continuous_domain(f, symbol, domain)[source]

Returns the intervals in the given domain for which the function is continuous. This method is limited by the ability to determine the various singularities and discontinuities of the given function.

Parameters

f : Expr

The concerned function.

symbol : Symbol

The variable for which the intervals are to be determined.

domain : Interval

The domain over which the continuity of the symbol has to be checked.

Returns

Interval

Union of all intervals where the function is continuous.

Raises

NotImplementedError

If the method to determine continuity of such a function has not yet been developed.

Examples

>>> from sympy import Symbol, S, tan, log, pi, sqrt
>>> from sympy.sets import Interval
>>> from sympy.calculus.util import continuous_domain
>>> x = Symbol('x')
>>> continuous_domain(1/x, x, S.Reals)
Union(Interval.open(-oo, 0), Interval.open(0, oo))
>>> continuous_domain(tan(x), x, Interval(0, pi))
Union(Interval.Ropen(0, pi/2), Interval.Lopen(pi/2, pi))
>>> continuous_domain(sqrt(x - 2), x, Interval(-5, 5))
Interval(2, 5)
>>> continuous_domain(log(2*x - 1), x, S.Reals)
Interval.open(1/2, oo)

sympy.calculus.util.function_range(f, symbol, domain)[source]

Finds the range of a function in a given domain. This method is limited by the ability to determine the singularities and determine limits.

Parameters

f : Expr

The concerned function.

symbol : Symbol

The variable for which the range of function is to be determined.

domain : Interval

The domain under which the range of the function has to be found.

Returns

Interval

Union of all ranges for all intervals under domain where function is continuous.

Raises

NotImplementedError

If any of the intervals, in the given domain, for which function is continuous are not finite or real, OR if the critical points of the function on the domain can’t be found.

Examples

>>> from sympy import Symbol, S, exp, log, pi, sqrt, sin, tan
>>> from sympy.sets import Interval
>>> from sympy.calculus.util import function_range
>>> x = Symbol('x')
>>> function_range(sin(x), x, Interval(0, 2*pi))
Interval(-1, 1)
>>> function_range(tan(x), x, Interval(-pi/2, pi/2))
Interval(-oo, oo)
>>> function_range(1/x, x, S.Reals)
Union(Interval.open(-oo, 0), Interval.open(0, oo))
>>> function_range(exp(x), x, S.Reals)
Interval.open(0, oo)
>>> function_range(log(x), x, S.Reals)
Interval(-oo, oo)
>>> function_range(sqrt(x), x , Interval(-5, 9))
Interval(0, 3)

sympy.calculus.util.is_convex(f, *syms, **kwargs)[source]

Determines the convexity of the function passed in the argument.

Parameters

f : Expr

The concerned function.

syms : Tuple of symbols

The variables with respect to which the convexity is to be determined.

domain : Interval, optional

The domain over which the convexity of the function has to be checked. If unspecified, S.Reals will be the default domain.

Returns

Boolean

The method returns $$True$$ if the function is convex otherwise it returns $$False$$.

Raises

NotImplementedError

The check for the convexity of multivariate functions is not implemented yet.

Notes

To determine concavity of a function pass $$-f$$ as the concerned function. To determine logarithmic convexity of a function pass log(f) as concerned function. To determine logartihmic concavity of a function pass -log(f) as concerned function.

Currently, convexity check of multivariate functions is not handled.

Examples

>>> from sympy import symbols, exp, oo, Interval
>>> from sympy.calculus.util import is_convex
>>> x = symbols('x')
>>> is_convex(exp(x), x)
True
>>> is_convex(x**3, x, domain = Interval(-1, oo))
False

References

R27

https://en.wikipedia.org/wiki/Convex_function

R28

http://www.ifp.illinois.edu/~angelia/L3_convfunc.pdf

R29

https://en.wikipedia.org/wiki/Logarithmically_convex_function

R30

https://en.wikipedia.org/wiki/Logarithmically_concave_function

R31

https://en.wikipedia.org/wiki/Concave_function

sympy.calculus.util.lcim(numbers)[source]

Returns the least common integral multiple of a list of numbers.

The numbers can be rational or irrational or a mixture of both. $$None$$ is returned for incommensurable numbers.

Parameters

numbers : list

Numbers (rational and/or irrational) for which lcim is to be found.

Returns

number

lcim if it exists, otherwise $$None$$ for incommensurable numbers.

Examples

>>> from sympy import S, pi
>>> from sympy.calculus.util import lcim
>>> lcim([S(1)/2, S(3)/4, S(5)/6])
15/2
>>> lcim([2*pi, 3*pi, pi, pi/2])
6*pi
>>> lcim([S(1), 2*pi])

sympy.calculus.util.maximum(f, symbol, domain=Reals)[source]

Returns the maximum value of a function in the given domain.

Parameters

f : Expr

The concerned function.

symbol : Symbol

The variable for maximum value needs to be determined.

domain : Interval

The domain over which the maximum have to be checked. If unspecified, then Global maximum is returned.

Examples

>>> from sympy import Symbol, S, sin, cos, pi, maximum
>>> from sympy.sets import Interval
>>> x = Symbol('x')

>>> f = -x**2 + 2*x + 5
>>> maximum(f, x, S.Reals)
6

>>> maximum(sin(x), x, Interval(-pi, pi/4))
sqrt(2)/2

>>> maximum(sin(x)*cos(x), x)
1/2

sympy.calculus.util.minimum(f, symbol, domain=Reals)[source]

Returns the minimum value of a function in the given domain.

Parameters

f : Expr

The concerned function.

symbol : Symbol

The variable for minimum value needs to be determined.

domain : Interval

The domain over which the minimum have to be checked. If unspecified, then Global minimum is returned.

Examples

>>> from sympy import Symbol, S, sin, cos, minimum
>>> from sympy.sets import Interval
>>> x = Symbol('x')

>>> f = x**2 + 2*x + 5
>>> minimum(f, x, S.Reals)
4

>>> minimum(sin(x), x, Interval(2, 3))
sin(3)

>>> minimum(sin(x)*cos(x), x)
-1/2

sympy.calculus.util.not_empty_in(finset_intersection, *syms)[source]

Finds the domain of the functions in $$finite_set$$ in which the $$finite_set$$ is not-empty

Parameters

finset_intersection : The unevaluated intersection of FiniteSet containing

real-valued functions with Union of Sets

syms : Tuple of symbols

Symbol for which domain is to be found

Raises

NotImplementedError

The algorithms to find the non-emptiness of the given FiniteSet are not yet implemented.

ValueError

The input is not valid.

RuntimeError

It is a bug, please report it to the github issue tracker (https://github.com/sympy/sympy/issues).

Examples

>>> from sympy import FiniteSet, Interval, not_empty_in, oo
>>> from sympy.abc import x
>>> not_empty_in(FiniteSet(x/2).intersect(Interval(0, 1)), x)
Interval(0, 2)
>>> not_empty_in(FiniteSet(x, x**2).intersect(Interval(1, 2)), x)
Union(Interval(1, 2), Interval(-sqrt(2), -1))
>>> not_empty_in(FiniteSet(x**2/(x + 2)).intersect(Interval(1, oo)), x)
Union(Interval.Lopen(-2, -1), Interval(2, oo))

sympy.calculus.util.periodicity(f, symbol, check=False)[source]

Tests the given function for periodicity in the given symbol.

Parameters

f : Expr.

The concerned function.

symbol : Symbol

The variable for which the period is to be determined.

check : Boolean, optional

The flag to verify whether the value being returned is a period or not.

Returns

period

The period of the function is returned. $$None$$ is returned when the function is aperiodic or has a complex period. The value of $$0$$ is returned as the period of a constant function.

Raises

NotImplementedError

The value of the period computed cannot be verified.

Notes

Currently, we do not support functions with a complex period. The period of functions having complex periodic values such as $$exp$$, $$sinh$$ is evaluated to $$None$$.

The value returned might not be the “fundamental” period of the given function i.e. it may not be the smallest periodic value of the function.

The verification of the period through the $$check$$ flag is not reliable due to internal simplification of the given expression. Hence, it is set to $$False$$ by default.

Examples

>>> from sympy import Symbol, sin, cos, tan, exp
>>> from sympy.calculus.util import periodicity
>>> x = Symbol('x')
>>> f = sin(x) + sin(2*x) + sin(3*x)
>>> periodicity(f, x)
2*pi
>>> periodicity(sin(x)*cos(x), x)
pi
>>> periodicity(exp(tan(2*x) - 1), x)
pi/2
>>> periodicity(sin(4*x)**cos(2*x), x)
pi
>>> periodicity(exp(x), x)

sympy.calculus.util.stationary_points(f, symbol, domain=Reals)[source]

Returns the stationary points of a function (where derivative of the function is 0) in the given domain.

Parameters

f : Expr

The concerned function.

symbol : Symbol

The variable for which the stationary points are to be determined.

domain : Interval

The domain over which the stationary points have to be checked. If unspecified, S.Reals will be the default domain.

Examples

>>> from sympy import Symbol, S, sin, log, pi, pprint, stationary_points
>>> from sympy.sets import Interval
>>> x = Symbol('x')

>>> stationary_points(1/x, x, S.Reals)
EmptySet

>>> pprint(stationary_points(sin(x), x), use_unicode=False)
pi                              3*pi
{2*n*pi + -- | n in Integers} U {2*n*pi + ---- | n in Integers}
2                                2

>>> stationary_points(sin(x),x, Interval(0, 4*pi))
FiniteSet(pi/2, 3*pi/2, 5*pi/2, 7*pi/2)

format: plain


text:
# zbMATH — the first resource for mathematics

##### Examples
 Geometry Search for the term Geometry in any field. Queries are case-independent. Funct* Wildcard queries are specified by * (e.g. functions, functorial, etc.). Otherwise the search is exact. "Topological group" Phrases (multi-words) should be set in "straight quotation marks". au: Bourbaki & ti: Algebra Search for author and title. The and-operator & is default and can be omitted. Chebyshev | Tschebyscheff The or-operator | allows to search for Chebyshev or Tschebyscheff. "Quasi* map*" py: 1989 The resulting documents have publication year 1989. so: Eur* J* Mat* Soc* cc: 14 Search for publications in a particular source with a Mathematics Subject Classification code (cc) in 14. "Partial diff* eq*" ! elliptic The not-operator ! eliminates all results containing the word elliptic. dt: b & au: Hilbert The document type is set to books; alternatively: j for journal articles, a for book articles. py: 2000-2015 cc: (94A | 11T) Number ranges are accepted. Terms can be grouped within (parentheses). la: chinese Find documents in a given language. ISO 639-1 language codes can also be used.

##### Operators
 a & b logic and a | b logic or !ab logic not abc* right wildcard "ab c" phrase (ab c) parentheses
##### Fields
 any anywhere an internal document identifier au author, editor ai internal author identifier ti title la language so source ab review, abstract py publication year rv reviewer cc MSC code ut uncontrolled term dt document type (j: journal article; b: book; a: book article)
The saturation of convergence on the interval [0,1] for the $q$-Bernstein polynomials in the case $q>1$. (English) Zbl 1236.41011
Summary: We consider saturation of convergence on the interval $[0,1]$ for the $q$-Bernstein polynomials of a continuous function $f$ for arbitrary fixed $q>1$. We show that the rate of uniform convergence on $[0,1]$ is $o(q ^{- n})$ if and only if $f$ is linear. The result is sharp in the following sense: it ceases to be true if we replace “$o$” by “$O$”.

##### MSC:
 41A10 Approximation by polynomials 33D45 Basic orthogonal polynomials and functions (Askey-Wilson polynomials, etc.)
##### Keywords:
$q$-Bernstein polynomials; saturation
Full Text:
##### References:
 [1] Bernstein, S. N.: Sur l’ordre de la meilleure approximation des fonctions continues par des polynomes de degré donné, Mém. acad. Belg. 4, No. 2, 1-103 (1912) · Zbl 45.0633.03 [2] Kac, V.; Cheung, P.: Quantum calculus, (2002) · Zbl 0986.05001 [3] Ostrovska, S.: Q-Bernstein polynomials and their iterates, J. approx. Theory 123, No. 2, 232-255 (2003) · Zbl 1093.41013 · doi:10.1016/S0021-9045(03)00104-7 [4] Ostrovska, S.: The first decade of the q-Bernstein polynomials: results and perspectives, J. math. Anal. approx. Theory 2, No. 1, 35-51 (2007) · Zbl 1159.41301 [5] Ostrovska, S.: The sharpness of convergence results for the q-Bernstein polynomials in the case q>1, Czechoslovak math. J. 58, No. 4, 1195-1206 (2008) · Zbl 1174.41010 · doi:10.1007/s10587-008-0079-7 [6] Phillips, G. M.: Bernstein polynomials based on the q-integers, Ann. numer. Math. 4, 511-518 (1997) · Zbl 0881.41008 [7] Wang, H.: Voronovskaya type formulas and saturation of convergence for q-Bernstein polynomials for 01, J. math. Anal. appl. 337, No. 1, 744-750 (2008) · Zbl 1122.33014 · doi:10.1016/j.jmaa.2007.04.014


text:
# Bloch Equations

Page Under construction

### Introduction

In 1946 Felix Bloch, co-discoverer of NMR, proposed a set of equations to described the time dependence of the net magnetization during the course of the NMR experiment. These equations are known as the Bloch equations and give insights into many processes in NMR. The Bloch equations follow first order kinetics and the derivations are first-order differentials.

### Bloch Equations in the Lab Frame

It has been shown that nuclei in placed in a magnetic field precess with a characteristic Larmor frequency, $$\omega$$.

$\omega_0=-\gamma (1-\sigma) B_0$

which can be made time-dependent by considering a time-dependent magnetic field B(t).

In addition we have also seen that there is a bulk magnetization, based on Boltzmann statistics, which lies along the direction of the applied magnetic field, $$B_0$$. This bulk magnetization can then be thought of precessing at the Larmor frequency. Assuming that the $$B_0$$ is along the Z-axis, we can describe the time dependence of the magnetization $$M$$, by

$\frac{dM}{dt}=\omega (t) x M(t)-[R][M(t)-M_eq]$

where R is a rotation matrix, and $$M_{eq}$$ is the magnetization at equilibrium along the z-axis. The rotation matrix accounts for relaxation processes and is given by

$R= \begin{pmatrix} \frac{1}{T_2} & 0 & 0 \\ 0 & \frac{1}{T_2} &0 \\ 0& 0 & \frac{1}{T_1} \end{pmatrix}$

The $$[R][M(t)-M_{eq}]$$ term then describes the decay of the magnetization in the x-y plane and the growth of the equilibrium magnetization, due to T2 and T1 effects, repectively.

Expansion of the equation yeilds the magnetization in each direction

$[\begin{pmatrix} \frac{dM^*_x(t)}{dt} \\ \frac{dM^*_y(t)}{dt} \\ \frac{dM^*_z(t)}{dt} \end{pmatrix}= \begin{pmatrix} [M_x(t) \omega _y(t)-M_y\omega _z(t)]- \frac{M_x(t)}{T_2} \\ [M_x(t) \omega _z(t)-M_z\omega_x(t)]- \frac{M_y(t)}{T_2} \\ [M_y(t) \omega _x(t)-M_x\omega _y(t)]-\frac{[M_z(t)-M_{eq}]}{T_1} \end{pmatrix}$

Assuming that we have a static magnetic field these equations simplify to

$[\begin{pmatrix} \frac{dM^*_x(t)}{dt} \\ \frac{dM^*_y(t)}{dt} \\ \frac{dM^*_z(t)}{dt} \end{pmatrix} = \begin{pmatrix} -\omega _0M_y(t)-\frac{M_x(t)}{T_2} \\ \omega _0M_x(t)-\frac{M_y(t)}{T_2} \\ -\frac{[M_z(t)-M_{eq}]}{T_1} \end{pmatrix}$

As the magnetization is precessing about the Z axis as it recovers from the x-y plane it is realized that the time dependance will follow an oscilitory pattern which can be described using trigonmetric functions. Therefore at a given time the magnetization in any direction will be

$\begin{pmatrix} M_x(t) \\ M_y(t) \\ M_z(t) \end{pmatrix} = \begin{pmatrix} [M_x(0)cos \omega _0t - M_y(0)sin \omega _0t]e^{\frac{-t}{T_2}} \\ [M_y(0)cos \omega _0t - M_x(0)sin \omega _0t]e^{\frac{-t}{T_2}} \\M_z(0)e^{\frac{-t}{T_1}} + M_{eq}(1-e^{\frac{-t}{T_1}})\end{pmatrix}$

Where $$M_{x,y,z}(0)$$ is the magnetization at t=0.

#### What Do The Equations Describe?

From this derivation we are able to describe the motion of the bulk magnetization of the nuclei after a pulse as a function of time accounting for relaxation.

### Bloch Equations in the Rotating Frame

One can imagine that application of a $$\frac{\pi}{2}$$ pulse in which the B- field now becomes time dependent would be challenging to calculate using the Bloch equations in the lab frame. Therefore we now shift our discussion to the rotating frame. It should be stated here that the insertion of the $$^*$$ to denote the magnetization projection on the rotating frame.

The frequency of rotation $$\omega _{rot}$$, is equivalent to spins precession frequency, which will be the Larmor frequency. From this we can describe the change of the magnetization as

$\frac{d^*M}{dt}=\frac{dM}{dt}-\omega _{rot}xM$

We know that $$\frac{dM}{dt}$$ is given by the bloch equations we derived for the lab frame that is:

$\frac{dM}{dt}=\omega (t) x M(t)-[R][M(t)-M_eq]$

Substituting this into our equation, we obtain

$\frac{d^*M}{dt}=\omega (t)XM-\omega _{rot}xM-[R][M-M_{eq}]$

which simplifies (using cross product relations) to

$\frac{d^*M}{dt}=\omega _{eff}(t)xM-[R][M-M_{eq}]$

where

$\omega _{eff}(t)=\omega - \omega _{rot}$

Noting that the relation between the lab frame frame and the rotating frame is the common z-axis, we can define the Bloch equations in the rotating frame

$\begin{pmatrix} \frac{dM^*_x(t)}{dt} \\ \frac{dM^*_y(t)}{dt} \\ \frac{dM^*_z(t)}{dt} \end{pmatrix}= \begin{pmatrix} \gamma [M^*_y(t)B_z(t)-M^*_z(t)B_y(t)]-\frac{M^*_x(t)}{T_2} \\ \gamma [M^*_z(t)B_x(t)-M^*_x(t)B_z(t)]-\frac{M^*_y(t)}{T_2} \\ \gamma [M^*_x(t)B_y(t)-M^*_y(t)B_x(t)]-\frac{[M^*_z(t)-M^*_{eq}]}{T_2} \end{pmatrix}$

Which can be simplified to give

$\begin{pmatrix} \frac{dM^*_x(t)}{dt} \\ \frac{dM^*_y(t)}{dt} \\ \frac{dM^*_z(t)}{dt} \end{pmatrix}= \begin{pmatrix} -\Omega M^*_y(t)- \gamma M^*_z(t)B^*_y(t)]-\frac{M^*_x(t)}{T_2} \\ -\gamma [M^*_x(t)+ \gamma M^*_z(t)B^*_x(t)]-\frac{M^*_y(t)}{T_2} \\ \gamma [M^*_x(t)B^*_y(t)-M^*_y(t)B^*_x(t)]-\frac{[M^*_z(t)-M^*_{eq}]}{T_2} \end{pmatrix}$

where

$\Omega=\omega _{0}-\omega _{rot}$

### Effects of RF pulses

During the NMR experiment, we can choose which direction we can apply our magnetic field during the pulse. For simplicity we assume that we apply the pulse along the +x axis. The nutation frequency is then defined as

$\omega_1=\mid{\gamma B_1(t)} \mid$

where $$B_1$$ is the magnetic field applied along rhe x-axis. Application of this to the Bloch equations in the rotating frame we obtain

$\begin{pmatrix} M^*_x(t) \\ M^*_y(t) \\ M^*_z(t) \end{pmatrix}= \begin{pmatrix} \omega_1 M^*_zsin\phi - \frac{-M^*_x}{T_2} \\ -\omega_1 M^*_zcos\phi - \frac{-M^*_y}{T_2} \\-\omega_1 M^*_zsin\phi + \omega_1 M^*_zcos\phi-\frac{(M^*_z-M^*_eq)}{T_1} \end{pmatrix}$

where $$\phi$$ is the phase of the pulse (0=x axis and 270=-y axis). The RF pulse is much shorter than T1, T2, or $$\omega_0$$. Therefore we can neglect any terms containing these values.THe equations then simplify to

$\begin{pmatrix} M^*_x(t) \\ M^*_y(t) \\ M^*_z(t) \end{pmatrix}= \begin{pmatrix} \omega_1 M^*_zsin\phi \\ -\omega_1 M^*_zcos\phi \\-\omega_1 M^*_zsin\phi + \omega_1 M^*_zcos\phi \end{pmatrix}$

Thereby application of a pulse of phase zero will result in the following result for the magnetization as a function of time

$\begin{pmatrix} \frac{dM^*_x(t)}{dt} \\ \frac{dM^*_y(t)}{dt} \\ \frac{dM^*_z(t)}{dt} \end{pmatrix}= \begin{pmatrix} 0 \\ \gamma B_1(t) M^*_z \\-\gamma B_1(t) M^*_z\end{pmatrix}$

Or more generally as

$\begin{pmatrix} M^*_x(t) \\ M^*_y(t) \\ M^*_z(t) \end{pmatrix}= \begin{pmatrix} M^*_x \\ M^*_ycos\omega _1t - M^*_zsin\omega _1t \\M^*_zcos\omega _1t - M^*_ysin\omega _1t \end{pmatrix}$

We can also describe the effect of a pulse of any phase on a Cartesian basis

$\begin{pmatrix} M^*_x(t) \\ M^*_y(t) \\ M^*_z(t) \end{pmatrix}=\begin{pmatrix}\frac{1}{2}M^*_x(1+cos\omega _1t)+\frac{1}{2}(M^*_x cos2\phi +M^*_ysin2\phi)(1-cos\omega _1t)+M^*_zsin\phi sin\omega _1t \\ \frac{1}{2}M^*_y(1+cos\omega _1t)-\frac{1}{2}(M^*_y cos2\phi +M^*_xsin2\phi)(1-cos\omega _1t)+M^*_zcos\phi sin\omega _1t \\ M^*_zcos\omega _1t-(M^*_xsin\phi -M^*_ycps\phi )sin\omega _1t \end{pmatrix}$

If the movement of the magnetization is slow, then

$\frac{dM^*_x}{dt}=\frac{dM^*_y}{dt}=\frac{dM_z}{dt}=0$

When can then solve for the magnetizations in each direction

$M^*_x=-\frac{2\pi \gamma\ B_1 M_0 T^2_2 \Omega}{1+4\pi ^2T^2_2 \Omega ^2+\gamma ^2 B_1^2T_1T_2}$

$M^*_y=-\frac{\gamma\ B_1 M_0 T_2}{1+4\pi ^2T^2_2 \Omega ^2+\gamma ^2 B_1^2T_1T_2}$

$M_z=\frac{M_0[1+4\pi ^2T^2_2\Omega ^2]}{1+4\pi ^2T^2_2 \Omega ^2+\gamma ^2 B_1^2T_1T_2}$

### Free Precession

In the absences of any magnetization applied in the x-y plane, the change in the magnetization is due to relaxation effects of T1 and T2 processes.
The Bloch equations in the rotating fram then reduce to

$\begin{pmatrix} \frac{dM^*_x(t)}{dt} \\ \frac{dM^*_y(t)}{dt} \\ \frac{dM^*_z(t)}{dt} \end{pmatrix}= \begin{pmatrix} -(\omega _{rot} - \omega _0)M^*_y(t)-\frac{M^*_x(t)}{T_2} \\ (\omega _{rot} - \omega _0)M^*_x(t)-\frac{M^*_y(t)}{T_2} \\ \frac{-[M^*_z(t)-M^*_{eq}]}{T_1} \end{pmatrix}$

which can be solved to give

$\begin{pmatrix} M^*_x(t) \\ M^*_y(t) \\ M^*_z(t) \end{pmatrix}= \begin{pmatrix} [M^*_x(0) cos\Omega t - M^*_y sin\Omega t] e^{\frac{-t}{T_2}} \\ [M^*_y(0) cos\Omega t + M^*_x sin\Omega t]e^{\frac{-t}{T_2}} \\ M^*_z(0)e^{\frac{-t}{T_1}} + M_{eq}(1-e^{\frac{-t}{T_1}}\end{pmatrix}$

### References

1. This is meant for references used for constructing the module. They must be primary and accessible to readers at a library.
2. You need at least two different sources here. Websites are not allowed. DOI links to J. Chem. Ed. are ideal Do not reference class notes. Also, do not reference textbooks for maximal credit. Using the insert citation button to automatically handle references is highly suggested (bottom right button on editor toolbar).

• This is not meant for references used for constructing the module, but as secondary and unvetted information available at other site
• Link to outside sources. Wikipedia entries should probably be referenced here.

### Problems

Be careful not to copy from existing textbooks. Originality is rewarded. Make up some practice problems for the future readers. Five original with varying difficulty questions (and answers) are ideal.

### Contributors

• Name #1 here (if anonymous, you can avoid this) with university affiliation

14:26, 17 Jan 2014

## Tags

Module Vet Level:
Module Target Level:

### Wikitexts

An NSF funded Project


text:
show that if $\beta + n\alpha$ is a root for some integer $n$, then $\beta + n\alpha$ lies in the alpha string through beta.

So I would like to show the following, which is,

If $\beta + n\alpha$ is a root for some integer $n$, then $\beta + n\alpha$ lies in the alpha string through $\beta$.

I'm guessing the fact that if $\beta -q\alpha, \ldots , \beta + p\alpha$ is an $\alpha$ string through $\beta$ then $\frac{q-p}{2}\alpha (x) = \beta (x)$ for any $x \in [L_{\alpha},L_{-\alpha}]$.

-
I'm confused about what definitions you are using. To me, the $\alpha$ string through $\beta$ consists of roots of the form $\beta + n\alpha$ for some integer $n$. –  Sammy Black May 30 '13 at 21:40
The alpha string through beta consists of a sequence of weights. But maybe there is a break in the sequence. And so there is more than just one string. The point of this is to show there is only one string. –  user58514 May 30 '13 at 21:43

We have a hint for you: consider $\alpha$ srting through $\beta$ and $\beta$ string through $\alpha$.


text:
# Tag Info

1

You're pretty much correct, so these are mostly confirmations: Yes, the "3-month" USD LIBOR rate is really a 2 business day forward 3-month LIBOR rate (assuming the anchor date of your yield curve, the date on which the discount factor is 1, is "today"). USD swaps observe both New York and London holidays. If the maturity date is a bad day, it is adjusted ...

0

"Calibrating the model to them via regression"... Vasicek has just three parameters: $\sigma$ (vol), $r_L$ (long rate) and $a$ (mean reversion) and a time-dependent short rate $r_0$. Can you specify what you are thinking of in terms of a regression model to estimate these? Obviously $r_0$ will not be a stable parameter. If you want to estimate $\sigma$, ...

0

In practice, you can calibrate to either 1 month libor or 3 month libor, but not both. That's because there's a basis swap between 1 month libor and 3 month libor that can't be explained by your model.

Top 50 recent answers are included


text:
# Studies Series – Fault-Tolerant Multi-Agent Optimization: Part III

The part III of Fault-tolerant multi-agent optimization continues today with the third installment. Following the conclusions of the previous parts I and II of this series, this post extends the results to a global cost function with the definition of a family of functions C (normalization functions) between two weaker versions of the problem for crash faults Byzantine faults, respectively:

## Fault-Tolerant Multi-Agent Optimization: Part III

Abstract:

We study fault-tolerant distributed optimization of a sum of convex (cost) functions with real-valued scalar input/output in the presence of crash faults or Byzantine faults. In particular, the goal is to optimize a global cost function 1/n(iVhi(x)), where V={1,,n} is the collection of agents, and hi(x) is agent i‘s local cost function, which is initially known only to agent i. Since the above global cost function cannot be optimized exactly in presence of crash faults or Byzantine faults, we define two weaker versions of the problem for crash faults and Byzantine faults, respectively.
When some agents may crash, the goal for the weaker problem is to generate an output that is an optimum of a function formed as

Cihi(x)iαihi(x)),

where N is the set of non-faulty agents, F is the set of faulty agents (crashed agents), 0αi1 for each iF and C is a normalization constant such that C(|N|+iFαi)=1. We present an iterative algorithm in which each agent only needs to perform local computation, and send one message per iteration.
When some agents may be Byzantine, the system cannot take full advantage of the data kept by non-faulty agents. The goal for the associated weaker problem is to generate an output that is an optimum of a function formed as

iαihi(x),

such that αi0 for each iN and iαi=1. We present an iterative algorithm, where only local computation is needed and only one message per agent is sent in each iteration, that ensures that at least |N|f agents have weights (αi‘s) that are lower bounded by 1/2(|N|f).

### Problem Formulation

The authors of this interesting paper formulate a hypothesis of an iterative algorithm, deployed to synchronous systems but generalizable to asynchronous systems (discussed only in the final part of the paper), and which finds applications in the domain of large-scale distributed machine learning, where there exists either a data transmission constraint and/or a privacy issue:

This problem finds its applications in the domain of large-scale distributed machine learning, where data are generated at different locations and the data center at each location is not allowed to transmit all the locally collected data to other centers either due to transmission capacity constraint or due to privacy issue. This problem is well-studied in the scenario where each agent is reliable throughout any execution of an algorithm [7,15,21]. In this work, we consider the fault-tolerant version of this problem. In particular, we consider the setting where up to f of the n agents may crash or be Byzantine faulty.

The problems 1 and 2 were set by a figure as follows:

### Problem 1

x˜ ∈ arg min x∈R C X i∈N hi(x) +∑ i∈F αihi(x) !

such that

∀i ∈ F, 0 ≤ αi ≤ 1 and C |N | + ∑i∈F αi ! = 1

### Problem 2

with parameters β, γ, β ≥ 0

x˜∈ arg min x∈R ∑ i∈N αihi(x)

such that

∀ ∑ i ∈ N , αi ≥ 0, i∈N αi = 1, and

∑ i∈N 1(αi > β) ≥ γ

( Fig. 1: Problem formulations: All non-faulty agents must output an identical value x˜ ∈ R that satisfies the constraints specified in each problem formulation. )

We will say that Problem 1 or 2 is solvable if there exists an algorithm that will find a solution for the problem (satisfying all its constraints) for all admissible local cost functions, and all possible behaviors of faulty agents. Our problem formulations require that all non-faulty agents output asymptotically identical x˜ ∈ R, while satisfying the constraints imposed by the problem (as listed in Figure 1). Thus, the traditional fault-tolerant consensus [9] problem, which also imposes a similar agreement condition, is a special case of our optimization problem.1 Therefore, the lower bound of n > 3f for Byzantine consensus [9] also applies to our problem. Hence we assume that n > 3f.

The Algorithm 1 and 2 for the Problems 1 and 2 will be sketched for a reference about the computations involved in the paper:

### Step 1:

Send xj [t − 1] to all the agents (including agent j itself).

### Step 2:

Upon receiving xi[t−1] from agent i, compute h′ j(xi[t−1]) – the gradient of function hj(·)at xi[t − 1] – and send it back to agent i.

### Step 3:

Let R1j [t − 1] denote the set of gradients of the form h′i(xj [t − 1]) received as a result ofstep 1 and step 2. Update sj as
sj [t] = xj [t − 1] − λ[t − 1] / | R1 j [t − 1] | (∑(i∈R1j) [t−1] h′i(xj [t − 1]) )        (2)

### Step 4:

Send sj [t] to all the agents (including agent j itself).

### Step 5:

Let R²j [t − 1] denote the set of auxiliary variables si[t] received as a result of step 4.
Update xj as
xj [t] = 1 / |j [t − 1]| ∑(i∈R²j[t−1])  si[t].                                             (3)

Steps 1, 2 and 3 correspond to the first round of information exchange, and step 4 corresponds to the second round of information exchange. We will show that Algorithm 1 correctly solves Problem 1. Intuitively speaking, the first round of information exchange corresponds to the standard gradient-method iterate, which drives each local estimate to a global optimum; the second round of information exchange forces all local estimates at non-faulty agents to reach consensus. Algorithm 2 will achieve a similar goal with a single round of exchange.

After a lengthy and thorough sketch of proofs, lemma and theorems (somewhat very lengthy), the authors presented us with the Algorithm 2:

In Algorithm 1, in each iteration t ≥ 1, there are two rounds of information exchange.Next we will present a simple algorithm which only requires one message sent by each agent per iteration. In this algorithm, each agent j maintains one local estimate xj , where xj [0] is an arbitrary input at agent j.

### Algorithm 2

for agent j for iteration t ≥ 1:

### Step 1:

Compute h′j(xj [t−1])– the gradient of local function hj(·) at point xj [t−1], and send the tuple (xj [t − 1], h′j (xj [t − 1])) to all the agents (including agent j itself).
Step 2:  Let Rj [t − 1] denote the set of tuples of the form (xi[t − 1], h′i(xi[t − 1])) received as a
result of step 1. Update xj as

xj [t] = 1/|Rj [t − 1]| (∑(i∈Rj[t−1]) xi[t − 1] − λ[t − 1]h′i(xi[t − 1]))            (61)

### Discussion and Conclusions

Following the presentation of the Algorithm 2 and 3 – this third one regarding the synchronous byzantine consensus algorithm, which I do not present here but recommend a further check by the readers, as well as all the appendices section -, the authors finally discuss and conclude the paper, with their proposal for the generalization to asynchronous byzantine fault crash algorithms (with a further Algorithm 4 and final Theorem 5 proposals):

So far, a synchronous system is considered. In an asynchronous system, when there are up to f crash faults, Problem 1 is not solvable, since it is possible that every agent in the system is non-faulty,but f agents are slow. In this case, the system will mistakenly “treat” the slow agents as crashed agents. Consequently, the weights of the slow agents may be strictly smaller than the other agents. Despite the impossibility of solving Problem 1 in asynchronous system, nevertheless, Problem 2 can be solved with β ≥ 1 n and γ ≥ |N| − f. In particular, Algorithm 2 can be easily adapted for asynchronous system by modifying the receiving step (step 2). For completeness, we list out the algorithm for crash faults.

(…)

In an asynchronous system, when there are up to f Byzantine faults, simple iterative algorithms like Algorithm 3 may not exist, observing that it is impossible to achieve Byzantine consensus with single round of message exchange with only n = 3f + 1 agents. In contrast, when the algorithm introduced in [1] is used as a communication mechanism in each iteration, we believe that Algorithm 3 can be modified such that it can solve Problem 2 with β ≥ 1 2(|N |−f) and γ ≥ |N | −2f. There may be a tradeoff between the system size n and the communication load in each iteration. We leave this problem for future exploration. Note that the definition of admissibility of the local functions in this report is slightly different from that in [19]. Comparing to [19], stronger assumptions are used in proving the correctness of the three iterative algorithms developed in this work. In particular, we require that the local functions have to have L–Lipschitz derivatives. Whether such assumptions are necessary or not is still open, and we leave this for future exploration as well.

Featured Image: Solmaz S. Kia


text:
[-2ex]

How to correctly format (and align) a LaTeX proof? – TeX – LaTeX Stack Exchange

\usepackage{amsmath,amsthm,amssymb}

Paragraph formatting – ShareLaTeX, Online LaTeX Editor

double space text

\renewcommand{\baselinestretch}{1.5}

math mode – Make equations large – TeX – LaTeX Stack Exchange

\DeclareMathSizes{12}{30}{16}{12}

Indenting a block of text in LaTeX « timmurphy.org

To indent a block of text, you can use the \addtolength{length_variable}{length} command. For this task, we need to add to the \leftskip value for the block of text.

For example, to indent a block of text by 5mm we would do the following:

…indented text here…
http://timmurphy.org/2009/08/15/indenting-a-block-of-text-in-latex/

math teacher Gregory Reese technologyisforkids.com

LaTeX Tutorial 1 – Creating a LaTeX Document – YouTube

LaTeX tutorial using Texmaker.

Gregory Reese Technologyisforkids.com

http://www.technologyisforkids.com/

Educational Technology: The power of educational diversity to meet the needs of a diverse population.

LaTeX Setup and Tutorial

Creating a simple document using LaTeX with TeXMaker for WindowsNow we’re finally ready to write a document in LaTeX. The instructions below will take you through the process of creating a very simple document.Open: Texmaker from the Start menu.  You may want to put a shortcut on your desktop.

Gregory Reese Technologyisforkids.com

http://www.technologyisforkids.com/

Educational Technology: The power of educational diversity to meet the needs of a diverse population.

About MiKTeX – MiKTeX Project Page

Fast previewerThe TeX output viewer Yap allows for an optimized edit-compile-view cycle if the TeX authoring system in use supports source specials.

Gregory Reese Technologyisforkids.com

http://www.technologyisforkids.com/

Educational Technology: The power of educational diversity to meet the needs of a diverse population.

Texmaker free cross-platform latex editor

Additional option: A “favorites symbols” * panel allows you to define your own “symbols panel”.To add a symbol to the “favorites symbols panel”, just right-click on a symbol in the others “symbols panels” and select “Add to favorites” in the pop-up menu.To remove a symbol in the “favorites symbols panel”, just right-click on it and select “Remove from favorites” in the pop-up menu.You can also define the format of your mathematical text via the “Math” menu.For the “array” environments, a wizard like the “Tabular” wizard is available in the “Wizard” menu. With this wizard, you can select the environment : array, matrix, pmatrix…. The cells can be directly completed.

Gregory Reese Technologyisforkids.com

http://www.technologyisforkids.com/

Educational Technology: The power of educational diversity to meet the needs of a diverse population.

Yap Tips

YAP “Yet Another Previewer” is a part of Miktex, and it is installed as part of the Miktex installation. But you may still want to configure parts of it after it is installed.

via Yap Tips.

Gregory Reese Technologyisforkids.com

http://www.technologyisforkids.com/

Educational Technology: The power of educational diversity to meet the needs of a diverse population.

Texmaker free cross-platform latex editor

User manual : Contents1. Configuring Texmaker

Gregory Reese Technologyisforkids.com

http://www.technologyisforkids.com/

Educational Technology: The power of educational diversity to meet the needs of a diverse population.

Texmaker free cross-platform latex editor

Texmaker packages

Gregory Reese Technologyisforkids.com

http://www.technologyisforkids.com/

Educational Technology: The power of educational diversity to meet the needs of a diverse population.

LaTeX Setup and Tutorial

Gregory Reese Technologyisforkids.com

http://www.technologyisforkids.com/

Educational Technology: The power of educational diversity to meet the needs of a diverse population.

TeXShop

About TeXShop:TeXShop is a TeX previewer for Mac OS X, written in Cocoa. Since pdf is a native file format on OS X, TeXShop uses “pdftex” and “pdflatex” rather than “tex” and “latex” to typeset in its default configuration; these programs in the standard TeX Live distribution of TeX produce pdf output instead of dvi output.TeXShop uses TeX Live, a standard distribution of Tex programs maintained by the TeX Users Group TUG for Mac OS X, Windows, Linux, and various other Unix machines. The distribution includes tex, latex, dvips, tex fonts, cyrillic fonts, and virtually all other programs and supporting files commonly used in the TeX world. The most recent version of this distribution is maintained for the Mac by the MacTeX TeXnical Working Group of the TeX Users Group and available under the “Obtaining” tab.T

via TeXShop.

Gregory Reese Technologyisforkids.com

http://www.technologyisforkids.com/

Educational Technology: The power of educational diversity to meet the needs of a diverse population.

TeXShop

Obtaining TeXShopIf you just want to upgrade to the latest TeXShop, getLatest TeXShop Version 3 for Lion, Mountain Lion, and Mavericks 70 MB

via TeXShop.

Gregory Reese Technologyisforkids.com

http://www.technologyisforkids.com/

Educational Technology: The power of educational diversity to meet the needs of a diverse population.

Android LaTeX Editor

VerbTeX LaTeX EditorThe free, collaborative LaTeX Editor for your Android deviceVerbTeX allows you to create and manage LaTeX projects directly on your Android deviceand generate a PDF by using the LaTeX service available at verbosus.com

Gregory Reese Technologyisforkids.com

http://www.technologyisforkids.com/

Educational Technology: The power of educational diversity to meet the needs of a diverse population.

VerbTeX LaTeX Editor – Android Apps on Google Play

VerbTeX is a free, collaborative LaTeX Editor for your Android device. It allows you to create and manage LaTeX projects directly on your Android device and generate a PDF by using Verbosus Online LaTeX and Octave Editor”The Best Way to Type LaTeX on the Go” – androidappsreview.com”If you’re in need of a solid LaTeX editor that can travel with you in your pocket, you cannot beat VerbTeX. It will provide everything you need, plus cloud syncing” – androidappsreview.com

Gregory Reese Technologyisforkids.com

http://www.technologyisforkids.com/

Educational Technology: The power of educational diversity to meet the needs of a diverse population.

TeXworks

Getting TeXworksYou can get binaries for the following platforms:

via TeXworks.

LaTeX Setup and Tutorial

LaTeX Setup and TutorialIntroductionLaTeX works like this:First, you use a text editor we’ll be using the freeware Texmaker to create a LaTeX document.Then, you run a LaTeX compiler we’ll be using MiKTeX.Finally, you need to use some kind of viewer/previewer we’ll be using Yap, which stands for “Yet Another Previewer” to view or print the formatted file.

miktex – Add templates to TeXworks – TeX – LaTeX Stack Exchange

2down votefavoriteUsing TeXworks 0.4.3 r.857 MiKTeX 2.9 on Windows 7 I am trying to add an arbitrary folder containing a template so that it can be seen from TeXworks’s New from Template… option. I can’t figure out how to inform TeXworks as to where it should look.I understand I can add templates next to the built in ones that appear under C:\Users\\AppData\Local\MiKTeX\2.9\TeXworks.4\templates. There are multiple files that go with this template, including a .sty class that I would like to keep in one place accessible to the user probably through a SVN repo, so I don’t like the idea of putting the templates in that hidden directory. I can tell MiKTeX to use an arbitrary root for packages, and would like to do the same for TeXworks and templates.

Detexify LaTeX handwritten symbol recognition

Anyone who works with LaTeX knows how time-consuming it can be to find a symbol insymbols-a4.pdf that you just can’t memorize. Detexify is an attempt to simplify this search.

How do I use it?

Just draw the symbol you are looking for into the square area above and look what happens!

http://detexify.kirelabs.org/classify.html

for education: Technologyisforkids.com


text:
# How To Unlock All SuperTuxKart Tracks

We introduced my son to SuperTuxKart around his third birthday, about when I was in the first trimester of my second pregnancy. Which means that I still associate that music with the desire to hurl. :P

Of course, my son wants to play all of the tracks, but there’s no way under the sun he could beat enough levels to unlock all of them. Or even one of them. In fact, I’m not entirely sure he knows what the goal of the game is; he just drives around looking at the cow or windmill or whatever. Although, he did eventually learn to turn right — that does help a lot. :)

So a while back, my husband dug into the XML config and got everything unlocked. But a dead netbook, a new install, and a new version of SuperTuxKart later, none of the old tutorials that have you looking for a file called challenges.xml make any sense. Because challenges.xml doesn’t exist anymore.

Well, what is there to do for a determined mother who really really really wants her electronic babysitting back? It took me a little digging, but I finally figured it out:

1. Find your configuration directory. Mine was ~/.config/supertuxkart/0.8.2/.

2. Open players.xml and find where the challenges are listed under the <story-mode> tag. It should look like this:

 <story-mode first-time="true">
<city solved="none"/>
<farm solved="none"/>
<fortmagma solved="none"/>
<gp1 solved="none"/>
...
..
.
</story-mode>

3. Change all occurences of "none" to "easy".

 <story-mode first-time="true">
<city solved="easy"/>
<farm solved="easy"/>
<fortmagma solved="easy"/>
<gp1 solved="easy"/>
...
..
.
</story-mode>

(Apparently, you can also say solved="hard". I don’t know what the difference is — I tried it both ways and both unlocked all of the tracks. But just so you know.)

And that’s it! Happy playing!

My sources: one and two.


text:
## 14 OctRegional Mathematical Olympiad India 2017 Questions

The Regional Mathematical Olympiad (RMO) is organized every year in India throughout the country as a preliminary screening for the Indian National Mathematical Olympiad (INMO). This year it was held on 8th October, 2017. The questions of this year's RMO can be found below. (All questions...

## 11 SepAssam Academy of Mathematics Olympiad 2017 Questions

The Assam Academy of Mathematics (AAM) organizes a mathematics Olympiad for school students every year. This year the Olympiad was held on 10th September, 2017 in three categories. We post below the questions for Category III (for students from classes 9, 10 and 11). Prove...

## 31 AugWonders of The Pigeonhole Principle

The Department of Mathematics, NIT Silchar organized a one week workshop on "Innovative and contemporary teachers' training in Mathematics" (ICTM 2017) from 14th - 18th August 2017. The workshop was coordinated by Dr. Kedar Nath Das, Assistant Professor, Department of Mathematics, NIT Silchar. The workshop...

## 21 AugPre RMO India 2017

Starting from this year, the mathematics Olympiad candidates in India will have to give a Pre Regional Mathematical Olympiad (PRMO) before the actual Regional Mathematical Olympiad (RMO) later. The 2017 PRMO conducted by the Indian Association of Physics Teachers (IAPT) this year. The questions are...

## 20 AugShortlisted Problems of the 56th International Mathematical Olympiad

The International Mathematical Olympiad (IMO) is an yearly competition for pre-college students, held every year in a different country. The shortlisted problems of the previous year's IMO is released with the IMO problems of the current year. The 56th IMO was held in Thailand last...

## 20 Jul"Mathematics Lab"

Sounds strange, right? Well, "Mathematics Lab" is something we are not well-acquainted with. We all had "Physics lab", "Chemistry Lab", "Biology Lab" in our schools/colleges but not "Mathematics Lab". Last month, I and my friend Ajoy Dutta got an opportunity to design a "Mathematics Lab",...


text:
# What is going wrong when I save an animation as a SWF-file?

The first I am trying to export animations from Mathematica to a file and then to LaTeX. Don't assume I know anything about what I'm doing.

The following definitions defines the still image of a single frame. It is a stick of length $k$ that has two pivot points: one sliding along $x$-axis, $\{\cos u,0\}$, and the other, along the $y$-axis. $\{0,\sin u\}$, so the distance between the two pivots is always equal to $1$ irrespective of the value of the parameter $u$. One end of the stick is at the $y$-axis pivot, and the other is determined by the length of the stick. That other endpoint draws an ellipse, as $u$ increases from $0$ to $2\pi$.

tikku[u_, k_] :=
Show[{ParametricPlot[{k Cos[x], (1 - k) Sin[x]}, {x, 0, u}],
Graphics[{Line[{{k Cos[u] + 0.05 Sin[u], (1 - k) Sin[u] +
0.05 Cos[u]}, {0.05 Sin[u],
Sin[u] + 0.05 Cos[u]}, {-0.05 Sin[u],
Sin[u] - 0.05 Cos[u]}, {k Cos[u] -
0.05 Sin[u], (1 - k) Sin[u] - 0.05 Cos[u]}, {k Cos[u] +
0.05 Sin[u], (1 - k) Sin[u] + 0.05 Cos[u]}}]}],
Graphics[{PointSize[0.02], {Point[{Cos[u], 0}],
Point[{0, Sin[u]}]}}]}, PlotRange -> {{-2.2, 2.2}, {-1.2, 1.2}},
AspectRatio -> Automatic, AxesOrigin -> {0, 0}, Axes -> True]

Then I create an animation with

movie = Animate[tikku[u, 1.8], {u, 0, 2 Pi}, Alignment -> Center]

That is displayed as expected. But when I export that file with the command

Export["Analyysi I/2013/ellipsi.swf", movie]

and open the resulting .swf file with Adobe Reader I get the following error message (my translation from Finnish): "Adobe Reader couldn't open the file "ellipsi.swf", because it is of an unsupported type...."

I can open the .swf-file in IE. If I export the animation as an .avi-file instead, then I can also view it in Windows Media Player. However, something seems to have gone wrong while exporting, because at the beginning (and also at the end) a frame with Mathematica code is shown instead of the first frame of the animation.

Questions:

1. What should I do to make it viewable in Adobe Reader? (I just installed flashplayer, but that didn't help) This is kinda crucial for including the animation to a slide set produced by LaTeX.
2. What should I do to get rid of that extraneous first frame?
• I didn't think Adobe Reader could open Flash files... Are you sure that what you want to do is possible? Nov 25 '13 at 16:11
• @cormullion: No, I'm not sure. But embedding the resulting .swf to a .pdf- document produced by LaTeX should be possible according to the documentation of a package called media9. My attempts to do that have failed, and I felt that something might be wrong with the .swf-file. It is quite possible that I am wrong. Nov 25 '13 at 17:08
• To see why you get that Mathematica code, try calling your function as tikku[0.0,1.8] and you'll get error messages. I actually got a much better animation using movie2=Table[tikku[u,1.8],{u,0.01,2.0 Pi,Pi/32.0}];Export["test2.swf",movie2]; That answers your question 2), but about question 1) I'm not sure. To narrow down the problem, you should download an SWF file not created by Mathematica from the web and try to embed it in a pdf. If that works and plays properly, then we can try to figure out what is different about Mathematica-generated SWF files. Nov 25 '13 at 17:28
• After a bit of googling I learn (to my horror:)) that it is possible to embed SWF inside a PDF and then view the PDF in Adobe reader. But there are all kinds of issues with security and then I stopped reading so this is where I must bow out of the question... Good luck! Nov 25 '13 at 17:36
• Thanks, @Jason. <insert blush emoticon> That was silly of me. I added the ParametricPlot later, and didn't test it. Of course, in Mathematica the error message flashes out so fast, but I keep seeing the errorneous frame in animation. Nov 25 '13 at 18:06


text:
# Properties

 Label 400.4.a.o Level $400$ Weight $4$ Character orbit 400.a Self dual yes Analytic conductor $23.601$ Analytic rank $1$ Dimension $1$ CM no Inner twists $1$

# Related objects

## Newspace parameters

 Level: $$N$$ $$=$$ $$400 = 2^{4} \cdot 5^{2}$$ Weight: $$k$$ $$=$$ $$4$$ Character orbit: $$[\chi]$$ $$=$$ 400.a (trivial)

## Newform invariants

 Self dual: yes Analytic conductor: $$23.6007640023$$ Analytic rank: $$1$$ Dimension: $$1$$ Coefficient field: $$\mathbb{Q}$$ Coefficient ring: $$\mathbb{Z}$$ Coefficient ring index: $$1$$ Twist minimal: no (minimal twist has level 20) Fricke sign: $$-1$$ Sato-Tate group: $\mathrm{SU}(2)$

## $q$-expansion

 $$f(q)$$ $$=$$ $$q + 4 q^{3} - 16 q^{7} - 11 q^{9}+O(q^{10})$$ q + 4 * q^3 - 16 * q^7 - 11 * q^9 $$q + 4 q^{3} - 16 q^{7} - 11 q^{9} + 60 q^{11} - 86 q^{13} - 18 q^{17} - 44 q^{19} - 64 q^{21} + 48 q^{23} - 152 q^{27} - 186 q^{29} - 176 q^{31} + 240 q^{33} - 254 q^{37} - 344 q^{39} + 186 q^{41} - 100 q^{43} + 168 q^{47} - 87 q^{49} - 72 q^{51} + 498 q^{53} - 176 q^{57} + 252 q^{59} - 58 q^{61} + 176 q^{63} - 1036 q^{67} + 192 q^{69} - 168 q^{71} - 506 q^{73} - 960 q^{77} - 272 q^{79} - 311 q^{81} + 948 q^{83} - 744 q^{87} - 1014 q^{89} + 1376 q^{91} - 704 q^{93} + 766 q^{97} - 660 q^{99}+O(q^{100})$$ q + 4 * q^3 - 16 * q^7 - 11 * q^9 + 60 * q^11 - 86 * q^13 - 18 * q^17 - 44 * q^19 - 64 * q^21 + 48 * q^23 - 152 * q^27 - 186 * q^29 - 176 * q^31 + 240 * q^33 - 254 * q^37 - 344 * q^39 + 186 * q^41 - 100 * q^43 + 168 * q^47 - 87 * q^49 - 72 * q^51 + 498 * q^53 - 176 * q^57 + 252 * q^59 - 58 * q^61 + 176 * q^63 - 1036 * q^67 + 192 * q^69 - 168 * q^71 - 506 * q^73 - 960 * q^77 - 272 * q^79 - 311 * q^81 + 948 * q^83 - 744 * q^87 - 1014 * q^89 + 1376 * q^91 - 704 * q^93 + 766 * q^97 - 660 * q^99

## Embeddings

For each embedding $$\iota_m$$ of the coefficient field, the values $$\iota_m(a_n)$$ are shown below.

For more information on an embedded modular form you can click on its label.

Label $$\iota_m(\nu)$$ $$a_{2}$$ $$a_{3}$$ $$a_{4}$$ $$a_{5}$$ $$a_{6}$$ $$a_{7}$$ $$a_{8}$$ $$a_{9}$$ $$a_{10}$$
1.1
 0
0 4.00000 0 0 0 −16.0000 0 −11.0000 0
 $$n$$: e.g. 2-40 or 990-1000 Significant digits: Format: Complex embeddings Normalized embeddings Satake parameters Satake angles

## Atkin-Lehner signs

$$p$$ Sign
$$2$$ $$-1$$
$$5$$ $$1$$

## Inner twists

This newform does not admit any (nontrivial) inner twists.

## Twists

By twisting character orbit
Char Parity Ord Mult Type Twist Min Dim
1.a even 1 1 trivial 400.4.a.o 1
4.b odd 2 1 100.4.a.a 1
5.b even 2 1 80.4.a.c 1
5.c odd 4 2 400.4.c.j 2
8.b even 2 1 1600.4.a.p 1
8.d odd 2 1 1600.4.a.bl 1
12.b even 2 1 900.4.a.m 1
15.d odd 2 1 720.4.a.k 1
20.d odd 2 1 20.4.a.a 1
20.e even 4 2 100.4.c.a 2
40.e odd 2 1 320.4.a.d 1
40.f even 2 1 320.4.a.k 1
60.h even 2 1 180.4.a.a 1
60.l odd 4 2 900.4.d.k 2
80.k odd 4 2 1280.4.d.n 2
80.q even 4 2 1280.4.d.c 2
140.c even 2 1 980.4.a.c 1
140.p odd 6 2 980.4.i.e 2
140.s even 6 2 980.4.i.n 2
180.n even 6 2 1620.4.i.j 2
180.p odd 6 2 1620.4.i.d 2
220.g even 2 1 2420.4.a.d 1

By twisted newform orbit
Twist Min Dim Char Parity Ord Mult Type
20.4.a.a 1 20.d odd 2 1
80.4.a.c 1 5.b even 2 1
100.4.a.a 1 4.b odd 2 1
100.4.c.a 2 20.e even 4 2
180.4.a.a 1 60.h even 2 1
320.4.a.d 1 40.e odd 2 1
320.4.a.k 1 40.f even 2 1
400.4.a.o 1 1.a even 1 1 trivial
400.4.c.j 2 5.c odd 4 2
720.4.a.k 1 15.d odd 2 1
900.4.a.m 1 12.b even 2 1
900.4.d.k 2 60.l odd 4 2
980.4.a.c 1 140.c even 2 1
980.4.i.e 2 140.p odd 6 2
980.4.i.n 2 140.s even 6 2
1280.4.d.c 2 80.q even 4 2
1280.4.d.n 2 80.k odd 4 2
1600.4.a.p 1 8.b even 2 1
1600.4.a.bl 1 8.d odd 2 1
1620.4.i.d 2 180.p odd 6 2
1620.4.i.j 2 180.n even 6 2
2420.4.a.d 1 220.g even 2 1

## Hecke kernels

This newform subspace can be constructed as the intersection of the kernels of the following linear operators acting on $$S_{4}^{\mathrm{new}}(\Gamma_0(400))$$:

 $$T_{3} - 4$$ T3 - 4 $$T_{7} + 16$$ T7 + 16

## Hecke characteristic polynomials

$p$ $F_p(T)$
$2$ $$T$$
$3$ $$T - 4$$
$5$ $$T$$
$7$ $$T + 16$$
$11$ $$T - 60$$
$13$ $$T + 86$$
$17$ $$T + 18$$
$19$ $$T + 44$$
$23$ $$T - 48$$
$29$ $$T + 186$$
$31$ $$T + 176$$
$37$ $$T + 254$$
$41$ $$T - 186$$
$43$ $$T + 100$$
$47$ $$T - 168$$
$53$ $$T - 498$$
$59$ $$T - 252$$
$61$ $$T + 58$$
$67$ $$T + 1036$$
$71$ $$T + 168$$
$73$ $$T + 506$$
$79$ $$T + 272$$
$83$ $$T - 948$$
$89$ $$T + 1014$$
$97$ $$T - 766$$


text:
# Squared Parallelogram

Geometry Level 5

$$ABC$$ is a triangle with side lengths $$AB = 23, BC = 32, CA = 44$$. Squares $$ABHI$$, $$BCFG$$ and $$CADE$$ are erected on the outside of triangle $$ABC$$. $$X$$ and $$Y$$ are points such that $$BHXG$$ and $$CEYF$$ are parallelograms. What is the measure (in degrees) of angle $$XAY$$?

×


text:
# Show that the integral is convergent

I don't really know how I would actually show this. The only thing I can think of is to look at the graph of the function to see that it is convergent. However, how would I do it algebraically?

$$\int_{0}^{1} \frac{\sin(x)dx}{x}$$

-
Integrate by parts and see what you get. You should be able to easily prove convergence from there. –  TenaliRaman Nov 20 '12 at 17:01
@TenaliRaman: Thanks, will try that. –  Curtain Nov 20 '12 at 17:12

The function $\,\dfrac{\sin x}{x}\,$ is continuous and bounded on $\,(0,1]\,$ , and the discontinuity point at zero is removable, so the integral exists.
Since $$\lim_{x\to 0}\frac{\sin x}{x}\,\,\text{exists finitely}$$ is exactly the definition of "removable discontinuity point" when the function isn't defined at $\,x=0\,$ (or when it has a value there different from the limit's), then we have a removable point here. –  DonAntonio Nov 20 '12 at 17:21


text:
# Source code for artiq.coredevice.ttl

"""
Drivers for TTL signals on RTIO.

TTL channels (including the clock generator) all support output event
replacement. For example, pulses of "zero" length (e.g. :meth:TTLInOut.on
immediately followed by :meth:TTLInOut.off, without a delay) are suppressed.
"""

import numpy

from artiq.language.core import *
from artiq.language.types import *
from artiq.coredevice.rtio import (rtio_output, rtio_input_timestamp,
rtio_input_data)
from artiq.coredevice.exceptions import RTIOOverflow

# RTIO TTL address map:
# 0 Output level
# 1 Output enable
# 2 Set input sensitivity
# 3 Set input sensitivity and sample

[docs]class TTLOut: """RTIO TTL output driver. This should be used with output-only channels. :param channel: channel number """ kernel_invariants = {"core", "channel", "target_o"} def __init__(self, dmgr, channel, core_device="core"): self.core = dmgr.get(core_device) self.channel = channel self.target_o = channel << 8 @kernel def output(self): pass @kernel def set_o(self, o): rtio_output(self.target_o, 1 if o else 0) @kernel
[docs] def on(self): """Set the output to a logic high state at the current position of the time cursor. The time cursor is not modified by this function.""" self.set_o(True)
@kernel
[docs] def off(self): """Set the output to a logic low state at the current position of the time cursor. The time cursor is not modified by this function.""" self.set_o(False)
@kernel
[docs] def pulse_mu(self, duration): """Pulse the output high for the specified duration (in machine units). The time cursor is advanced by the specified duration.""" self.on() delay_mu(duration) self.off()
@kernel
[docs] def pulse(self, duration): """Pulse the output high for the specified duration (in seconds). The time cursor is advanced by the specified duration.""" self.on() delay(duration) self.off()
[docs]class TTLInOut: """RTIO TTL input/output driver. In output mode, provides functions to set the logic level on the signal. In input mode, provides functions to analyze the incoming signal, with real-time gating to prevent overflows. RTIO TTLs supports zero-length transition suppression. For example, if two pulses are emitted back-to-back with no delay between them, they will be merged into a single pulse with a duration equal to the sum of the durations of the original pulses. This should be used with bidirectional channels. Note that the channel is in input mode by default. If you need to drive a signal, you must call :meth:output. If the channel is in output mode most of the time in your setup, it is a good idea to call :meth:output in the startup kernel. There are three input APIs: gating, sampling and watching. When one API is active (e.g. the gate is open, or the input events have not been fully read out), another API must not be used simultaneously. :param channel: channel number """ kernel_invariants = {"core", "channel", "gate_latency_mu", "target_o", "target_oe", "target_sens", "target_sample"} def __init__(self, dmgr, channel, gate_latency_mu=None, core_device="core"): self.core = dmgr.get(core_device) self.channel = channel # With TTLs inputs, the gate control is connected to a high-latency # path through SED. When looking at the RTIO counter to determine if # the gate has closed, we need to take this latency into account. # See: https://github.com/m-labs/artiq/issues/1137 if gate_latency_mu is None: gate_latency_mu = 13*self.core.ref_multiplier self.gate_latency_mu = gate_latency_mu self.target_o = (channel << 8) + 0 self.target_oe = (channel << 8) + 1 self.target_sens = (channel << 8) + 2 self.target_sample = (channel << 8) + 3 @kernel def set_oe(self, oe): rtio_output(self.target_oe, 1 if oe else 0) @kernel
[docs] def output(self): """Set the direction to output at the current position of the time cursor. There must be a delay of at least one RTIO clock cycle before any other command can be issued.""" self.set_oe(True)
@kernel
[docs] def input(self): """Set the direction to input at the current position of the time cursor. There must be a delay of at least one RTIO clock cycle before any other command can be issued.""" self.set_oe(False)
@kernel def set_o(self, o): rtio_output(self.target_o, 1 if o else 0) @kernel
[docs] def on(self): """Set the output to a logic high state at the current position of the time cursor. The channel must be in output mode. The time cursor is not modified by this function.""" self.set_o(True)
@kernel
[docs] def off(self): """Set the output to a logic low state at the current position of the time cursor. The channel must be in output mode. The time cursor is not modified by this function.""" self.set_o(False)
@kernel
[docs] def pulse_mu(self, duration): """Pulse the output high for the specified duration (in machine units). The time cursor is advanced by the specified duration.""" self.on() delay_mu(duration) self.off()
@kernel
[docs] def pulse(self, duration): """Pulse the output high for the specified duration (in seconds). The time cursor is advanced by the specified duration.""" self.on() delay(duration) self.off()
# Input API: gating @kernel def _set_sensitivity(self, value): rtio_output(self.target_sens, value) @kernel
[docs] def gate_rising_mu(self, duration): """Register rising edge events for the specified duration (in machine units). The time cursor is advanced by the specified duration. :return: The timeline cursor at the end of the gate window, for convenience when used with :meth:count/:meth:timestamp_mu. """ self._set_sensitivity(1) delay_mu(duration) self._set_sensitivity(0) return now_mu()
@kernel
[docs] def gate_falling_mu(self, duration): """Register falling edge events for the specified duration (in machine units). The time cursor is advanced by the specified duration. :return: The timeline cursor at the end of the gate window, for convenience when used with :meth:count/:meth:timestamp_mu. """ self._set_sensitivity(2) delay_mu(duration) self._set_sensitivity(0) return now_mu()
@kernel
[docs] def gate_both_mu(self, duration): """Register both rising and falling edge events for the specified duration (in machine units). The time cursor is advanced by the specified duration. :return: The timeline cursor at the end of the gate window, for convenience when used with :meth:count/:meth:timestamp_mu. """ self._set_sensitivity(3) delay_mu(duration) self._set_sensitivity(0) return now_mu()
@kernel
[docs] def gate_rising(self, duration): """Register rising edge events for the specified duration (in seconds). The time cursor is advanced by the specified duration. :return: The timeline cursor at the end of the gate window, for convenience when used with :meth:count/:meth:timestamp_mu. """ self._set_sensitivity(1) delay(duration) self._set_sensitivity(0) return now_mu()
@kernel
[docs] def gate_falling(self, duration): """Register falling edge events for the specified duration (in seconds). The time cursor is advanced by the specified duration. :return: The timeline cursor at the end of the gate window, for convenience when used with :meth:count/:meth:timestamp_mu. """ self._set_sensitivity(2) delay(duration) self._set_sensitivity(0) return now_mu()
@kernel
[docs] def gate_both(self, duration): """Register both rising and falling edge events for the specified duration (in seconds). The time cursor is advanced by the specified duration. :return: The timeline cursor at the end of the gate window, for convenience when used with :meth:count/:meth:timestamp_mu. """ self._set_sensitivity(3) delay(duration) self._set_sensitivity(0) return now_mu()
@kernel
[docs] def count(self, up_to_timestamp_mu): """Consume RTIO input events until the hardware timestamp counter has reached the specified timestamp and return the number of observed events. This function does not interact with the timeline cursor. See the gate_*() family of methods to select the input transitions that generate events, and :meth:timestamp_mu to obtain the timestamp of the first event rather than an accumulated count. :param up_to_timestamp_mu: The timestamp up to which execution is blocked, that is, up to which input events are guaranteed to be taken into account. (Events with later timestamps might still be registered if they are already available.) :return: The number of events before the timeout elapsed (0 if none observed). Examples: To count events on channel ttl_input, up to the current timeline position:: ttl_input.count(now_mu()) If other events are scheduled between the end of the input gate period and when the number of events is counted, using now_mu() as timeout consumes an unnecessary amount of timeline slack. In such cases, it can be beneficial to pass a more precise timestamp, for example:: gate_end_mu = ttl_input.gate_rising(100 * us) # Schedule a long pulse sequence, represented here by a delay. delay(10 * ms) # Get number of rising edges. This will block until the end of # the gate window, but does not wait for the long pulse sequence # afterwards, thus (likely) completing with a large amount of # slack left. num_rising_edges = ttl_input.count(gate_end_mu) The gate_*() family of methods return the cursor at the end of the window, allowing this to be expressed in a compact fashion:: ttl_input.count(ttl_input.gate_rising(100 * us)) """ count = 0 while rtio_input_timestamp(up_to_timestamp_mu + self.gate_latency_mu, self.channel) >= 0: count += 1 return count
@kernel
[docs] def timestamp_mu(self, up_to_timestamp_mu): """Return the timestamp of the next RTIO input event, or -1 if the hardware timestamp counter reaches the given value before an event is received. This function does not interact with the timeline cursor. See the gate_*() family of methods to select the input transitions that generate events, and :meth:count for usage examples. :param up_to_timestamp_mu: The timestamp up to which execution is blocked, that is, up to which input events are guaranteed to be taken into account. (Events with later timestamps might still be registered if they are already available.) :return: The timestamp (in machine units) of the first event received; -1 on timeout. """ return rtio_input_timestamp(up_to_timestamp_mu + self.gate_latency_mu, self.channel)
# Input API: sampling @kernel
[docs] def sample_input(self): """Instructs the RTIO core to read the value of the TTL input at the position of the time cursor. The time cursor is not modified by this function.""" rtio_output(self.target_sample, 0)
@kernel
[docs] def sample_get(self): """Returns the value of a sample previously obtained with :meth:sample_input. Multiple samples may be queued (using multiple calls to :meth:sample_input) into the RTIO FIFOs and subsequently read out using multiple calls to this function. This function does not interact with the time cursor.""" return rtio_input_data(self.channel)
@kernel
[docs] def sample_get_nonrt(self): """Convenience function that obtains the value of a sample at the position of the time cursor, breaks realtime, and returns the sample value.""" self.sample_input() r = self.sample_get() self.core.break_realtime() return r
# Input API: watching @kernel
[docs] def watch_stay_on(self): """Checks that the input is at a high level at the position of the time cursor and keep checking until :meth:watch_done is called. Returns True if the input is high. A call to this function must always be followed by an eventual call to :meth:watch_done (use e.g. a try/finally construct to ensure this). The time cursor is not modified by this function. """ rtio_output(self.target_sample, 2) # gate falling return rtio_input_data(self.channel) == 1
@kernel
[docs] def watch_stay_off(self): """Like :meth:watch_stay_on, but for low levels.""" rtio_output(self.target_sample, 1) # gate rising return rtio_input_data(self.channel) == 0
@kernel
[docs] def watch_done(self): """Stop watching the input at the position of the time cursor. Returns True if the input has not changed state while it was being watched. The time cursor is not modified by this function. This function always makes the slack negative. """ rtio_output(self.target_sens, 0) success = True try: while rtio_input_timestamp(now_mu() + self.gate_latency_mu, self.channel) != -1: success = False except RTIOOverflow: success = False return success
[docs]class TTLClockGen: """RTIO TTL clock generator driver. This should be used with TTL channels that have a clock generator built into the gateware (not compatible with regular TTL channels). The time cursor is not modified by any function in this class. :param channel: channel number :param acc_width: accumulator width in bits """ kernel_invariants = {"core", "channel", "target", "acc_width"} def __init__(self, dmgr, channel, acc_width=24, core_device="core"): self.core = dmgr.get(core_device) self.channel = channel self.target = channel << 8 self.acc_width = numpy.int64(acc_width) @portable
[docs] def frequency_to_ftw(self, frequency): """Returns the frequency tuning word corresponding to the given frequency. """ return round(2**self.acc_width*frequency*self.core.coarse_ref_period)
@portable
[docs] def ftw_to_frequency(self, ftw): """Returns the frequency corresponding to the given frequency tuning word. """ return ftw/self.core.coarse_ref_period/2**self.acc_width
@kernel
[docs] def set_mu(self, frequency): """Set the frequency of the clock, in machine units, at the current position of the time cursor. This also sets the phase, as the time of the first generated rising edge corresponds to the time of the call. The clock generator contains a 24-bit phase accumulator operating on the RTIO clock. At each RTIO clock tick, the frequency tuning word is added to the phase accumulator. The most significant bit of the phase accumulator is connected to the TTL line. Setting the frequency tuning word has the additional effect of setting the phase accumulator to 0x800000. Due to the way the clock generator operates, frequency tuning words that are not powers of two cause jitter of one RTIO clock cycle at the output.""" rtio_output(self.target, frequency)
@kernel
[docs] def set(self, frequency): """Like :meth:set_mu, but using Hz.""" self.set_mu(self.frequency_to_ftw(frequency))
@kernel
[docs] def stop(self): """Stop the toggling of the clock and set the output level to 0.""" self.set_mu(0)


text:
# Inverse Laplace Transform difficulty

I am asked to find the inverse Laplace transform of:

$$F(s)=\frac{2s^2+s+13}{(s-1)((s+1)^2+4)}$$

I did the partial fraction decomposition by hand and got:

$$F(s)=\frac{2}{s-1}-\frac{3}{(s+1)^2+4}$$

Mathematica's Apart command returned the same answer.

Apart[(2 s^2 + s + 13)/((s - 1) ((s + 1)^2 + 4))]

(* 2/(-1 + s) - 3/(5 + 2 s + s^2) *)

The answer can be written in the form:

$$F(s)=2\cdot\frac{1}{s-1}-\frac32\cdot\frac{2}{(s+1)^2+4}$$

I can then produce the inverse Laplace transform by hand:

$$f(t)=2e^t-\frac32e^{-t}\sin 2t$$

However, when I try to check my answer in Mathematica, I get the following response:

InverseLaplaceTransform[(2 s^2 + s + 13)/((s - 1) ((s + 1)^2 + 4)), s,
t]

(* 2 E^t + 3/4 I E^((-1 - 2 I) t) (-1 + E^(4 I t)) *)

2 E^t + 3/4 I E^((-1 - 2 I) t) (-1 + E^(4 I t)) ==
2 Exp[t] - 3/2*Exp[-t] Sin[2 t] // Simplify

(* True *)

But I am wondering how my hand calculated answer can be returned without the complex form.

InverseLaplaceTransform[(2 s^2 + s + 13)/((s - 1) ((s + 1)^2 + 4)), s, t]

2*E^t + (3/4)IE^((-1 - 2*I)t) (-1 + E^(4*I*t))

% // ComplexExpand // Simplify

2*E^t - (3*Cos[t]*Sin[t])/E^t

% // TrigReduce

((1/2)*(4*E^(2*t) - 3*Sin[2*t]))/E^t

In "one" step

InverseLaplaceTransform[(2 s^2 + s + 13)/((s - 1) ((s + 1)^2 + 4)), s, t] //
ComplexExpand // TrigReduce

((1/2)*(4*E^(2*t) - 3*Sin[2*t]))/E^t

• Works! Thanks for the nice answer. – David Apr 30 '15 at 19:52