text:
Angular Momentum

What is Angular Momentum?

Angular momentum, in physics, is a property that characterizes the rotatory inertia of an object in motion about the axis that may or may not pass through the specified object. The Earth’s rotation and revolution are the best real-life examples of angular momentum. For instance, the annual revolution that the Earth carries out about the Sun reflects orbital angular momentum and its everyday rotation about its axis shows spin angular momentum.

From this example, we can easily conclude that angular momentum is of two types -

1. Spin angular momentum. (eg- Rotation)

2. Orbital angular momentum. (eg- Revolution)

The total angular momentum of a body is the sum of spin and orbital angular momentum.

In another way, angular momentum is a vector quantity that requires both the magnitude and the direction. For an orbiting object, the magnitude of the angular momentum is equal to its linear momentum. It is given as the product of mass (m) and linear velocity (v) of the object multiplied by the distance (r) perpendicular to the direction of its motion, i.e., mvr. However, in the case of a spinning body, the angular momentum is the summation of mvr for all the particles making the object.

Some vital things to consider about angular momentum are:

• Symbol = As the angular momentum is a vector quantity, it is denoted by symbol L^

• Units = It is measured in SI base units: Kg.m2.s-1

• Dimensional formula = [M][L]2[T]-1

• Formula to calculate angular momentum (L) = mvr, where m = mass, v = velocity, and r = radius.

Angular Momentum Formula

The angular momentum of an object having mass (m) and linear velocity (v) with respect to a fixed point can be given as:

L = mvr sin θ

Or

→         →

L   = r x p (in terms of vector product)

Where,

L→= Angular Momentum

v = linear velocity of the object

m = mass of the object

p→ = linear momentum

r = radius, i.e., distance amid the object and the fixed point around which it revolves.

Moreover, angular momentum can also be formulated as the product of the moment of inertia (I) and the angular velocity (ω) of a rotating body. In this case, the angular momentum is derivable from the below expression:

→        →

L = I x ω

Where,

• L→is the angular momentum.

• I is the rotational inertia.

• ω is the angular velocity.

The direction of the angular momentum vector, in this case, is the same as the axis of rotation of the given object and is designated by the right-hand thumb rule.

Right-Hand Thumb Rule

The right-hand thumb rule gives the direction of angular momentum and states that if someone positions his/her hand in a way that the fingers come in the direction of r, then the fingers on that hand curl towards the direction of rotation, and thumb points towards the direction of angular momentum (L), angular velocity, and torque.

Angular Momentum and Torque

For a continuous rigid object, the total angular momentum is equal to the volume integral of angular momentum density over the entire object. Here, torque is defined as the rate of change of angular momentum. Torque is related to angular momentum in a way similar to how force is related to linear momentum. Now, when we know what the angular momentum and torque are, let's see how these two are related. To see this, we need to find out how objects in rotational motion get moving or spinning in the first position. Let's take the example of a wind turbine. We all know that it's the wind that makes the turbine spins. But how is it doing so? Well, the wind is pushing the turbine's blade by applying force to blades at some angles and radius from the axis of rotation of the turbine. In simple words, the wind is applying torque to the turbine. Hence, it is torque what gets rotatable objects spinning when they are standing still.  Moreover, if the torque is applied to an object which is already spinning in the same direction in which it is spinning, it upsurges its angular velocity. Hence, we can say that torque is directly proportional to the angular velocity of a rotating body. Since torque can change the angular velocity, it can also change the amount of angular momentum as the angular momentum depends on the product of the moment of inertia and angular velocity. This is how torque is related to angular momentum.

Consider a string is tied to a point mass. Now, if we apply torque on the same point mass, it would start rotating around the centre. Here, the particle of mass m would move with a perpendicular velocity V┴ to the radius r of the circle. Now, the magnitude of L→ will be:

L = rmv sin ϕ

= r p⊥

= rmv⊥

= r⊥p

= r⊥mv

Where,

• Φ is the angle formed between r→ and p→

• p⊥ and v⊥ are the segments of p→ and v→ perpendicular to r→ .

• r⊥ is the perpendicular distance between the extension of p→ and the fixed point.

Note: The equation or formula L = r⊥mv representing the angular momentum of an object changes only when you apply a net torque. Hence, if no torque is applied, then the perpendicular velocity of the object will alter according to the radius (the distance between the centre of the circle, and the centre of the mass of the body). It means velocity will be high for a shorter radius and low for a longer one.


text:
# Necklace problem with Burnside Lemma

Using Burnside lemma is complicated for me due to my lack of understanding of the lemma. I want to know the method step-by-step.

• There are other questions on this site where Burnside lemma has been explained in detail. Can you take one of them and apply to your problem? See math.stackexchange.com/questions/3810598/… as an example. – Math Lover Sep 15 '20 at 14:43
• I can apply the lemma with two colors of beads, but when it comes to three colors, I cannot trust my equations because every time I do, the answer keeps changing. – wormname Sep 15 '20 at 14:46
• Can you show one of your attempts? – Math Lover Sep 15 '20 at 14:49
• simply writing out all possibilities is a lot of work, but maybe you should start doing it anyway because often only in the process of doing something the stupid way you figure out a way to do it smarter. Don't let the fact that someone solved it more elegantly 100 years ago intimidate you - this is the type of problem you can solve yourself without any prior knowledge, which is much more satisfying and also more likely to help you with similar problems in the long run. – Vincent Sep 15 '20 at 15:18

We have $$\frac{8!}{2!2!4!} = 420$$ permutations of the eight beads. We will be arranging them around an 8-bead item, which means we need to use the dihedral group $$D_{16}$$ and its various actions.

There are seven conjugacy classes among the elements of this group, we'll consider them in turn.

• the identity action does nothing; all 420 possibilities remain unchanged under this action
• the single $$1/2$$ rotation steps everything around four beads. This keeps things of the form $$abcdabcd$$ unchanged, so neclackes like $$VVRGVVRG$$ or $$GVRVGVRV$$ count for this. There are 12 such necklaces.
• the two $$1/4$$ rotations steps everything around two beads; this action doesn't leave any entries unchanged, since they would have to be of the form $$abababab$$ and we only have two red beads.
• the two $$1/8$$ rotations steps everything around one bead; this action also does not leave any entries unchanged, since we have more than one color of bead.
• the two $$3/8$$ rotations steps everything around three beads; this action also also doesn't leave any entries unchanged, since we have more than one color of bead.
• the four reflections across a line through beads flips things back and forth so that two beads stay put. Necklaces of the form $$abcdedcb$$ remain unchanged through this; since we only have even counts of beads, $$a = e$$ must be true. We're left with 12 entries such as $$VRGVVVGR$$.
• the four reflections across a line between beads flips things back and forth so no beads stay put. These look like $$abcddcba$$, and there's 12 such entries, such as $$VRGVVGRV$$

Now, applying Burnside's Lemma, there are

$$\frac{1\cdot420 + 1\cdot12 + 2\cdot0 + 2\cdot0 + 2\cdot0 + 4\cdot12 + 4\cdot12}{1+1+2+2+2+4+4} = \frac{528}{16} = 33$$

distinct necklaces.

Presented below is the full list:

These 20 are completely asymmetrical:

GGRRVVVV GGRVRVVV GGRVVRVV
GGRVVVRV GGVRRVVV GGVRVRVV
GRGRVVVV GRGVRVVV GRRVGVVV
GRRVVGVV GRRVVVGV GRVGRVVV
GRVGVRVV GRVGVVRV GRVGVVVR
GRVRVGVV GRVRVVGV GRVVGVRV
GRVVRVGV GVGVRRVV

these six are fixed under a reflection that passes between beads:

GRVVVVRG GVRVVRVG GVVRRVVG
RGVVVVGR VRGVVGRV RVGVVGVR

these five are fixed under a reflection that passes through two beads:

RGVVRVVG VRGVVVGR GRVVGVVR
VVRGVGRV VGVRVRVG

Finally there is one that is fixed under rotation GRVVGRVV and one that is fixed under both rotation and through-reflection GVRVGVRV

We may as well deploy PET here since we need the cycle index $$Z(D_8)$$ of the dihedral group $$D_8$$ of order $$16$$ to apply Burnside. We compute and average the number of assignments of colors to the eight slots fixed by permutations from each conjugacy class in $$D_8$$, taking into account the order of the class. This means the assignment is constant on the cycles, so we can place exactly one color in the slots on a given cycle, substituing $$a_d$$ from the index with $$R^d + G^d + V^d,$$ which is PET.

Consulting the following fact sheet on necklaces and bracelets we get for the cycle index of the dihedral group $$D_8$$

$$Z(D_8) = \frac{1}{16} a_1^8 + \frac{1}{4} a_1^2 a_2^3 + \frac{5}{16} a_2^4 + \frac{1}{8} a_4^2 + \frac{1}{4} a_8.$$

We seek $$[R^2 G^2 V^4] Z(D_8; R+G+V).$$

Here we assume that the OP asks for the full symmetry i.e. dihedral, which means that the label to use is bracelet. Working through the five terns in the cycle index we obtain

• $$\frac{1}{16} a_1^8$$ $$[R^2 G^2 V^4] \frac{1}{16} (R+G+V)^8 = \frac{1}{16} {8\choose 2,2,4}$$
• $$\frac{1}{4} a_1^2 a_2^3$$ $$[R^2 G^2 V^4] \frac{1}{4} (R+G+V)^2 (R^2 + G^2 + V^2)^3 \\ = [R^2 G^2 V^4] \frac{1}{4} (R^2 + G^2 + V^2) (R^2 + G^2 + V^2)^3 \\ = [R^2 G^2 V^4] \frac{1}{4} (R^2 + G^2 + V^2)^4 \\ = [R G V^2] \frac{1}{4} (R + G + V)^4 = \frac{1}{4} {4\choose 2,1,1}.$$
• $$\frac{5}{16} a_2^4$$ $$[R^2 G^2 V^4] \frac{5}{16} (R^2 + G^2 + V^2)^4 = \frac{5}{16} {4\choose 2,1,1}.$$
• $$\frac{1}{8} a_4^2$$ $$[R^2 G^2 V^4] \frac{1}{8} (R^4 + G^4 + V^4)^2 = 0.$$
• $$\frac{1}{4} a_8$$ $$[R^2 G^2 V^4] \frac{1}{4} (R^8 + G^8 + V^8) = 0.$$

We thus get for our answer

$$\frac{1}{16} {8\choose 2,2,4} + \frac{9}{16} {4\choose 2,1,1} = \bbox[5px,border:2px solid #00A000]{33.}$$

format: plain


text:
Home > Number theory, Problem Solving > Frobenius Coin Problem

## Frobenius Coin Problem

I encountered a problem in the past few days which sounded like this:

What is the largest weight which cannot be obtained by using weights of 6, 10 and 15 units only?

This is a special case for a more general problem, namely, the Frobenius Coin Problem. This states that given $n$ types of coins having integer values $1 with $\gcd(a_1,a_2,...,a_n)=1$, which is the greatest sum of money that cannot be obtained by using the above type of coins. This number is denoted by $g(a_1,a_2,...,a_n)$.

The case $n=2$ is easy. The formula is $g(a,b)=ab-a-b$. For the case $n\geq 3$ we cannot find such a closed form for $g$. There exist some interesting algorithms, although, and a few theorems that can help us.

Theorem 1. If $a_1,a_2,a_3$ are relatively prime and $\gcd(a_1,a_2)=d$ then

$g(a_1,a_2,a_3)=d g(\frac{a_1}{d},\frac{a_2}{d},a_3)+(d-1)a_3$.

Note that if $a_3 > g(\frac{a_1}{d},\frac{a_2}{d})$ then $g(a_1,a_2,a_3)=d(a_1a_2-a_1-a_2)+(d-1)a_3$.

Theorem 2. Let $\gcd(a_1,a_2)=d$, $a_1=a_1'd,\ a_2=a_2'd$ such that there exist integers $x_1,x_2 \geq 0$ with $a_3=x_1a_1'+x_2a_2'$.  Then

$g(a_1,a_2,a_3)=\displaystyle\frac{a_1a_2}{d}-a_1-a_2+(d-1)a_3$.

For references and proofs see for example this book.
With each of the above formulas we get that $g(6,10,15)=29$.


text:
Fungrim entry: 107140

Symbol: IncompleteEllipticF $F\!\left(\phi, m\right)$ Legendre incomplete elliptic integral of the first kind
Definitions:
Fungrim symbol Notation Short description
IncompleteEllipticF$F\!\left(\phi, m\right)$ Legendre incomplete elliptic integral of the first kind
Source code for this entry:
Entry(ID("107140"),
SymbolDefinition(IncompleteEllipticF, IncompleteEllipticF(phi, m), "Legendre incomplete elliptic integral of the first kind"))

Topics using this entry

Copyright (C) Fredrik Johansson and contributors. Fungrim is provided under the MIT license. The source code is on GitHub.

2021-03-15 19:12:00.328586 UTC


text:
# 14.2: Dependence of Other Thermodynamic Functions on the Composition

Using the appropriate sets of independent variables, we can obtain similar expressions for $$dH$$, $$dA$$, $$dG$$, and $$dS$$ under the conditions that we assume in Section 14.1. Since entropy and pressure are the natural variables for enthalpy in a closed system, we infer that a change in the enthalpy of any system can be expressed as a function of $$dS$$, $$dP$$, changes in the non-pressure–volume work variables, $$d{\theta }_k$$, and changes in the composition, $${dn}_j$$. That is, from

$H=H\left(S,P,{\theta }_1\mathrm{,\ }{\theta }_2\mathrm{,\dots ,}{\theta }_{\lambda },n_1\mathrm{,\ }n_2\mathrm{,\dots ,}\ n_{\omega }\right)$

we have

\begin{aligned} dH= \left(\frac{\partial H}{\partial S}\right)_{P,{\theta }_m,n_j}dS & +\left(\frac{\partial H}{\partial P}\right)_{S,{\theta }_m,n_j}dP \\ ~ & +\sum^{\lambda }_{k=1} \left(\frac{\partial H}{\partial {\theta }_k}\right)_{S,P,{\theta }_{m\neq k},n_j}d{\theta }_k \\ ~ & +\sum^{\omega }_{j=1} \left(\frac{\partial H}{\partial n_j}\right)_{S,P,{\theta }_m,n_{p\neq j}}dn_j \end{aligned}

From $$H=E+PV$$, we have

$dH=dE+PdV+VdP$

for any system. Substituting our result from Section 14.1.

$dE=TdS-PdV+dw_{NPV}+\sum^{\omega }_{j=1} {\mu }_j dn_j$

where

${\mu }_j=\left(\frac{\partial E}{\partial n_j}\right)_{S,V,{\theta }_m,n_{p\neq j}}$

we have

$dH=TdS+VdP+dw_{NPV}+\sum^{\omega }_{j=1} {\mu }_j dn_j$

Since we assume that both of these equations for $$dH$$ describe open systems, all of the variables are independent, and the corresponding coefficients must be equal. For systems that satisfy our assumptions, we have

$T={\left(\frac{\partial H}{\partial S}\right)}_{P,{\theta }_m,n_j}$ $V={\left(\frac{\partial H}{\partial P}\right)}_{S,{\theta }_m,n_j}$ ${dw}_{NPV}=\sum^{\lambda }_{k=1}{{\left(\frac{\partial H}{\partial {\theta }_k}\right)}_{S,V,{\theta }_{m\neq k},n_j}d{\theta }_k}$ and

${\mu }_j={\left(\frac{\partial H}{\partial n_j}\right)}_{S,P,{\theta }_m,n_{p\neq j}}={\left(\frac{\partial E}{\partial n_j}\right)}_{S,V,{\theta }_m,n_{p\neq j}}$

By parallel arguments, we find

$dA=-SdT-PdV+dw_{NPV}+\sum^{\omega }_{j=1} {\mu }_j{dn}_j$

with

${\mu }_j= \left(\frac{\partial A}{\partial n_j}\right)_{T,V,{\theta }_m,n_{p\neq j}}$

and

$dG=-SdT+VdP+dw_{NPV}+\sum^{\omega }_{j=1} {\mu }_j{dn}_j$

with

${\mu }_j= \left(\frac{\partial G}{\partial n_j}\right)_{T,P,{\theta }_m,n_{p\neq j}}$

Rearranging the result for $$dE$$, we find

$dS=\frac{1}{T}dE+\frac{P}{T}dV-\frac{dw_{NPV}}{T}-\frac{1}{T}\sum^{\omega }_{j=1}{{\mu }_j{dn}_j}$

so that ${\mu }_j=-T{\left(\frac{\partial S}{\partial n_j}\right)}_{E,V,{\theta }_m,n_{p\neq j}}$

and from the result for $$dH$$, we have

$dS=\frac{1}{T}dH-\frac{V}{T}dP-\frac{dw_{NPV}}{T}-\frac{1}{T}\sum^{\omega }_{j=1}{{\mu }_j{dn}_j}$

so that ${\mu }_j=-T{\left(\frac{\partial S}{\partial n_j}\right)}_{H,P,{\theta }_m,n_{p\neq j}}$

Evidently, for any system whose condition corresponds to our assumptions, all of the relationships that we develop in Section 10.1 remain valid. The non-pressure–volume work can be expressed in terms of partial derivatives in several equivalent ways:

\begin{aligned} {dw}_{NPV} & =\sum^{\lambda }_{k=1}{{\left(\frac{\partial E}{\partial {\theta }_k}\right)}_{S,V,{\theta }_{m\neq k},n_j}d{\theta }_k} \\ ~ & =\sum^{\lambda }_{k=1}{{\left(\frac{\partial H}{\partial {\theta }_k}\right)}_{S,P,{\theta }_{m\neq k},n_j}d{\theta }_k} \\ ~ & =\sum^{\lambda }_{k=1}{{\left(\frac{\partial A}{\partial {\theta }_k}\right)}_{V,T,{\theta }_{m\neq k},n_j}d{\theta }_k} \\ ~ & =\sum^{\lambda }_{k=1}{{\left(\frac{\partial G}{\partial {\theta }_k}\right)}_{P,T,{\theta }_{m\neq k},n_j}d{\theta }_k} \\ ~ & =-T\sum^{\lambda }_{k=1}{{\left(\frac{\partial S}{\partial {\theta }_k}\right)}_{E,V,{\theta }_{m\neq k},n_j}d{\theta }_k} \\ ~ & =-T\sum^{\lambda }_{k=1}{{\left(\frac{\partial S}{\partial {\theta }_k}\right)}_{H,P,{\theta }_{m\neq k},n_j}d{\theta }_k} \end{aligned}

Most importantly, the chemical potential and the criteria for change can be expressed in several alternative ways. We have

\begin{aligned} {\mu }_j & ={\left(\frac{\partial E}{\partial n_j}\right)}_{S,V,{\theta }_m,n_{p\neq j}} & ={\left(\frac{\partial H}{\partial n_j}\right)}_{S,P,{\theta }_m,n_{p\neq j}} \\ ~ & ={\left(\frac{\partial A}{\partial n_j}\right)}_{V,T,{\theta }_m,n_{p\neq j}} & ={\left(\frac{\partial G}{\partial n_j}\right)}_{P,T,{\theta }_m,n_{p\neq j}} \\ ~ & =-T{\left(\frac{\partial S}{\partial n_j}\right)}_{E,V,{\theta }_m,n_{p\neq j}} & =-T{\left(\frac{\partial S}{\partial n_j}\right)}_{H,P,{\theta }_m,n_{p\neq j}} \end{aligned}

For any system, open or closed, that satisfies the assumptions we introduce in §1, the criteria for change are

$\sum^{\omega }_{j=1}{{\mu }_j{dn}_j}\le 0$

where the chemical potential is equivalently expressed as any of the partial derivatives above.

Let us review the scope and significance of these results. We develop the fundamental equation,$$\ dE=TdS-PdV+dw_{NPV}$$, by reasoning about the behavior of closed, reversible systems. For any process in a closed system, we develop the criteria for change

${\left(\Delta E\right)}_{SV}\le w_{NPV}$ ${\left(\Delta H\right)}_{SP}\le w_{NPV}$ ${\left(\Delta A\right)}_{VT}\le w_{NPV}$ ${\left(\Delta G\right)}_{PT}\le w_{NPV}$ ${\left(\Delta S\right)}_{EV}\ge {-w_{NPV}}/{\hat{T}}$ ${\left(\Delta S\right)}_{HP}\ge {-w_{NPV}}/{\hat{T}}$

and the corresponding relationships among differentials for incremental changes. Now we are extending these conclusions to produce equations for the changes in the various thermodynamic functions when a system undergoes a spontaneous composition change. To do so, we introduce the idea that composition variables must be included in a complete model for a thermodynamic function. When we write

$E=E\left(S,V,{\theta }_1\mathrm{,\ }{\theta }_2\mathrm{,\dots ,}{\theta }_{\lambda },n_1\mathrm{,\ }n_2\mathrm{,\dots ,}\ n_{\omega }\right)$

we assert that every set of values, $$\left\{S,V,{\theta }_1\mathrm{,\ }{\theta }_2\mathrm{,\dots ,}{\theta }_{\lambda },n_1\mathrm{,\ }n_2\mathrm{,\dots ,}\ n_{\omega }\right\}$$, corresponds to a state of the system in which the system has a definite energy. (Of course, we are not asserting that every such set of values can actually be attained by the real system. Many such sets correspond to hypothetical states. The particular sets of values that do correspond to realizable states of the system lie on a manifold. Given one such set of values—one point on the manifold—our differential expressions specify all of the other states that lie on the same manifold.)

When we assume that the various partial derivatives, $${\left({\partial E}/{\partial S}\right)}_{V,{\theta }_k,n_j}$$, $${\left({\partial E}/{\partial V}\right)}_{S,{\theta }_k,n_j}$$, $${\left({\partial E}/{\partial {\theta }_k}\right)}_{S,V{\theta }_{m\mathrm{\neq }k},n_j}$$, and $${\left({\partial E}/{\partial n_j}\right)}_{S,V,{\theta }_k,n_{p\mathrm{\neq }j}}$$, exist, we are assuming that $$E$$ is a smooth, continuous function of each of these variables. Since some of these partial derivatives are synonymous with intensive variables, we are assuming that these intensive variables are well defined. Moreover, since these intensive variables characterize the system as a whole, we are assuming that each intensive variable has the same value in every part of the system$${}^{1}$$. When we assume that $${\mu }_j = {\left({\partial E}/{\partial n_j}\right)}_{S,V,{\theta }_m,n_{p\mathrm{\neq }j}}$$ has a well-defined value, we are assuming that $$E$$ is a continuous function of $$n_j$$; we are assuming that $${\mu }_j$$ exists for any arbitrary state of the system and not just for states undergoing reversible change.

When we assume that an arbitrary change is described by the total differential $$dE=TdS-PdV+dw_{NPV}+\sum^{\omega }_{j=1}{{\mu }_j{dn}_j}$$, we are going beyond our conclusion that this total differential describes paths of reversible change. We are asserting that it describes any process in which a change in composition is the sole source of irreversibility. As a practical matter, we expect it to describe any process that occurs in a system whose potential functions are well defined. By well defined, we mean, of course, that that they can be measured and that the measurements are reproducible and consistent. We expect these conclusions to apply to multiple-phase, open systems, so long as each potential has the same value in every phase. In thus assuming that we can expand the scope of the fundamental equation, we are not modifying the change criteria that we develop in Chapter 9. Our conclusions that $${\left(dE\right)}_{SV}={dw}_{NPV}$$ for a reversible process and $${\left(dE\right)}_{SV}<{dw}_{NPV}$$ for a spontaneous process in a closed system are not affected.

Again, while our arguments for them are compelling, these results are not rigorously logical consequences of our earlier conclusions about reversible processes. As for any scientific principle, their validity depends on their predictive capability, not their provenance.

This page titled 14.2: Dependence of Other Thermodynamic Functions on the Composition is shared under a CC BY-SA 4.0 license and was authored, remixed, and/or curated by Paul Ellgen via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.


text:
# Least energy solutions to a cooperative system of Schrödinger equations with prescribed $L^2$-bounds: at least $L^2$-critical growth

Mederski, Jarosław; Schino, Jacopo

##### Abstract:
We look for least energy solutions to the cooperative systems of coupled Schrödinger equations
$$\left\{\begin{array}{l} -\Delta u_i+\lambda_i u_i = \partial_i G(u) \quad\text{in }\mathbb{R}^N,\ N\ge3, \\ u_i\in H^1(\mathbb{R}^N), & & \\ \textstyle\int_{\mathbb{R}^N}|u_i|^2\,dx\le \rho_i^2 \end{array} i\in\{1,\ldots,K\}\right.$$
with $G\ge0$, where $\rho_i>0$ is prescribed and $(\lambda_i,u_i)\in\mathbb{R}\times H^1(\mathbb{R}^N)$ is to be determined, $i\in\{1,\ldots,K\}$. Our approach is based on the minimization of the energy functional over a linear combination of the Nehari and Pohožaev constraints intersected with the product of the closed balls in $L^2(\mathbb{R}^N)$ of radii $\rho_i$, which allows to provide general growth assumptions on $G$ and to know in advance the sign of the corresponding Lagrange multipliers. We assume that $G$ has at least $L^2$-critical growth at $0$ and Sobolev subcritical growth at infinity. The more assumptions we make on $G$, $N$, and $K$, the more can be said about the minimizers of the energy functional. In particular, if $K=2$, $N\in\{3,4\}$, and $G$ satisfies further assumptions,
... mehr

 Zugehörige Institution(en) am KIT Institut für Analysis (IANA) Publikationstyp Forschungsbericht/Preprint Publikationsmonat/-jahr 01.2021 Sprache Englisch Identifikator ISSN: 2365-662X KITopen-ID: 1000128442 Verlag Karlsruher Institut für Technologie (KIT) Umfang 20 S. Serie CRC 1173 Preprint ; 2021/1 Projektinformation SFB 1173/2 (DFG, DFG KOORD, SFB 1173/2 2019) Externe Relationen Siehe auch Schlagwörter cooperative system, nonlinear Schrödinger equations, ground states, normalized solutions
KIT – Die Forschungsuniversität in der Helmholtz-Gemeinschaft
KITopen Landing Page


text:
# Problem: Write balanced equation for the following by inserting the correct coefficients in the blanks:(a) __Cu(NO3)2(aq) + __KOH(aq) ⟶__Cu(OH)2(s) + __KNO3(aq)

⚠Our tutors found the solution shown to be helpful for the problem you're searching for. We don't have the exact solution yet.

###### Problem Details

Write balanced equation for the following by inserting the correct coefficients in the blanks:

(a) __Cu(NO3)2(aq) + __KOH(aq) ⟶__Cu(OH)2(s) + __KNO3(aq)


text:
# 3. Tensor basics

## 3.1. Creating a tensor

A tensor is nothing more than a multi-dimensional array.

Let’s take for this example the tensor $$\tilde X$$ defined by its frontal slices:

\begin{align}\begin{aligned}\begin{split}X_1 = \left[ \begin{matrix} 0 & 2 & 4 & 6\\ 8 & 10 & 12 & 14\\ 16 & 18 & 20 & 22\\ \end{matrix} \right]\end{split}\\\text{and}\\\begin{split}X_2 = \left[ \begin{matrix} 1 & 3 & 5 & 7\\ 9 & 11 & 13 & 15\\ 17 & 19 & 21 & 23\\ \end{matrix} \right]\end{split}\end{aligned}\end{align}

In Python, this array can be expressed as a numpy array:

>>> import numpy as np
>>> import tensorly as tl
>>> X = tl.tensor(np.arange(24).reshape((3, 4, 2)))

You can view the frontal slices by fixing the last axis:

>>> X[..., 0]
array([[ 0,  2,  4,  6],
[ 8, 10, 12, 14],
[16, 18, 20, 22]])

>>> X[..., 1]
array([[ 1,  3,  5,  7],
[ 9, 11, 13, 15],
[17, 19, 21, 23]])

## 3.2. Unfolding

Also called matrization, unfolding a tensor is done by reading the element in a given way as to obtain a matrix instead of a tensor.

For a tensor of size $$(I_0, I_1, \cdots, I_N)$$, the n-mode unfolding of this tensor will be of size $$(I_n, I_0, I_1 \times \cdots \times I_{n-1} \times I_{n+1} \cdots \times I_N)$$.

Important

In tensorly we use an unfolding different from the classical one as defined in 1 for better performance.

Given a tensor $$\tilde X \in \mathbb{R}^{I_0, I_1 \times I_2 \times \cdots \times I_N}$$, the mode-n unfolding of $$\tilde X$$ is a matrix $$\mathbf{X}_{[n]} \in \mathbb{R}^{I_n, I_M}$$, with $$M = \prod_{\substack{k=0,\\k \neq n}}^N I_k$$ and is defined by the mapping from element $$(i_0, i_1, \cdots, i_N)$$ to $$(i_n, j)$$, with

$\begin{split}j = \sum_{\substack{k=0,\\k \neq n}}^N i_k \times \prod_{\substack{m=k+1,\\ k \neq n}}^N I_m.\end{split}$

Warning

Traditionally, mode-1 unfolding denotes the unfolding along the first dimension. However, to be consistent with the Python indexing that always starts at zero, in tensorly, unfolding also starts at zero!

Therefore unfold(tensor, 0) will unfold said tensor along its first dimension!

For instance, using the $$\tilde X$$ previously defined, the 0-mode unfolding of $$\tilde X$$:

$\begin{split}\tilde X_{[0]} = \left[ \begin{matrix} 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7\\ 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15\\ 16 & 17 & 18 & 19 & 20 & 21 & 22 & 23\\ \end{matrix} \right]\end{split}$

The 1-mode unfolding is given by:

$\begin{split}\tilde X_{[1]} = \left[ \begin{matrix} 0 & 1 & 8 & 9 & 16 & 17\\ 2 & 3 & 10 & 11 & 18 & 19\\ 4 & 5 & 12 & 13 & 20 & 21\\ 6 & 7 & 14 & 15 & 22 & 23\\ \end{matrix} \right]\end{split}$

Finally, the 2-mode unfolding is the unfolding along the last axis:

$\begin{split}\tilde X_{[2]} = \left[ \begin{matrix} 0 & 2 & 4 & 6 & 8 & 10 & 12 & 14 & 16 & 18 & 20 & 22\\ 1 & 3 & 5 & 7 & 9 & 11 & 13 & 15 & 17 & 19 & 21 & 23\\ \end{matrix} \right]\end{split}$

In tensorly:

>>> from tensorly import unfold
>>> unfold(X, 0) # mode-1 unfolding
array([[ 0,  1,  2,  3,  4,  5,  6,  7],
[ 8,  9, 10, 11, 12, 13, 14, 15],
[16, 17, 18, 19, 20, 21, 22, 23]])

>>> unfold(X, 1) # mode-2 unfolding
array([[ 0,  1,  8,  9, 16, 17],
[ 2,  3, 10, 11, 18, 19],
[ 4,  5, 12, 13, 20, 21],
[ 6,  7, 14, 15, 22, 23]])

>>> unfold(X, 2) # mode-3 unfolding
array([[ 0,  2,  4,  6,  8, 10, 12, 14, 16, 18, 20, 22],
[ 1,  3,  5,  7,  9, 11, 13, 15, 17, 19, 21, 23]])

## 3.3. Folding

You can fold an unfolded tensor back from matrix to full tensor using the tensorly.base.fold function.

>>> from tensorly import fold
>>> unfolding = unfold(X, 1)
>>> original_shape = X.shape
>>> fold(unfolding, 1, original_shape)
array([[[ 0,  1],
[ 2,  3],
[ 4,  5],
[ 6,  7]],

[[ 8,  9],
[10, 11],
[12, 13],
[14, 15]],

[[16, 17],
[18, 19],
[20, 21],
[22, 23]]])

## 3.4. References

1

T.G.Kolda and B.W.Bader, “Tensor Decompositions and Applications”, SIAM REVIEW, vol. 51, n. 3, pp. 455-500, 2009.


text:
## Other Measures

Net Fixed Assets is used in the ROIC calculation used in the Greenblatt Magic Formula. It calculates the amount of cash needed to purchase fixed assets necessary to conduct its business, such as real estate, plant and equipment. Greenblatt removes intangible assets, and specifically goodwill, which usually arises from an acquisition of a company. These are historical costs and should this does not need to be constantly replaced.

$Net Fixed Assets = Net Property, Plant & Equipment$


text:
April 14, 2016

## Overview

1. Background on the development of super learner and targeted learning
2. Theory behind the super learner algorithm
3. Application of super learner in R
4. Some (hopefully) helpful comments on utilizing super learner

This presentation, the data (with documentation) and R code is available at: https://github.com/sfgrey/Super-Learner-Presentation.git

## Background

"Essentially, all models are wrong, but some are useful"
- George Box, 1979

Mantra of statisticians regarding the development of statistical models for many years

In the 1990s an awareness developed among statisticians (Breiman, Harrell) that this approach was wrong

• Parametric model assumptions rarely met
• Large number of variables makes it difficult to correctly specify a model

Simultaneously, computer scientists and some statisticians developed the machine learning field to address the limitations of parametric models

## Targeted learning

Combines advanced machine learning with efficient semiparametric estimation to provide a framework for answering causal questions from data

• Developed by Mark van der Laan research group at UC Berkeley
• Started with the seminal 2006 article on targeted maximum likelihood estimation

Central motivation is the belief that statisticians treat estimation as Art not Science

• This results in misspecified models that are data-adaptively selected, but this part of the estimation procedure is not accounted for in the variance

## Estimation is a Science, Not an Art

### Specific definitions required

1. Data: realizations of random variables with a probability distribution
2. Model: actual knowledge about the data generating probability distribution
3. Target Parameter: a feature of the data generating probability distribution
4. Estimator: an a priori-specified algorithm, benchmarked by a dissimilarity-measure (e.g., MSE) w.r.t. target parameter

## Data

Random variable $$O$$, observed $$n$$ times, defined in a simple case as $O=\left(A,W,Y\right)\sim {P}_{0}$ if we are without common issues such as missingness and censoring

• $$A$$: exposure or treatment
• $$W$$: vector of covariates
• $$Y$$: outcome
• ${P}_{0}$: the true probability distribution

This data structure makes for an effective example, but data structures found in practice are much more complicated

## Model

General case: Observe $$n$$ i.i.d. copies of random variable $$O$$ with probability distribution ${P}_{0}$

The data-generating distribution ${P}_{0}$ is also known to be an element of a statistical model $M:{P}_{0}\in M$

A statistical model $$M$$ is the set of possible probability distributions for ${P}_{0}$; it is a collection of probability distributions

If all we know is that we have $$n$$ i.i.d. copies of $$O$$, this can be our statistical model, which we call a non-parametric statistical model

## Target Parameters

Define the parameter of the probability distribution $$P$$ as function of $P:\Psi \left(P\right)$

In a causal inference (specificly the Neyman-Rubin) framework, a target parameter for the effect of $$A$$ would be
$\Psi \left({P}_{0}\right)={E}_{W,0}\left[{E}_{0}\left(Y|A=1,W\right)-{E}_{0}\left(Y|A=0,W\right)\right]$

Note that this requires additional, nontestable assumptions to infer causality

• $\left(A\perp {Y}_{a}|W\right)$ ; SUTVA; Positivity

• Does not change the statistical model $$M$$

## Estimators

The target parameter $\Psi \left({P}_{0}\right)$ depends on ${P}_{0}$ through the conditional mean ${\overline{Q}}_{0}\left(A,W\right)={E}_{0}\left(Y|A,W\right)$ and the marginal distribution ${Q}_{W,0}$ of $$W$$; or

$\overline{Q}\left(A,W\right)=E\left(Y|A,W\right)/\overline{Q}\left(W\right)=E\left(Y|W\right)$

Where $\overline{Q}$ is an estimator of ${\overline{Q}}_{0}\left(A,W\right)$, shortened to ${\overline{Q}}_{0}$

An estimator is an algorithm that can be applied to any empirical distribution to provide a mapping from the empirical distribution to the parameter space

• But which algorithm?

## Effect Estimation vs. Prediction

Both effect and prediction research questions are inherently estimation questions, but they are distinct in their goals

• Prediction: Interested in generating a function to input covariates and predict a value for the outcome: ${E}_{0}\left(Y|W\right)$
• Effect: Interested in estimating the true effect of exposure on outcome adjusted for covariates, $\Psi \left({P}_{0}\right)$, the targeted estimand
• Targeted maximum likelihood estimation (TMLE), is an iterative procedure that updates an initial (super learner) estimate of the relevant part ${\overline{Q}}_{0}$ of the data generating distribution ${P}_{0}$
• See second presentation given on April 12 to the Ann Arbor ASA Chapter

## Prediction: Key Concepts

1. Loss-based estimation: Use loss functions to define best estimator of ${E}_{0}\left(Y|W\right)$ & evaluate it

2. Flexible Estimation: Allow data to drive your estimates, but in an honest (cross validated) way

3. Cross Validation: Available data is partitioned to train and validate our estimators

These are detailed topics; we'll cover core concepts

## Loss-Based Estimation

In order to choose a "best" algorithm to estimate ${\overline{Q}}_{0}$, must have a way to define what "best" means

Given the data structure is $O=\left(W,Y\right)\sim {P}_{0}$, with empirical distribution ${P}_{n}$ which places probability $$1/n$$ on each observed ${O}_{i}$, $$i=1,...,n$$

A loss function, $L\left(O,\overline{Q}\right)$, assigns a measure of performance to a candidate function $\overline{Q}$ when applied to an observation $$O$$

One of the most commonly used loss functions is the $$L2$$ squared error (or quadratic) loss function:

$L\left(O,\overline{Q}\right)={\left(Y-\overline{Q}\left(W\right)\right)}^{2}$

## The Parameter of Interest

We define our parameter of interest, ${\overline{Q}}_{0}={E}_{0}\left(Y|W\right)$ , as the minimizer of the expected squared error loss:

${\overline{Q}}_{0}=\mathrm{arg}{\mathrm{min}}_{\overline{Q}}{E}_{0}L\left(O,\overline{Q}\right)$

${E}_{0}L\left(O,\overline{Q}\right)$, which we want to be small, evaluates the candidate $\overline{Q}$, and it is minimized at the optimal choice of ${\overline{Q}}_{0}$

We refer to expected loss as the risk

We want estimator that minimizes the expectation of the squared error loss function; we want an estimator that has small bias and variance

## Flexible Estimation

The Super Learner algorithm finds the combination of algorithms minimizing the cross-validated risk

For a given problem, a "library" of candidate prediction algorithms can be proposed

• Recommend using a diverse set of learners (Linear Model, Support Vector Machine, Random Forest, Neural Net, etc.)
• Multi-step algorithm involving screening covariates and optimizing tuning parameters
• As long as the algorithm takes the observed $$W$$ and outputs a predicted $$Y$$

No need to decide beforehand which algorithm to use; can use several by incorporating cross-validation

## Cross-Validation

Consider a candidate library of $$C$$ prediction algorithms $\left\{{\overline{Q}}_{1},\dots ,{\overline{Q}}_{C}\right\}$

In V-fold cross-validation, the observed data ${O}_{i}$, $$i=1,...,n$$, is referred to as the learning set and is partitioned into $$V$$ sets of size $\approx n/V$

For any given fold, $$V-1$$ sets comprise a training set and remaining 1 set is a validation set

For each candidate algorithm in $$C$$, V-fold cross-validation is used to generate $$n$$ cross-validated predicted values associated with the $$C^{th}$$ learner, the results are stored in a $n×C$ matrix, $$Z$$

## Super Learner: Ensembling

Super Learner is a "generalized stacking" ensemble learning technique

• A second-level learner, or a metalearner
• It is trained with $$Z$$, the cross-validated predicted values from each candidate algorithm
• Used as inputs in a working statistical model to predict the original $$Y$$
• Use the least squares algorithm to solve for $\left({\alpha }_{1},\dots ,{\alpha }_{C}\right)$, the weight vector that minimizes ${\sum _{i=1}^{n}\left({Y}_{i}-\sum _{c=1}^{C}{\alpha }_{c}{z}_{ci}\right)}^{2}$

## Super Learner: Ensembling

Super Learner is an oracle selector, defined as the estimator, among all possible weighted combinations of the $$C$$ prediction functions, that minimizes risk under the true data-generating distribution

• Thus, by adding more competitors, we only improve the performance of the super learner
• The asymptotic equivalence remains true if the number of algorithms in the library grows very quickly with sample size

## The SuperLearner R Package

### Created by Eric Polley, National Cancer Institute

Table: Main functions in the SuperLearner package

## CV SuperLearner

pm1 <- CV.SuperLearner(Y=Y,
x=x,
V=10,
family=binomial(),
SL.library=SL.library,
method="method.NNLS",
verbose = TRUE,
control = list(saveFitLibrary = TRUE),
cvControl = list(V=10), saveAll = TRUE,
parallel = 'multicore')

## SuperLearner Arguments

Required:

• Y - The outcome
• X - The covariates
• V - The number of folds for the metalearner
• family - 'gaussian' or 'binomial' to describe the error distribution
• SL.library - a character vector or a list of prediction algorithms
• method - Method used by metalearner to combine the individual algorithms. The default is non-negative least squares

## SuperLearner Arguments

Optional:

• verbose - helpful to set this to TRUE to see the progress of the estimation
• control - Parameters to control the estimation process, like saving the fit for each algorithm
• cvControl - controls the cross-validation process of the individual prediction algorithms, i.e. the number of splits for the V-fold cross-validation
• parallel - Options for parallel computation of the V-fold step
Can be platform specfic!

## Canidate algorithms in SuperLearner

There are two types of candidate algorithms that can be used in SL.library:

1. Prediction algorithms: Algorithms that take as input X and Y and return a predicted $$Y$$ value
2. Screening algorithms: Algorithms designed to reduce the dimension of $$X$$. They take as input X and Y and return a logical vector indicating the columns in X passing the screening

Screening algorithms can be coupled with prediction algorithms to form new prediction algorithms

## Canidate algorithms in SuperLearner

There are two ways to specify the algorithms in SL.library:

1. A character vector:
c("SL.glm", "SL.glmnet"", "SL.gam")
2. A list of character vectors:
list(c("SL.glm", "screen.corP"), "SL.gam")

If only using prediction algorithms, easier to use the first method. If using screening algorithms, the list is required

• Prediction algorithm listed first, followed by the screening algorithms
• Multiple screening algorithms can be used

## Prediction algorithm wrappers in SuperLearner

listWrappers(what = "SL")
## All prediction algorithm wrappers in SuperLearner:
##  [1] "SL.bayesglm"         "SL.caret"            "SL.caret.rpart"
##  [4] "SL.cforest"          "SL.earth"            "SL.gam"
##  [7] "SL.gbm"              "SL.glm"              "SL.glm.interaction"
## [10] "SL.glmnet"           "SL.ipredbagg"        "SL.knn"
## [13] "SL.leekasso"         "SL.loess"            "SL.logreg"
## [16] "SL.mean"             "SL.nnet"             "SL.nnls"
## [19] "SL.polymars"         "SL.randomForest"     "SL.ridge"
## [22] "SL.rpart"            "SL.rpartPrune"       "SL.step"
## [25] "SL.step.forward"     "SL.step.interaction" "SL.stepAIC"
## [28] "SL.svm"              "SL.template"

## Screening algorithm wrappers in SuperLearner

listWrappers(what = "screen")
## All screening algorithm wrappers in SuperLearner:
## [1] "All"
## [1] "screen.corP"           "screen.corRank"        "screen.glmnet"
## [4] "screen.randomForest"   "screen.SIS"            "screen.template"
## [7] "screen.ttest"          "write.screen.template"

## Examining a wrapper function

SL.glmnet
## function (Y, X, newX, family, obsWeights, id, alpha = 1, nfolds = 10,
##     nlambda = 100, useMin = TRUE, ...)
## {
##     .SL.require("glmnet")
##     if (!is.matrix(X)) {
##         X <- model.matrix(~-1 + ., X)
##         newX <- model.matrix(~-1 + ., newX)
##     }
##     fitCV <- glmnet::cv.glmnet(x = X, y = Y, weights = obsWeights,
##         lambda = NULL, type.measure = "deviance", nfolds = nfolds,
##         family = family$family, alpha = alpha, nlambda = nlambda) ## pred <- predict(fitCV$glmnet.fit, newx = newX, s = ifelse(useMin,
##         fitCV$lambda.min, fitCV$lambda.1se), type = "response")
##     fit <- list(object = fitCV, useMin = useMin)
##     class(fit) <- "SL.glmnet"
##     out <- list(pred = pred, fit = fit)
##     return(out)
## }
## <environment: namespace:SuperLearner>

## Creating your own wrappers

Many algorithms are included in the package, but you may want to create your own

A few reasons to build your own wrappers:

• Want to use an algorithm not currently included
• Want to include a range of tuning parameters, not just the default
• Force variables to be used in chunk-wise fashion

## Example

### Creating your own wrapper to alter a tuning parameter

glmnet algorithm evaluates elastic net (penalized regression) models

The alpha tuning parameter controls the amount of shrinkage to estimated coefficients the algorithm applies, 1=LASSO, 0=Ridge

As SL.ridge wrapper doesn’t handle binary variables, need to modify the wrapper to utilize various penalized regression models

SL.glmnet.0 <- function(..., alpha = 0){
SL.glmnet(..., alpha = alpha)
} # ridge penalty

## Important notes for creating prediction wrappers

• Input must following naming syntax: Y, X, …
• Name of new function must be different than one already in the package
• Must return a list with 2 elements named pred and fit
• pred must be a vector with the predicted $$Y$$ values
• fit can be anything if not using predict method, otherwise is a list with elements needed for predict

## SuperLearner example

### Predicting 30 day mortality for patients admitted to an ICU

The ARF dataset has 2490 observations and 47 variables including:

• Demographic characteristics, including age, gender, weight and race
• Patient medical history, 12 dichotomous variables for medicial conditions: MI, COPD, stroke, cancer, etc.
• Current condition variables, that provide information about the patient's current health status: three diagnostic scales, vital statistics and current disease status

Can we build a good prediction model of 30 day mortality?

Only works with numeric matrices; can be specified in-line, i.e. Y= dataset$Y Data must be preprocessed: • Can only handle missingness in the outcome Y, X must be removed/imputed • Continuous variables must be appropriately re-scaled • Categorical variables must be appropriately dummy coded ## Preparing data for SuperLearner # Impute missing X values # library("VIM") # Scale cont vars # library(arm) cont <- c("age","edu","das2d3pc","aps1","scoma1","meanbp1","wblc1","hrt1", "resp1","temp1","pafi1","alb1","hema1","bili1","crea1","sod1", "pot1","paco21","ph1","wtkilo1") arf[,cont] <- data.frame(apply(arf[cont], 2, function(x) {x <- rescale(x, "full")})); rm(cont) # standardizes by centering and # dividing by 2 sd # Create dummy vars # arf$rhc <- ifelse(arf$swang1=="RHC",1,0) arf$white <- ifelse(arf$race=="white",1,0) arf$swang1 <- arf$race <- NULL ## Prepare SuperLearner # Specify new SL prediction algorithm wrappers # SL.glmnet.0 <- function(..., alpha = 0){ SL.glmnet(..., alpha = alpha) } # ridge penalty # Specify the SL library with prediction algorithms # SL.library <- c("SL.glm","SL.bayesglm","SL.earth","SL.gam","SL.glmnet", "SL.glmnet.0","SL.knn","SL.step","SL.nnet") ## Run SuperLearner prediction model system.time({ pm1 <- CV.SuperLearner(Y=arf$death,
X=arf[1:45],
V=10, family=binomial(),
SL.library=SL.library,
method="method.NNLS",
verbose = TRUE,
control = list(saveFitLibrary = TRUE),
cvControl = list(V=10), saveAll = TRUE,
parallel = 'multicore')

})[[3]] # Obtain computation time

## Elements of the output from SuperLearner

• libraryNames - names of algorithms in library
• library.predict - matrix of predicted values for Y from each algorithm
• SL.predict - vector of CV super learner predicted values for Y
• whichDiscreteSL - best algorithm for each V-fold
• coef - weights $$\alpha$$ for each algorithm for each V-fold
• summary() - Mean Squared Error (Risk) for each algorithm as well as super learner

## Evaluate SuperLearner prediction model

summary(pm1)
       Algorithm     Ave        se     Min     Max
Super Learner 0.17589 0.0041358 0.14915 0.19025
Discrete SL 0.17819 0.0041751 0.14712 0.19527
SL.glm_All 0.17927 0.0043446 0.15028 0.19577
SL.bayesglm_All 0.17917 0.0043353 0.15014 0.19556
SL.earth_All 0.18445 0.0046916 0.16056 0.20049
SL.gam_All 0.17726 0.0043339 0.15272 0.19527
SL.glmnet_All 0.17758 0.0040714 0.14712 0.19076
SL.glmnet.0_All 0.17827 0.0040792 0.14984 0.19323
SL.knn_All 0.19507 0.0046476 0.16739 0.20378
SL.step_All 0.17776 0.0042912 0.14986 0.19306
SL.nnet_All 0.24231 0.0071828 0.18667 0.31727
plot(pm1, packag ="ggplot2")

## Best algorithm for each V-fold

pm1$whichDiscreteSL ##$1
## [1] "SL.gam_All"
##
## $2 ## [1] "SL.glmnet_All" ## ##$3
## [1] "SL.glmnet_All"
##
## $4 ## [1] "SL.step_All" ## ##$5
## [1] "SL.glmnet_All"
##
## $6 ## [1] "SL.step_All" ## ##$7
## [1] "SL.glmnet_All"
##
## $8 ## [1] "SL.glmnet_All" ## ##$9
## [1] "SL.glmnet_All"
##
##                 colMeans(pm1$coef) ## SL.glm_All 0.000000000 ## SL.bayesglm_All 0.000000000 ## SL.earth_All 0.182184626 ## SL.gam_All 0.238533673 ## SL.glmnet_All 0.124057556 ## SL.glmnet.0_All 0.000000000 ## SL.knn_All 0.187070857 ## SL.step_All 0.261432008 ## SL.nnet_All 0.006721281 ## Plot of AUROC curves for each algorithm ## Table of AUROC curves for each algorithm ## freqta ## SL.glm_All 0.731 (0.709-0.752) ## SL.bayesglm_All 0.731 (0.709-0.752) ## SL.earth_All 0.722 (0.7-0.744) ## SL.gam_All 0.738 (0.717-0.759) ## SL.glmnet_All 0.736 (0.714-0.757) ## SL.glmnet.0_All 0.733 (0.711-0.754) ## SL.knn_All 0.677 (0.654-0.699) ## SL.step_All 0.735 (0.714-0.757) ## SL.nnet_All 0.572 (0.547-0.596) ## SL.predict 0.743 (0.722-0.764) ## Run SuperLearner prediction model with variable screening algorithms • Suppose you wish to limit the number of variables entered into the prediction model • Specifically, you think that the 12 medical history variables aren’t helpful • Can generate a screening algorithm to exclude those variables: screen.nohx <- function(...){ return(c(rep(FALSE,12), rep(TRUE,33))) } ## Specify the SL library with prediction and variable screening algorithms Note that I’m only including one prediction model (generalize additive model) for demonstration purposes SL.library2 <- list(c("SL.gam","All","screen.nohx","screen.glmnet")) system.time({ pm2 <- CV.SuperLearner(Y=arf$death,
X=arf[1:45],
V=10, family=binomial(),
SL.library=SL.library2,
method="method.NNLS",
verbose = TRUE,
control = list(saveFitLibrary = TRUE),
cvControl = list(V=10), saveAll = TRUE,
parallel = 'multicore')

})[[3]]

## Results

summary(pm2)
Risk is based on: Mean Squared Error

All risk estimates are based on V =  10

Algorithm     Ave        se     Min     Max
Super Learner 0.17643 0.0042621 0.15968 0.19481
Discrete SL 0.17730 0.0043219 0.15640 0.19587
SL.gam_All 0.17710 0.0043222 0.16020 0.19479
SL.gam_screen.nohx 0.17762 0.0042853 0.16224 0.19560
SL.gam_screen.glmnet 0.17666 0.0042918 0.15640 0.19587
# Examine vars in best algorithm
out = c()
for(j in 1:10){
out = c(out,names(pm2[["AllSL"]][[j]][["fitLibrary"]][[3]][[1]][["coefficients"]]))
}
table(out); rm(out,j)
out
(Intercept)          amihx          chfhx           dnr1         Female
10              1              3             10             10
gastr       gibledhx           hema        liverhx        malighx
7              4             10             10             10
meta          neuro        psychhx        renalhx           resp
3              7              7              1              3
rhc      s(age, 2)     s(alb1, 2)     s(aps1, 2)    s(bili1, 2)
10             10             10             10             10
s(crea1, 2) s(das2d3pc, 2)      s(edu, 2)    s(hema1, 2)     s(hrt1, 2)
7             10              4              2              4
s(meanbp1, 2)   s(paco21, 2)    s(pafi1, 2)    s(resp1, 2)   s(scoma1, 2)
7              5             10              1             10
s(sod1, 2)    s(temp1, 2)    s(wblc1, 2)           seps        transhx
4              5              2              6              4
trauma          white
3              1

## Basic observations

• Super Learner is not a magic bullet: crappy data = crappy predictions
• The screening algorithms seem to work better with many V folds and lots of data, the “chunk wise” variable selection method works best with smaller data sets
• Theory says you should use many prediction algorithms, but this can be computationally demanding

## Computation issues

Example computation times on different computers/R configurations

• Windows 10 laptop, 8 GB RAM, 4 logical cores/ R 3.02: 67 minutes
• UNIX desktop, 16 GB of RAM, 4 cores/ Microsoft Open R 3.02: 44 minutes
• UNIX desktop, 16 GB of RAM, 8 logical cores/ R 3.02: 31 minutes
• UNIX workstation, 64 GB of RAM, 16 logical cores/ R 3.02: 30 minutes

## Super Learner R package software

• Written in R in 2010
• Candidate algorithms are trained independently
• Can parallelize the cross-validation step via multicore or SNOW
• The meta-learning step has a small computational burden
• Possible to run out of memory while working with large training sets

## Two other options available

subsemble R package:

• Partitions the full dataset into subsets of observations
• Fits a specified underlying algorithm on each subset
• Uses a unique form of V-fold cross-validation to combine the subset-specific fits
• Using the UNIX workstation, computation time for the example went from 30 min to 1.6 min
• Still in development, does not provide CV risk estimates

h2oEnsemble R package: makes use of the h2o package, the R interface to the H2O platform, all training and data processing are performed in the high-performance H2O cluster


text:
0
Research Papers: Hydrodynamic Lubrication

# Surface Roughness Effects in the Region Between High Wave Number and High Bearing Number Limited Lubricant Flows

[+] Author and Article Information
James White

Knoxville, TN 37919

Contributed by the Tribology Division of ASME for publication in the Journal of Tribology. Manuscript received December 11, 2012; final manuscript received May 11, 2013; published online July 3, 2013. Assoc. Editor: Mihai Arghir.

J. Tribol 135(4), 041706 (Jul 03, 2013) (16 pages) Paper No: TRIB-12-1227; doi: 10.1115/1.4024709 History: Received December 11, 2012; Revised May 11, 2013

## Abstract

The ability to predict surface roughness effects is now well established for gas bearings that satisfy the requirements for either high wave number–limited or high bearing number–limited conditions. However, depending on the parameters involved, a given bearing configuration may not satisfy either of these limited requirements for analysis of roughness effects. Well-established methods for the analysis of surface roughness effects on gas lubrication are not yet available outside of these two limited regions. With that as motivation, this paper then reports an analytical investigation of rough surface gas-bearing effects for the region bounded on one side by high wave number–limited conditions and on the other by high bearing number–limited effects. It emphasizes the gas-bearing region, where shear-driven flow rate and pressure-driven flow rate due to surface roughness are of the same order of magnitude. This paper makes use of the compressible continuum form of the Reynolds equation of lubrication together with multiple-scale analysis to formulate a governing lubrication equation appropriate for the analysis of striated roughness effects collectively subject to high bearing number ($Λ→∞$), high inverse roughness length scale ($β→∞$), and unity order of magnitude-modified bearing number based on roughness length scale ($Λ2=Λ/β=O(1)$). The resulting lubrication equation is applicable for both moving and stationary roughness and can be applied in either averaged or un-averaged form. Several numerical examples and comparisons are presented. Among them are results that illustrate an increased sensitivity of bearing force to modified bearing number for $Λ2=O(1)$. With $Λ2$ in this range, bearings with either moving or stationary roughness exhibit increased force sensitivities, but the effects act in opposite ways. That is, while an increase in modified bearing number causes a decrease in force for stationary roughness, the same increase in modified bearing number causes an increase in force for moving roughness.

<>

## Figures

Fig. 1

Surface roughness configurations: (a) stationary roughness; (b) moving roughness

Fig. 5

Unaveraged pressure profile segments for stationary roughness as a function of the x coordinate with two different inlet conditions, 100 waves, and (h0 = 2,ɛ = 0.5,Λ2 = 1)

Fig. 2

Ensemble-averaged pressure profiles with stationary roughness for several values of Λ2 with (ɛ = 0.5): (a) h0 = 2; (b) h0 = 3

Fig. 3

Clearance profiles near the bearing inlet for stationary roughness

Fig. 4

Effect of modified bearing number and h0 on the unaveraged bearing performance for stationary roughness and two different inlet conditions (ɛ = 0.5): (a) net force ratio Fnet/Fnet,Λ2→∞; (b) mass flow rate ratio m·/m·Λ2→∞

Fig. 9

Ensemble-averaged solutions for stationary roughness with (ɛ = 0.5): (a) net force ratio Fnet/Fnet,Λ2→∞ as a function of (Λ2,h0); (b) mass flow rate ratio m·/m·Λ2→∞ as a function of (Λ2,h0)

Fig. 10

Time-averaged solutions for moving roughness with (ɛ = 0.5): (a) net force ratio Fnet/Fnet,Λ2→∞ as a function of (Λ2,h0); (b) mass flow rate ratio m·/m·Λ2→∞ as a function of (Λ2,h0)

Fig. 11

Mass flow rate function m·/(Λh0) as a function of ɛ and Λ2 for (h0 = 2)

Fig. 12

Force profiles as a function of roughness amplitude for several values of modified bearing number with (h0 = 2): (a) comparison of the force parameter Fnet/Fnet,ɛ = 0 for ensemble-averaged stationary roughness and time-averaged moving roughness; (b) ratio of ensemble-averaged stationary roughness net force to time-averaged moving roughness net force Fnet,stationary/Fnet,moving

Fig. 6

Unaveraged pressure profile segments for stationary roughness as a function of the x coordinate with two different inlet conditions, 100 waves, and (h0 = 2,ɛ = 0.5): (a) Λ2 = 0.1; (b) Λ2 = 10; (c) Λ2 = 100

Fig. 7

Time- and space-averaged profiles for moving surface roughness and (h0 = 3,ɛ = 0.5): (a) the product (p0h)AVG as a function of the x coordinate and Λ2; (b) the averaged pressure (p0)AVG as a function of the x coordinate and Λ2

Fig. 8

Moving and stationary roughness pressure profiles averaged after solution of the unaveraged lubrication equation with (h0 = 3,ɛ = 0.5,Λ2 = 1)

## Discussions

Some tools below are only available to our subscribers or users with an online account.

### Related Content

Customize your page view by dragging and repositioning the boxes below.

Related Journal Articles
Related Proceedings Articles
Related eBook Content
Topic Collections


text:
Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

# What is the formula weight of silver chromate (Ag_2CrO_4) in amu?

The formula weight for "Ag"_2"CrO"_4" is "331.728 u".

In order to determine the formula weight of a compound, multiply the atomic weight on of each element by its subscript and add the results.

Compound: silver chromateFormula Unit: "Ag"_2"CrO"_4"

(2xx"107.868 u Ag")+(1xx"51.9961 u Cr")+(4xx"15.999 u O")="331.728 u"


text:
# Resonance and Pitch classes

Suppose we denote the frequency of the note $\textbf{C}_{0}$ by $f$ then we know that $f,2f,3f,...$ are all resonating frequencies. However the frequencies $2f,4f,...,2^{m}f$ belong to the same pitch class $\textbf{C}$ having the "same" sound(higher pitch) whereas the frequency $3f$ is the note $\textbf{G}_{1}$ and belongs to the pitch class $\textbf{G}$. What is the reason(physical) for this ?

• essentially you are asking is: Why is $\textbf{G}_{1}$ a harmonic to $\textbf{C}_{0}$? (or very close to in in the equal-tempered scale.) is that it? the answer is that $2^{19/12}$ is very close to 3. that's the reason a perfect fifth sound so harmonic. and the reason a major third sounds pretty good is that $2^{29/12}$ is pretty close to 5. – robert bristow-johnson Jan 6 '16 at 17:05

I think you gave the reason in your question. A periodic function can be written as a Fourier series, i.e. as a weighted sum of phase shifted sinusoids, where the frequencies of the individual sinusoids are integer multiples of the fundamental frequency. And the odd multiples obviously give you other pitches than the pitch corresponding to the fundamental frequency. This is what causes the same note to sound different when played on different instruments. It's called timbre.

The harmonics of the note C consist of all possible notes (and also in-between notes). The strongest harmonics with pitches different from C are G (the perfect fifth at $3f$), and E (the major third at $5f$).

EDIT: Your comment clarified your question for me. The phenomenon you're addressing is called octave equivalence. The most common argument for explaining octave equivalence is that the perfect octave is the most basic interval after the perfect unison, due to the simple relation between the harmonics of two notes an octave apart. But the assumption of octave equivalence is by no means universally accepted. As an example, every musician knows from experience that certain chord voicings which sound good in some range sound different (usually not as good) in a lower range. For some interesting thoughts on octave equivalence have a look at this page.

• What I am trying to understand is the reason for 2f to be so different from 3f. Why is is that 2f or 4f sound "exactly" the same (just higher pich) but not 3f. – midi Jan 6 '16 at 10:57
• @midi: I've updated my answer. – Matt L. Jan 6 '16 at 13:13

Pitch is a psychoacoustic phenomena that is different from pure spectral frequency. Under certain conditions, a human ear-brain will combine (fuse) multiples spectral frequencies into what sounds like a single pitch. This likely helps simplify recognizing an single source producing an overtone rich audio periodicity (e.g. a single very large critter in the wild is very different from a bunch of little ones.) Thus pure 1f plus 3f (etc.) sinusoids of the right volumes and timing will sound like one pitch to human listeners, while a 3f sinusoid alone will sound like a different pitch.

e.g. pitch and pitch class are not purely physical, but perceptual.

• Thus the existence of auditory illusions, just like optical illusions. Lots of research papers can be found on the topic. – hotpaw2 Jan 6 '16 at 13:26

Neat question! If you took any note's frequency, twice its value is the same note in a higher octave:

A4 --> 440 Hz

A5 --> A4*2 == 880 Hz

A6 --> A5*2 == 1760 Hz... and so on

This is simply how nature works. Any fundamental waveform and a multiple which is an exponent of 2 is perceived as the same note, which it is.

Now, if you take any note which is just an integer multiple, it is one of the harmonics of the note.

A major scale has the notes: A, C# and E

3*A4 = 1320 Hz $\approx$ E6 = 1318.51 Hz

5*A4 = 2200 Hz $\approx$ C#7 = 2217.46 Hz

which is a crude example to differentiate harmonics from the same note in a different octave.


text:
<meta http-equiv="refresh" content="1; url=/nojavascript/">

# Independence versus Dependence

%
Progress
Practice Independence versus Dependence
Progress
%
All Those "Pure Luck" Game Shows

Credit: Laura Guerin
Source: CK-12 Foundation

Like watching game shows? Not the ones that require any type of skills or intelligence on the contestant's part, but the ones that are purely based on chance. Did you know that you can actually improve your chances of winning if a little bit of probability knowledge is applied?

#### Let’s Make a Deal

Consider the following example from a game show called Let's Make a Deal. Named after its original host Monty Hall, it's a famous probability puzzle known as the Monty Hall Problem.

Suppose you're a contestant on this show. You're given the choice of three doors: behind one door is a car and behind the others, goats. You pick a door, say No. 1, and the host, who knows what′s behind the doors, opens another door, say No. 3, which has a goat. He then says to you, “Do you want to switch your choice and pick door No. 2 instead?” Is it to your advantage to change your mind?

Credit: Trisha Shears
Source: http://commons.wikimedia.org/wiki/File:African_Pygmy_Goat_005.jpg

Many people (as a matter of fact, as high as 87% according to a survey that was once done) tend to believe that the probability of winning a car is simply $\frac{1}{2}$ whether or not you switch your choice (since there are 2 doors and just 1 car). However, if you look at the situation more closely, you may be surprised to find out that you have a $\frac{2}{3}$ chance of winning the car if you switch, and only a $\frac{1}{3}$ chance if you don't! Try figuring out why this happens.

You can find a detailed explanation here: http://www.youtube.com/watch?v=mhlc7peGlGg

#### Explore More

Another very similar probability puzzle is called Bertrand's Box Paradox. Check out the video below to see an adaption and explanation of this famous problem.

1. [1]^ Credit: Laura Guerin; Source: CK-12 Foundation; License: CC BY-NC 3.0
2. [2]^ Credit: Trisha Shears; Source: http://commons.wikimedia.org/wiki/File:African_Pygmy_Goat_005.jpg; License: CC BY-NC 3.0

### Explore More

Sign in to explore more, including practice questions and solutions for Independence versus Dependence.


text:
# Parametric study

Parametric study

In this section, we will use the expressions of different parameters that we've found to compute these parameters in multiple flight's cases.

1- Physical quantities

We need the values of the diffusion coefficient in the air and the saturation vapour pressure to can compute our parameters.

The following table summarizes the values of these physical quantities in different flight's cases:

2- Parametric study

Now we can calculate the non dimensional numbers involved in this problem. We summarize all the computed values in the next table for different flight's cases:


text:
# Chapter 3 - Section 3.1 - Derivatives of Polynomials and Exponential Functions - 3.1 Exercises: 35

The equation of tangent line to the curve at $(2,3)$ is $$(l):y=\frac{1}{2}x+2$$

#### Work Step by Step

$$y=x+\frac{2}{x}$$$$y=x+2x^{-1}$$ 1) Find the derivative of $y$ $$y'=\frac{d}{dx}(x)+2\frac{d}{dx}(x^{-1})$$ $$y'=1+2\times(-1)x^{-2}$$ $$y'=1-2x^{-2}$$ $$y'=1-\frac{2}{x^2}$$ 2) Find the slope of the tangent line to the curve at $(2,3)$, or in fact, $y'(2)$ $$y'(2)=1-\frac{2}{2^2}$$$$y'(2)=1-\frac{1}{2}=\frac{1}{2}$$ 3) The tangent line to the curve at $(2,3)$ would have the following equation: $$(l):y=y'(2)x+b$$$$y=\frac{1}{2}x+b$$ Since $(2,3)$ lies in the tangent line $(l)$, we can use that point to find $b$. In detail, $$\frac{1}{2}\times2+b=3$$$$1+b=3$$$$b=2$$ In conclusion, the equation of tangent line to the curve at $(2,3)$ is $$(l):y=\frac{1}{2}x+2$$

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.


text:
# statsmodels.robust.norms.LeastSquares¶

class statsmodels.robust.norms.LeastSquares[source]

Least squares rho for M-estimation and its derived functions.

Methods

 Returns the value of estimator rho applied to an input The psi function for the least squares estimator The derivative of the least squares psi function. The least squares estimator rho function The least squares estimator weighting function for the IRLS algorithm.


text:
# How to avoid table overflow (overlap) another side?

How to make the content below as 2 rows instead of 1 row?

I want to make it to

Selecting Panel
(2 row) instead of Selecting Panel (1 row)

The reason is this is a 2 column page, and the table overflow the other side.

I know there is a method using \thead, but I could not figure out and I do not want to change for format \begin{tabular}{lll}.

MWE:

\documentclass{article}
\usepackage{amsmath,epsfig,times}

\usepackage{makecell, multirow, tabularx}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{seqsplit, caption}
\usepackage{tabulary,siunitx}

\begin{document}

\begin{table}[htp!]
\centering
\begin{tabular}{lll}
\toprule
\multirow{2.4}{*}{\textbf{Selecting Panel}} & \multicolumn{2}{c}{\textbf{Total Item}}\\
\cmidrule{2-3}
& {\textbf{Item 1}} & {\textbf{Item 2}} \\
\midrule
Stick & Stick Stick Stick & Stick Stick Stick Stick \\
Stick & Stick Stick Stick & Stick Stick Stick Stick \\
\bottomrule
\end{tabular}
\end{table}

\end{document}

• Did you mean to write \thead ("table head") or \thread?
– Mico
Jun 2 '20 at 16:33
• @Mico, sorry, is \thead
– aan
Jun 2 '20 at 16:40

I wouldn't use \thead that needs work for resetting its defaults. What you need is a “smashed” header, that TeX will see as not occupying any vertical space.

\documentclass{article}
\usepackage{amsmath}
\usepackage{booktabs}

\smash{#1\begin{tabular}[t]{@{}c@{}}#2\end{tabular}}%
}

\begin{document}

\begin{table}[htp!]
\centering

\begin{tabular}{lll}
\toprule
\cmidrule{2-3}
& {\textbf{Item 1}} & {\textbf{Item 2}} \\
\midrule
Stick & Stick Stick & Stick Stick \\
\bottomrule
\end{tabular}

\end{table}

\end{document}

• Thanks. It work. Can we make the selecting panel move a bit lower, it seemed not in the middle
– aan
Jun 2 '20 at 17:02
• @aan It should not be in the middle. It doesn't refer to what's at its right, does it? The table has a row with the main headers and another row with secondary headers. So “Selecting” should be at the same level as the other main headers; the “Panel” part is attached to it and people will know that it's below just in order to save space (and be grateful for it). Jun 2 '20 at 17:03
• sorry for my English. I am writing a conference paper and the template is 2 row in a page. Thus, i want to make the Selecting Panel in 2 row and middle. Because if 1 row, it will exceed the page column
– aan
Jun 2 '20 at 17:14
• @aan Then use a nested tabular inside \multirow, adjusting manually the position. I'm not interested in producing tables I consider bad, sorry. Jun 2 '20 at 17:23


text:
• Create Account

## what kinds of control would you want in a particle system

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

6 replies to this topic

### #1freeworld  Members

Posted 07 May 2011 - 11:52 AM

I'm refactoring my particle system to make it more compatible with my current project and it got me thinking what kind of controls would others want, what kinda ideas have I not thought of. Make note, this system is completely 2D except for the use of depth to sort images when rendering, here is the list of what is already implemented, and the few changes I will be making... feel free to add to the list, like a community brainstorm

Movement
starting velocity
acceleration of velocity over time
damping of velocity over time
rotation around given origin.
direction rotation over time.

Size
starting size
expansion of size over time
contracting size over time

Emitter
position and boundary particles can be emitted from
depth particles can be emitted from
how fast particles are emitted
amount of particles to emit on each emission
lifetime of particles, this can be infinite for particles that don't die.

Graphics
Starting color
list of colors to fade to over time, and in order they are loaded.
use single or multiple sprites, with multiple sprites, particle will randomly be assigned a sprite whenever they are re spawned.

new changes need for current project
use animations instead of static sprite for particles.
boundary that particles must stay within or they automatically die.
gravity, or external force like wind. and possible allow multiples of them.
[ dev journal ]
[ current projects' videos ]
[ Zolo Project ]
I'm not mean, I just like to get to the point.

### #2slayemin  Members

Posted 12 May 2011 - 05:31 PM

When I wrote my particle emitter, I found it was most helpful to try to create a fire works show. Here's some suggestions you may want to consider:

-Emitters should be able to emit emitters (No limit on depth)
-You should be able to use primitives or sprites
-You'll want to specify alpha transparencies for particles
-Emitters should be able to move

Here's a simple demo of my particle system

### #3freeworld  Members

Posted 12 May 2011 - 06:45 PM

When I wrote my particle emitter, I found it was most helpful to try to create a fire works show. Here's some suggestions you may want to consider:

-Emitters should be able to emit emitters (No limit on depth)
-You should be able to use primitives or sprites
-You'll want to specify alpha transparencies for particles
-Emitters should be able to move

Here's a simple demo of my particle system

Interesting I'm surprised I never thought of having emitters emit emitters. Do you consider all your particles as emitters, and emitters as particles... ie are they derived from the same object?

Alpha transparency is controlled through the color values. These can be anything and can shuffle through any amount of colors as long as there is enough memory to store all the values... which is pretty much infinite. The way my framework works, being able to emit primitives instead of sprites (quads), work mean a refactoring of the base framework, but does sound tempting.
[ dev journal ]
[ current projects' videos ]
[ Zolo Project ]
I'm not mean, I just like to get to the point.

### #4slayemin  Members

Posted 12 May 2011 - 07:25 PM

Interesting I'm surprised I never thought of having emitters emit emitters. Do you consider all your particles as emitters, and emitters as particles... ie are they derived from the same object?

Alpha transparency is controlled through the color values. These can be anything and can shuffle through any amount of colors as long as there is enough memory to store all the values... which is pretty much infinite. The way my framework works, being able to emit primitives instead of sprites (quads), work mean a refactoring of the base framework, but does sound tempting.

Here is a rough sketch of my class inheritance hierarchy. The names are probably not the best, but it's good enough for me.

I use a lot bit of polymorphism and the classes I left out are just manager classes which maintain memory pools for particles and emitters.

The "Emitter Object" has a ParticleBase object which can be cast into either a particle or an emitter. Emitters are just manager classes which create "Emitter Objects"

class EmitterObject
{
Vector2 m_emissionVelocity; 	//this is the velocity applied to all emitted objects
Range m_emissionSpeed;
Range m_emissionDirection;  	//the direction objects are being emitted     		(Radians)
Range m_emissionSpread; 		//how much variance you have in the emission direction  (Radians)

int m_emissionCount;        	//how many objects will be emitted during the emission cycle
ParticleBase m_emissionObject;  //this is the generic object our emitter will emit

int m_emissionDelay;        	//how long to wait before emitting objects
int m_emissionPeriod;   		//how much time must elapse before next particle is sent out
int m_nextEmissionTime; 		//the next point in time in which we emit our objects
Color m_color;              	//the color applied to the objects being emitted
....
}

My base particle class also has a function pointer which lets the user specify the mathematical function to use for alpha transparency (constant, linear decay, exponential decay, gaussian, etc).

My reasoning for including primitive particles with sprite particles is because I've seen some interesting effects being done with primitives as particles... Pixels are very versatile and very fast to draw. Lots of small triangles can make some convincing fire effects. Connected line segments can be used for simulating streaks of shrapnel in an explosion (and the alpha decay ties in nicely here).

### #5freeworld  Members

Posted 12 May 2011 - 09:28 PM

Would it be possible to see the source to your particle system? Just that little snippet already gave me a few ideas on how i could improve mine... some embarrassingly better.
[ dev journal ]
[ current projects' videos ]
[ Zolo Project ]
I'm not mean, I just like to get to the point.

### #6Sirisian  Members

Posted 12 May 2011 - 10:33 PM

Prototype system works wonders. My Example. (Right click to view the javascript). Needless to say the best way to create a particle system is to create a list of scenarios that you can use as requirements. Fireworks is probably one of the best examples of that as mentioned. Defining splines is probably a good idea along with random splines where the random variables are defined in the prototype. Including scripting into the system is ideal.

Include cases that can simulate an emitter with a delay being launched into the air that leaves a trail of both smoke and sparks.

### #7slayemin  Members

Posted 12 May 2011 - 11:26 PM

Sure. Here's my code. It could stand to use a bit of improvement and streamlining, but I got lazy

--Particle System Classes--
Emitter.cs
EmitterObject.cs
Particle.cs
ParticleBase.cs
ParticleSystem.cs
PrimitiveParticle.cs
SpriteParticle.cs

--Helper Class from my library--
Range.cs

To instantiate this, I have to create emitters and assign emitter objects to them, and then create the particle which gets emitted. It's kind of a pain in the ass at the moment and a bit cumbersome to use. Ideally, I'd like to just define my particle and emitter structures in nested XML tags stored on an external file so that I don't have to hard code any of it. Maybe when I get less lazy I'll do that and do it in a generic way such that it can be dropped into a library and used in any game

Anyways, this should give you plenty of fuel to inspire your own implementation. Since I made this public, feel free to copy as much as you want. You don't have to credit me.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


text:
# Moloch games

post by Chris van Merwijk (chrisvm) · 2020-10-16T15:19:04.722Z · LW · GW · 5 comments

tl;dr: This post suggests a direction for modelling Molochs. The main thing this post does is to rename the concept of “potential games” (an existing concept in game theory) to “Moloch games” to suggest an interpretation of this class of games. I also define "the preferences of a Moloch" to generalize that notion (the preferences may be intransitive).

This post assumes that you have familiarity with game theory and the concept of a Moloch [? · GW].

What do group dynamics want? If a society/group (the Moloch) wants things that are different from what the individuals want, how can we assign preferences or a utility function to that society/group that doesn't model what would be good for the aggregated preference of the individuals of the group, but that describes what the group dynamics is actually "trying" to achieve (even against the interest of its individual members)? Here is a suggested answer.

Intuition. A Moloch game is a game such that there is a utility function , called “the Moloch’s utility function”, such that if the agents behave individually rationally, then they collectively behave as a “Moloch” that controls all players simultaneously and optimizes . In particular, the Nash equilibria correspond to local optima of .

Not all games are Moloch games.

Definition. A game with finite number of players and for each player  a strategy space  is a cardinal Moloch game (in the game theory literature, a cardinal potential game), if there is a utility function  such that for all players , and all strategies  for the other players,

Intuitively, if you take any strategy-profile for all the players, and adjust the strategy of one player, then the Moloch's utility will increase/decrease by the same amount as the utility function of that particular player. Hence, intuitively, every player behaves always as if they are optimizing the Moloch's utility function.

The definition for an ordinal Moloch game replaces the condition with

Intuitively,    represents the Moloch's preferences ordinally but not cardinally. Obviously, cardinal Moloch games are also ordinal Moloch games.

Example. The prisoners dilemma:

We will show that this is a cardinal Moloch game, by just computing the cardinal utility function and showing that there are no inconsistencies:

How to compute the cardinal utility function of the Moloch: Pick an arbitrary strategy profile to have utility 0 (I take Defect, Defect). Then iteratively compute the utility of rows and columns by just applying the constraint that the definition gives: Compute the difference in utility of the player whose row/column you're moving along (i.e. player 2 for the rows, player 1 for the columns) of each cell in the row/column from a cell of which you know the value of . In this case, we know . So compute  as  which equals . Similar for . For , there are two ways to compute it: Using player 1's utility function and  or player 2's utility function and . If these two give different answers, then the game is not a cardinal Moloch game.

Here is the cardinal utility function of the Moloch for the prisoner's dilemma (The above algorithm gives a utility function that is unique up to translations) :

Intuition. In this case, even though all players prefer Cooperate, Cooperate over Defect, Defect, the Moloch prefers the opposite. This corresponds to the fact that it is individually rational for the players to Defect. This Moloch utility function captures the "preferences of the group dynamics" as opposed to the preferences of the individuals. (It is obviously very different from the notion of "aggregate preferences" or "welfare").

A Moloch game assumes in some sense that "the Moloch has transitive preferences". We can generalize to Molochs with possibly intransitive preferences (I don't know of this being defined this way in the literature on potential games):

Definition. Let  be a game with a finite number of players, each of which has a preference relation  over the strategy space  (by default derived from a utility function ). Then the Moloch's preferences  are defined as the preference relation satisfying for all players , and all strategy profiles  for the other players:

Observation. These preferences are always incomplete (intuitively, the Moloch doesn't have an opinion on the comparison between different players changing their strategies, because it doesn't have this information: players individually make choices given their options). They may be either transitive or intransitive. I'll say a Moloch's preferences are rational if they are transitive (neglecting the usual requirement of completeness).

Just to show that the concepts are what they should be:

Lemma. Any game whose Moloch has transitive preferences is an ordinal Moloch game. Any ordinal Moloch game has a Moloch with transitive preferences.

Proof. For any transitive relation on a space there is a real-valued function on it that is consistent with that relation. The other direction follows directly.

Intuition. If the Moloch has transitive preferences, then the Moloch knows what it wants and the game will have a pure Nash equilibrium (there is a theorem that formalizes this). Conversely, if the Moloch has intransitive preferences, then the Moloch doesn't know what it wants and the game will tend to have cycles (not all of them will because the players might want to move out of them into a "transitive region" of the Moloch's preferences).

I won't show this here, but the literature on potential games (cf. the thing I am calling Moloch games), these are examples:

Games with rational Molochs (i.e. Moloch games / potential games):

• Prisoner's dilemma
• Battle of the sexes
• Coordination game
• Game of Chicken

Games with irrational Molochs (i.e. not Moloch games / potential games):

• Matching pennies
• Rock paper scissors

I probably won't spend much more time on this, but here is a suggestion for taking this as a starting point to modelling Molochs:

• Check if various informal ideas about Molochs can be phrased in this language. Check if the language is satisfying to talk about actual Molochs.
• Look at the literature on potential games to see if it contains much insight. Make a dictionary of concepts named in the terminology of the ontology we're interested in (similar to how I renamed "potential game" to "Moloch game") to make this literature an "efficiently queryable database" for insights into Molochs.
• I suspect that there might be ideas to be had about Moloch games that aren't treated there, because as far as I know, potential games were developed mostly as a trick to make computations easier, not as a conceptual tool for thinking about Molochs, societal inadequacy and so forth. It's plausible that certain obvious questions haven't been asked about them for this reason. Try to actually model Molochs this way and see if these definitions allow us to answer questions we want to ask about them. Use this as a stepping stone and see where it is unsatisfying. Build on top of that to push the analysis further.

Flows and Decompositions of Games: Harmonic and Potential Games. In the language of this post: decomposing a game into a "rational part" of the Moloch, and an irrational deviation from it. Finding the "closest rational Moloch" of a game.

Some further ideas and questions to ask:

• Can real world societies be decomposed into multiple Molochs? In the style of the "Flows and Decompositions of Games" paper, it wouldn't have to be a decomposition in terms of subgroups of players, but of "aspects of the game-theoretic interaction". (e.g. an individual might simultaneously be part of a "capitalism Moloch" and a "politics Moloch"). Maybe Molochs can be approximately decomposed.
• Is there a notion of "Moloch game" for sequential games? Games with limited information? (The potential game literature probably has asked analogous questions).

comment by Vanessa Kosoy (vanessa-kosoy) · 2020-10-17T07:09:48.022Z · LW(p) · GW(p)

That's a neat interpretation of potential games

If the Moloch has transitive preferences, then the Moloch knows what it wants and the game will have a Nash equilibrium

You mean the game will have a pure Nash equilibrium. Any game has some (mixed) Nash equilibrium.

Replies from: chrisvm
comment by Chris van Merwijk (chrisvm) · 2020-10-18T09:02:45.074Z · LW(p) · GW(p)

Yes that's what I meant, thanks.

comment by johnswentworth · 2020-10-16T15:55:15.468Z · LW(p) · GW(p)

This is a great idea, well done.

comment by Dagon · 2020-10-18T18:37:08.734Z · LW(p) · GW(p)

I'm not convinced we gain anything by further anthroporphising (or agent-izing) Moloch.  Moloch is the result of misaligned agents (who want different outcomes than each other, and will sacrifice the shared environment to pursue their goals), not a separate entity.

comment by philh · 2020-10-20T13:17:22.116Z · LW(p) · GW(p)

Intuition. A Moloch game is a game such that there is a utility function , called “the Moloch’s utility function”, such that if the agents behave individually rationally, then they collectively behave as a “Moloch” that controls all players simultaneously and optimizes . In particular, the Nash equilibria correspond to local optima of .

Minor, but this tripped me up. My read of "controls all players simultaneously" would be that there's no such thing as a local optimum, it can just move directly to the global optimum from any other state. I'm not sure what would be a better wording though, and your non-intuitive definition was clear enough to set me right.


text:
# How to remove linearly dependent rows/cols

How would one remove linearly dependent rows/columns from a rank-deficient matrix.

For example, (from wikipedia):

$$A = \begin{bmatrix} 2 & 4 & 1 & 3 \\ -1 & -2 & 1 & 0 \\ 0 & 0 & 2 & 2 \\ 3 & 6 & 2 & 5 \end{bmatrix}.$$

If you convert it to row-echelon-form, you get:

$$A = \begin{bmatrix} 1 & 2 & 0 & 1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \end{bmatrix}$$

This demonstrates that there are two linearly independent columns. As noted in the wikipedia article, "We see that the second column is twice the first column, and that the fourth column equals the sum of the first and the third". How can one extract the linearly independent columns (or rows) and get a result like:

$$A = \begin{bmatrix} 2 & 1 \\ -1 & 1 \\ 0 & 2 \\ 3 & 2 \end{bmatrix}.$$

-


text:
# Help me to understand this conversion (4-vectors)

$u^{\mu}$ - 4-velocity

$b^{\mu}$ - 4-vector of magnetic field

$u_{\mu}u^{\mu}=-1, \qquad u_{\mu}b^{\mu}=0$

$$u_{\beta}u^{\alpha}\nabla_{\alpha}b^{\beta}-u_{\beta}b^{\alpha}\nabla_{\alpha}u^{\beta}+\nabla_{\alpha}b^{\alpha}=0$$ I don't understand why this equation gives this $$u^{\alpha}u^{\beta}\nabla_{\alpha}b^{\beta}+\nabla_{\alpha}b^{\alpha}=0$$

-

## migrated from math.stackexchange.comApr 6 '13 at 14:17

This question came from our site for people studying math at any level and professionals in related fields.

This is because $u_\alpha \nabla_\beta u^\alpha =0$. To show this, just act with $\nabla_\beta$ on both sides of the equality $u_\alpha u^\alpha = -1$. You get $$u_\alpha \nabla_\beta u^\alpha + u^\alpha \nabla_\beta u_\alpha = 0$$ and thus $u_\alpha \nabla_\beta u^\alpha =0$ as promised.
You are correct, but perhaps use different indices (for consistency with the original question) and note the term $u_{\beta}b^{\alpha}\nabla_{\alpha}u^{\beta}$ vanishes because $u_{\beta}\nabla_{\alpha}u^{\beta}=0$? –  Alex Nelson Apr 6 '13 at 17:55
Exactly. Actually the names for the indicies does not really matter as long as your are consistent with yourself. Moreover, it is obvious that if $u_\alpha \nabla_\beta u^\alpha=0$, then of course $u_\beta \nabla_\alpha u^\beta=0$. –  Bru Apr 6 '13 at 18:11


text:
# Variance / standard deviation

#### logicandtruth

##### New member
Hi all - I wonder if you can help please.

Watching a video on youtube to help me understand about the mean, variance and standard deviation but last part of video left me confused.

The speaker said the following for the formula for standard deviation:

Consider if the variance is 200 for the first example and 2 for the second, please could someone explain in detailed simple terms why he calculated it to be 10 square roots of 2 and not 14. 14

Link to video

#### Attachments

• 45.9 KB Views: 0

#### Jameson

##### Administrator
Staff member
Hi there... just watched the video. Can you explain how you get 14? That will help me show where you are off.

#### logicandtruth

##### New member
Hi there... just watched the video. Can you explain how you get 14? That will help me show where you are off.
Hi Jameson - thanks for your response.

From timestamp 10:35 speaker starts to explain how he will calculate standard deviation using variance. As the variance in the example is 200, applying the formula used in the video you would have to find the square root of 200 which is 14. Instead he mentions the square root of 200 is equal to 10 square root's of 2 and I am not sure how/why he did this?

#### Jameson

##### Administrator
Staff member
Hi again,

Ok so $\sqrt{200}$ is not 14. Let's do it together.

$\sqrt{200} = \sqrt{100 \times 2} = \sqrt{100} \times \sqrt{2} = 10\sqrt{2}$.

Does that help?

#### logicandtruth

##### New member
Hi there,

Yes it now all makes sense as I now understand I essentially just needed to simplify the square root of an integer.

Thanks for your response, but please don't take it as a criticism but just posting an answer without explanation often does not help the intended recipient. Case in point, as someone not from a maths background motivated to improve, I went and did research where I learned the speaker was simplifying radical expressions. After reading more about this subject I also understood the rules such a
Hi again,

Ok so $\sqrt{200}$ is not 14. Let's do it together.

$\sqrt{200} = \sqrt{100 \times 2} = \sqrt{100} \times \sqrt{2} = 10\sqrt{2}$.

Does that help?
s If any factors are raised to the power of 2, they can be moved outside of the square root.

Hi there,

Yes it now all makes sense as I now understand I essentially just needed to simplify the square root of an integer.

Thanks for your response, but please don't take it as a criticism but just posting an answer without explanation often does not help the intended recipient. Case in point, as someone not from a maths background motivated to improve, I went and did research where I learned the speaker was simplifying radical expressions. After reading more about this subject I also understood the rules such as If any factors are raised to the power of 2, they can be moved outside of the square root.

Best,

#### Jameson

##### Administrator
Staff member
Hey, that's a fair point. This site is definitely of the mindset to help someone learn to do it themselves, rather than giving them the answers. It's hard to gauge sometimes what level someone is at and what is the proper amount of nudging without answering in full, but if you continue to post and ask these questions I feel confident you can both get help and get the proper balance.

#### logicandtruth

##### New member
Hey, that's a fair point. This site is definitely of the mindset to help someone learn to do it themselves, rather than giving them the answers. It's hard to gauge sometimes what level someone is at and what is the proper amount of nudging without answering in full, but if you continue to post and ask these questions I feel confident you can both get help and get the proper balance.
Thank you - I appreciate a staff member detailing to help an individual to learn for themselves. Granted, it is not an easy balance as people will have no idea as to the level of someone's ability by them just posting a question, so I understand getting the balance is not easy. I think in the future I will also try and give more context of where I am at in my learning which may prompt different tailored replies. Thanks again.