text:
# D field

1. Sep 4, 2008

### fisico30

The D (displacement) vector has only the free charges as source.
I heard it is better to work with D than E, because E can be due to both free and induced charge, and we cannot easily know the bound charge distribution(?). But it seems that we can know the polarization P however...from which we can derive the bound charges.(first the egg or the chicken).
I also read that the D field makes Gauss law easier to use. How?

Q: What is the story? Can we not just use B and E since they are the primary fields that a charge would actually experience?

In summary:
* E_net is due to both free and bound charges.
* D is only due to free charges.
* The electric bound charges can be derived from P (and vice versa).
* The electric permittivity can be derived from P OR from the bound charges(and vice-versa).
* It is said that it is HARDER to know the bound sources than P or the permittivity. Not sure why....
* Maxwell equation can account for materials and only use B and E, IF we stick into them an expression for P(and M), OR just the bound charges,OR the material permittivity.
* Why bother with extra constitutive eqns, when we can just work with E and B, if we just insert P and M (or rho or epsilon) in M.E.?
* The constitutive eqns still demand knowledge of P and M (or,again, the bound rho or permittivity).
* Maybe Maxwell eqns then become too difficult to solve computationally with E and B...
* Using D (and H) we treat the material as if it was vacuum. We get D and then value of E_net at every point, adjusted by the local permittivity....

*D has field lines that behave differently from the field lines of E in materials (dielectric,ferroelectric...).

(Maxwell came up with D...because they did not know about atoms and P.
D=(eps_0)E_net *P, i.e., D always intrinsically takes P and bound charges into account....)

thanks!

2. Sep 4, 2008

### Defennder

Hi, I believe that it is D and not E which takes into account the contributing factor of the polarization of bound charges.

Gauss law: $$\oint_S \mathbf{D} \cdot d\mathbf{S} = Q$$. Writing it using E you have to divide the RHS by the constant of permitivitty of free space.

I assume Q here means "Question" and not "charge". Reason why we use D is because we want to differentiate between an applied E-field in a medium and the actual field which also accounts for polarised bound charges. Similarly B takes into account the effect of magnetisation due to "bound current" as opposed to "free current" when we are dealing with magnetic materials.

I believe it's the other way round.
I don't see how this can be done. P is the net polarisation vector per unit volume or dipole moment per unit volume. The local bound electric charge configuration cannot be derived from P since P is the net dipole moment of a huge collection of dipole moments, all of which differ from each other locally unless the medium is isotropic (I hope that is the correct term) and the elecric field is constant.
Only true in an isotropic material since the relationship between P and E there is linear.
It depends on what you mean by "know". div(D) gives you the volume charge density. So you need D which comes from E and P. As said earlier P is a linear vector function of E only if the material is isotropic. Otherwise there are no easy answers (and I don't know how to find them).
Don't understand what you mean by "account". Again note that there is no easy way out if the material is anisotropic both for D and B. You'll have to write out and solve a matrix equation for these materials.
Because E doesn't take into account the effect of bound charges. And B isn't that easily calculated since the applied H-field would not have the same effect in a magnetic material as B.

P.S. I'll appreciate if the experts could verify what I wrote above. I'm doing a second-year E&M course and certainly don't want to give wrong or misleading answers.

3. Sep 4, 2008

### fisico30

Thank you Defennder.

In a dielectric there are two E fields:
E_a=the externally applied electric field.
E_s= the secondary field due to the polarization P, which is due to the fact that there is E_a in the material.

So at a point in the material, a hypothetical test point charge would experience an electric field E_total, superposition of the two mentioned fields (also E_total<E_a since the E_s is opposite to E_a. But NOT ALWAYS)....

D is equal to the net field E_total (time epsilon_0) + P. It seems that it implicitly takes into account P. We know the source of D are only the free charges, but as you comment, D is somehow determined by P(which is caused by bound charges).
I guess a better perspective would be to look at the equation this way

E_total=(D/epsilon_0) - (P/epsilon_0), which shows how E_total is due to D and P (free and bound charges).......

4. Sep 5, 2008

### Andy Resnick

These are really good questions- they raise very fundamental and foundational issues in electrodynamics. Usually the fields D and H are introduced very quickly, usually simply as D = $\epsilon$E and H=$\mu$B, and then attention quickly shifts to P and the suseptibility $\chi$, thence to the index of refraction. E and D (and B and H) are shown to be interchangable, and for the overwhelming number of applications, this is fine. There is a subtlely when dealing with *moving* matter.

That's a very interesting question, and as far as I know, the problem of calculating the force applied to a charge distribution in matter by an electromagnetic field is still incompletely solved. It turns out that there are several different formulations of electrodynamics which provide identical results for matter-free space, but produce different results for the stress-energy tensor in matter- how much force is applied to a charge by the field. This has a lot of technological applications (piezoelecticity, for example).

The E and B fields are technically for matter-free space. It's important to note that electrodynamics is a continuum model: there are no such things as point charges or point particles. In regions of space containing ponderable matter, there are charge distributions or densities that can respond and move in the presence of an externally applied field. To be sure, we can write D$_{0}$ = $\epsilon_{0}$E$_{0}$ for matter-free space, but that's not all that interesting. D and H are considered to be the electric and magnetic fields within ponderable matter. P and M are yet other ways of writing down the field in ponderable matter.

I'll come back to this after answering:

Constitutive laws are an important part of physics, and it's not widely appreciated that the relations come from *outside* of physics. That is, constitutive relations cannot be derived from first principles, they are invented. They serve to allow comparison between theory and experiment.

A constitutive relation is simply a functional relationship between two objects. Maybe it would be more clear if instead of writing D = $\epsilon$E, I write D=D(E) and H=H(B). Now it should be clear that I can use either D or E in the equations- I can switch between the two arbitrarily, as long as the functional relationship is invertible (which is usually the case). The specific form of the relationship is up to me- maybe there a simple linear dependence, maybe the permittivity depends on frequency or the material is anisotropic (permittivity tensor) or both, maybe the relationship is nonlinear, depends on the material's history, etc. etc... It doesn't matter: once I write down a functional relationship between D and E, I can use either field.

Now we get to Maxwell's equations. Strictly speaking, Maxwell write down the laws for matter-free space. Minkowski postulated the fields D and H and wrote down a simple constitutive relationship between them. This formulation of electrodynamics (the Minkowski formulation) has produced excellent agreement with experiment for stationary polarizible and magnetizible media. To generalize the constitutive relations to moving media, it was originally assumed that the fields simply transform as we expect as per special relativity- D depends on H and vice versa- but this is not surprising: moving charge creates a magnetic field.

For 60+ years, it was thought that the electrodynamics of moving media was solved. In 1960, Fano, Chu and Adler wrote down a different formulation of electrodynamics that produced identical results for matter-free space, but produced large discrepancies in the stress-energy tensor for moving media. It turns out that there are at least 4 different formulations of electrodynamics, depending on which 4 fields (out of E, D, P, B, H, M) are considered primary. Again, use of constitutive relations allows one to move between formulations, but the calculated stress-energy tensor produces different results. There is no obivous reason why one field should be considered primary over another, so there is no clear way to solve this problem. I do have a source that claims to have reconciled all the different formulations, so maybe this is a moot point. Typically, the Minkowski formulation is used for everything except relativistic calculations, in which case the Chu formulation is used.

In terms of QED- the microscopic nature of matter and how it interacts with the electromagnetic field, I don't know enough to say how this discussion fits in- that is, if the Minkowski formulation is used or some other formulation, or if it matters at the microscopic scale.

5. Sep 5, 2008

### tiny-tim

Hi fisico30!

Yes …

unfortunately, the minus in that equation makes it look as if D is the "bigger" field …

for some reason, P is defined to be minus what one would expect!

But E is definitely the total field … one only has to look at where rhob and rhof come in the three versions of Maxwells equations to see that.

6. Sep 5, 2008

### fisico30

Wow, I knew I was gonna open pandora's box.
Thanks Mr.Resnick.(I guess I read to many amateurs books).

1) Constitutive equations: they are then not laws but expressions, relations between the various fields. They vary from material to material and need to be discovered by experiment. Then we place materials in categories based on the right const. relation.

If the medium is not moving, the electric polarization P is only a function of E, and the magnetic polarization M only a function of B.(and we always assume a not-moving medium, so D=D(E) and H=H(B).
The electromagnetic properties of materials can be affected by factors of mechanical and thermal nature. In that case, other quantities like pressure and temperature appear in the const. equations.
Another assumption is that everything happens instantaneously: one vector field time t affects the other vector field at the same time t. In reality, atomic and molecular structures have inertia, so the time variation of,say, polarization, follow with some delay the variations of the field E. In that case the constitutive equations should also involve time derivative. Media that follow const. equations with time derivative are called materials "with memory" (of what was happening to the electric field earlier).
Also (another approximation), we are always assuming that the value of the polarization P field at a point is due only to the E field at the same point. Sometimes, instead, what happens to the E field in the neighborhood of the point is also affecting P at that point.
(we then need spatial derivatives in the const equations).

2
I always and erroneously thought that E and B are for space that contains matter. In vacuum, with only free charges, D has some functional form, as well as E. In space other than vacuum, with the same free charges, the D field does not change, but the E field does (it gets modified by the permittivity, therefore it depends in the material). The only way to change D is to change the free charges. If we change the bound(material) charges, D could not even care...
I guess I still don't get what the advantage is in using 4 vectors (D,E,H,B) instead of just 2...
But I will!
WE just need to stick with E and B and use an electric and magnetic permittivity function in the equations that take into account for allllll the material charges. We do not even need t otalk about P and M....

Thanks!!

thanks again

7. Sep 6, 2008

### Defennder

Hi, Dr Resnick, thanks for your very insightful post. I'm haven't learned any advanced formulation of E&M, but I did a quick search on Google and here it says that the Minkowskian formulation was developed to be compatible with relativity, so why is the Chu formulation used instead?

8. Sep 6, 2008

### atyy

They work for space that contain charged matter, but then you must treat all charges "fundamentally". Or you can hide your ignorance about what exactly every charge is doing in the "constitutive relations". Something similar happens in the definition of the refractive index. We can think that a medium slows light down according to its "refractive index". Or we can think of light going through a medium "fundamentally", and that light does not slow down at all in the vacuum between atoms. The slowing down is apparent and is due to the time taken for light to be absorbed and re-emitted by each atom, (HallsofIvy's post #4 at https://www.physicsforums.com/showthread.php?t=253789). The "fundamental" treatment of light going through a medium is really complicated (and actually needs quantum mechanics), so luckily we can hide our ignorance by defining a "refractive index" and pretending that light actually slows down. Like the constitutive relations, the refractive index is something that must be experimentally measured for each material. Actually, the refractive index and the constitutive relations are related, because the refractive index can be calculated (at least approximately) from a material's dielectric constant.

As Andy Resnick pointed out, in general D(E) can complicated. If we write this complicated function of E everywhere in the Maxwell matter equations, they will look nothing like Maxwell's fundamental equations. So D is defined to make the matter equations look like the fundamental equations, just to make them easy to remember. It's a psychological trick, since one still has to look up the constitutive relation.

9. Sep 6, 2008

### atyy

10. Sep 6, 2008

### fisico30

I think I am starting to get it atyy. Thank you.
Let's see if it is true (correct me please).

-The influence of a EM field on a material could be described by the charge unbalance it creates (bound charges), OR by polarization functions P and M, or by permittivities (mu and epsilon). The order is from very"fundamental" to less fundamental.
The less fundamental the closer to experiments: we can find the parameter, like the permittivity, by practical experiment.

-In numerical electromagnetism, since computers are solving abstract, theoretical, problems (that we can set up as complex as we want), using D,H,B,E or just E and B does not seem to make a difference, unless we prefer to keep a certain functional similarity between maxwell equations in vacuum and in matter (but supplementing them with const. eqns).

- For those examples inside materials, where H is going opposite to B, or D behaves strangely from E: how do you regard them? Is it somehow insightful to know about those differences or are they just artifact due to D and H (not corresponding to a reality). I mean, do they give a particular, different, useful perspective?

thanks

11. Sep 7, 2008

### Andy Resnick

That's ok- call it terminology. A constitutive law/relation can be something like "The present state of a material cannot depend on the future". Expressed mathematically, we obtain the Kramers-Kronig relations between the real and imaginary parts of the (for example) permittivity.

12. Sep 7, 2008

### Andy Resnick

It's not- but thanks for calling that one to my attention.

My reference is a book from the 80's, "Electrodynamics of moving media", by Haus, IIRC... it's not here in front of me.

Yet more evidence that the problem remains unsolved.

13. Sep 7, 2008

### Andy Resnick

The Minkowski formulation is compatible with special relativity- it is assumed that the fields transform normally. But the essential difference between the various formulations is in calculating the stress-energy tensor (for EM fields within moving matter). More than that, I can't say- I don't actively work in that field.


text:
Automorphisms in the Galois Group of f(x) over K Permute the Roots of f

Automorphisms in the Galois Group of f(x) over K Permute the Roots of f

Recall from the Galois Groups page that if $K$ is a field and $F$ is an extension field of $K$ then the Galois group of $F$ over $K$ is defined as:

(1)
\begin{align} \quad \mathrm{Gal} (F/K) = \{ \phi \in \mathrm{Aut}(F) : \phi(k) = k, \: \forall k \in K \} \end{align}

Furthermore, if $K$ is a field, $f(x) \in K[x]$, and $F$ is the splitting field of $f(x)$ over $K$ then the Galois group of $f(x)$ over $K$ is $\mathrm{Gal} (F/K)$.

We will now look at a very important result which says that if $K$ is a field and $f(x) \in K[x]$ then every automorphism in the Galois group of $f(x)$ over $K$ permutes the roots of $f(x)$.

 Theorem 1: Let $K$ be a field and let $F$ be an extension field of $K$. Let $f(x) \in K[x]$. Then every automorphism in $\mathrm{Gal} (F/K)$ permutes the roots of $f(x)$ in $F$.

In particular, if $K$ is a field and $f(x) \in K[x]$ then every automorphism in the Galois group of $f(x)$ over $K$ permutes the roots of $f(x)$ (since here, the field extension $F$ is the splitting field of $f(x)$ over $K$).

• Proof: Let $f(x) \in K[x]$ and write:
(2)
\begin{align} \quad f(x) = a_0 + a_1x + ... + a_nx^n \end{align}
• Where $a_0, a_1, ..., a_n \in K$. Let $u \in F$ be a root of $f$. Then $f(u) = 0$. Let $\phi \in \mathrm{Gal} (F/K)$. Then:
(3)
\begin{align} \quad 0 &= \phi(f(u)) \\ &= \phi(a_0 + a_1u + ... + a_nu^n) \\ &= \phi(a_0) + \phi(a_1u) + ... + \phi(a_nu^n) \\ &= \phi(a_0) + \phi(a_1)\phi(u) + ... + \phi(a_n)\phi(u^n) \\ \end{align}
• Since $a_0, a_1, ..., a_n \in K$ and $\phi \in \mathrm{Gal} (F/K)$ we have that $\phi(a_0) = a_0$, $\phi(a_1) = a_1$, …, $\phi(a_n) = a_n$, and so:
(4)
\begin{align} \quad 0 = a_0 + a_1\phi(u) + ... + a_n \phi(u)^n = f(\phi(u)) \end{align}
• Therefore $\phi(u)$ is a root of $f$. Observe that a polynomial $f$ can have only finitely many roots in $F$ and since $\phi$ is an automorphism, it is bijective. Therefore $\phi$ permutes the roots of $f$ in $F$. $\blacksquare$

format: plain


text:
Home » Mechanics » Is Power a Vector or Scalar Quantity?

# Is Power a Vector or Scalar Quantity?

In this article learn about is power a vector or scalar quantity and also learn the justification of the answer to this question. We all know that in physics, we mostly deal with scalars and vectors. Scalar and vector are different from each other.

Scalar quantities such as length, area, volume, etc. have only magnitude. A vector has magnitude but also has a direction. As an example, the displacement between two points on a line is a vector, but its direction is determined by the point’s position relative to the origin. Examples of other vector quantities include force, velocity, torque, etc.

## Power: Scalar or Vector

Now, our question is whether power is a vector or a scalar. If I had to answer this question immediately, I would say that,

power is a scalar quantity.

The question now is why this is the case. Why is power defined as a scalar quantity?

To answer the above question, let us first know more about physical quantity power.

### What is Power?

The rate at which a force performs work is referred to as the power delivered by that force. Also, the rate at which energy is transferred by an object such as a machine is defined as the power delivered by an object.

If a force does work $W$ in time $t$, the average power delivered by force is

$P=\frac{W}{t}$

So, we can say that power is defined as work done per unit of time.

### Unit of Power

We know that in the SI system unit work done by a force is measured in joules and time is measured in seconds, the unit of power is Joules/second. Unit Joule/second also has a separate name  – watt, abbreviated as W.

kW and MW are commonly used units of power where,

1kW=1000W

1MW=10^6 W

## Why is power a scalar quantity?

We have already established that power is energy (or work) per unit time or rate of doing work.

Power $P=\frac{W}{t}$

Again, we know that the work done by a force acting on an object is equal to the product of the force and the displacement of the object in the direction of the force.

so,

$W = \vec{F}\cdot s$

where,

$\vec F$ is the force acting on the object and

$s$ is the amount by which the object is displaced.

Here it is important to note that both force and displacement are vector quantities but work done which is a scalar product or dot product of two vectors is a scalar quantity.

Because power is defined as work done per unit of time, and both works done and time is scalar quantities, power is also a scalar quantity.

Apart from this power can be defined as a product of force and velocity i.e,

$P=\frac{W}{t}=\frac{\vec F \cdot s}{t}=\vec F \cdot \frac{s}{t} =\vec f \cdot \vec v$

Here, $W$ is the work done in an interval of time $t$.

So, from the above relation also we can say that Power can be defined as the dot product of force and velocity, thereby making power a scalar instead of a vector.

When it comes to current electricity

Power $P=V\times I$

Where $V$ and $I$ are voltage and current, respectively. Here, both voltage and current are scalar quantities, and the product of two scalar physical quantiles yields another scalar quantity.

Acceleration Formula with Velocity ... x
Acceleration Formula with Velocity and Time


text:
# Locus and Parabola Question

• December 11th 2009, 08:11 PM
phillipchum
Locus and Parabola Question

A parabola has equation 2y^2 = 4x + 8.
i. Express this equation in the form (y -y1)^2 = 4a(x - x1) [ those 1's were subscripts]

please help someone, it's probably the easiest question out, so its making me feel dumb right now ><
Thanksss
• December 11th 2009, 08:25 PM
Prove It
Quote:

Originally Posted by phillipchum

A parabola has equation 2y^2 = 4x + 8.
i. Express this equation in the form (y -y1)^2 = 4a(x - x1) [ those 1's were subscripts]

please help someone, it's probably the easiest question out, so its making me feel dumb right now ><
Thanksss

$2y^2 = 4x + 8$

$y^2 = \frac{1}{2}(4x + 8)$

$y^2 = 4\cdot \frac{1}{2}(x + 2)$

$(y - 0)^2 = 4\cdot \frac{1}{2}[x - (-2)]$.


text:
# Abstracts & Slides

### Jon Aaronson

Title: Ergodic and mixing properties of infinite measure preserving transformations arising from tied down distributional limits.

Abstract: For certain infinite ergodic transformations, the absolutely normalized ergodic sums (occupation times) may converge to a non-trivial distributional limit as in e.g. the Darling-Kac theorem. I’ll discuss some ergodic and mixing properties arising from tied down convergence (i.e. conditioned to times of occupation). Joint work with Toru Sera (arXiv:1910.09846).

### Olga Lukina

Title: Rotated odometers
Abstract: We consider a class infinite interval exchange transformations (IETs) obtained as a composition of a finite IET and the von Neumann-Kakutani map, and study their dynamical and ergodic properties by means of the assoicated Bratteli-Vershik diagram. In particular, we study the question whether such a system or its minimal subsystem factor onto the dyadic odometer. This is joint work with Henk Bruin.

### Andreas Wieser

Title: Effective equidistribution of orbits of semisimple groups on congruence quotients
Abstract: In this short talk, we discuss polynomially effective versions of a theorem of Mozes and Shah from the 90’s describing limits of measures on homogeneous spaces that are invariant and ergodic under unipotent flows. Remarkable work of Einsiedler, Margulis and Venkatesh from ’09 shows that orbits of a semisimple group on congruence quotients are equidistributed with a polynomial error rate in the volume assuming that the centralizer of the acting group is trivial. While this centralizer assumption does not appear to be essential to the method, it has proven to be challenging to remove. Building on effective avoidance principles recently developed by Lindenstrauss, Margulis, Mohammadi and Shah, we can remove the centralizer assumption under a Diophantine condition.

### E. Arthur Robinson

Title: Continued fraction normality for the Minkowski question mark function
Abstract: In 1981, Adler, Kean and Smorodinski constructed an explicit number that is continued fraction normal. This number is analogous to the 1933 Champernowne normal number base 10. In particular, it is a generic point for the continued fraction map G with the (absolutely continuous) Gauss measure g. But besides the Gauss measure g, another ergodic invariant measure for the continued fraction map G is the measure q whose distribution is the famous Minkowski “question mark” function Q. This function is continuous and strictly increasing, but satisfies Q'(x)=0 a.e.. We will display an explicit Champernowne style normal number for this measure. The proof uses the normality of the binary Champernowne number and the Kepler tree on the rationals. This is joint work with Karma Dajani and Mathijs de Lepper of Utrecht University.

### Anthony Sánchez

Title: Transversal to horocycle flow on the moduli space of doubled slit tori
Abstract: In this short talk we introduce an explicit transversal to horocycle flow on the moduli space of doubled slit tori and hint at some applications This talk does not assume any prior knowledge of the words in the title.

### Tomasz Downarowicz

Title: Classification of topological systems which split into uniquely ergodic subsystems

Abstract: We study connections between several similarly looking properties of (invertible)
topological dynamical systems $$(X,T)$$:

(a) Each point is generic for an ergodic measure;

(b) The system splits into uniquely ergodic subsystems;

(c) The measure center of the system splits into strictly ergodic subsystems;

(d) The Cèsaro means of continuous functions converge uniformly.
We also have a Jewett-Krieger type theorem for non-ergodic measure-preserving systems, but I will only have time to state the result without a proof.


text:
# Characterize triangular matrices by its eigenvalues?

For a triangular matrix, its diagonal entries are eigenvalues repeated with algebraic multiplicities.

I wonder if the reverse is true. In other words, a matrix whose diagonal entries are eigenvalues repeated with algebraic multiplicities must be triangular?

Thanks!

-
@DennisGulko: Thanks! Why is that? A linear mapping is the sum of a diagonalizable linear mapping and a nilpotent mapping. But I don't see why your comment? –  Tim Nov 26 '12 at 13:24
That was plain wrong, it is not equivalent but rather a special case, in which it is easy to find a counter-example since (for me :) it is easier to think of nilpotent matrices. –  Dennis Gulko Nov 26 '12 at 13:35

No; consider $$a=\begin{bmatrix}2&1&0\\0&2&0\\0&1&3\end{bmatrix}.$$ The eigenvalues are $2,2,3$ but it is not triangular.

-
Thanks! What we can say about matrices that have such property, after we know they may not be triangular? –  Tim Nov 26 '12 at 13:11
I don't immediately see any general property. They most likely have lost of zero entries, but I wouldn't know how to quantify/prove that. –  Martin Argerami Nov 26 '12 at 14:02

As Martin already pointed out in his answer, this must not necessarily be true. However, if the diagonal entries of an $n\times n$ matrix $A$ coincide with its eigenvalues, the characteristic polynomial of $A$ can be completely factored into linear factors as there are exactly $n$ diagonal entries and at most $n$ eigenvalues (counted by multiplicity). $A$ is thus at least similar to a triangular matrix, i.e. there exists $S\in \operatorname{GL}(n,V)$, such that $$S^{-1}AS$$ is triangular.

Edit: This holds for any (finite-dimensional) vector space $V$ over an arbitrary field $\mathbb{K}$. If $\mathbb{K}$ is algebraically closed, then $A$ is always similar to a triangular matrix (see comments).

-
But Andy, that's always true. In fact, for a general matrix $A$ one can even choose $S$ to be a unitary (that's the Schur Decomposition). –  Martin Argerami Nov 26 '12 at 14:00
It may be false if you consider a matrix with entries from a non-algebraically closed field. For example, the matrix $\begin{bmatrix} 1&2\\-3&4 \end{bmatrix}$ does not have any eigenvalues over $\mathbb{R}$ and thus cannot be similar to a triangular matrix. –  Andy Brandi Nov 26 '12 at 14:16
There was no mention in the initial question that only complex matrices were of interest. Sorry if my answer didn't turn out to be helpful. –  Andy Brandi Nov 26 '12 at 14:30


text:
User gejza jenča - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-19T20:36:40Z http://mathoverflow.net/feeds/user/4814 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/130193/does-this-property-of-a-partially-ordered-set-have-a-name/130995#130995 Answer by Gejza Jenča for Does this property of a partially ordered set have a name? Gejza Jenča 2013-05-17T18:48:59Z 2013-05-17T18:48:59Z
In the world of partially ordered abelian groups, this is the interpolation property. These groups are called partially ordered abelian groups with interpolation, or simply interpolation groups. Intuitively, I think about them as "almost as nice as lattice ordered abelian groups".

A simple example of a non-lattice ordered interpolation group is the set of all polynomial functions $\mathbb R\to\mathbb R$.

Probably the most important subclass is the class of dimension groups. As proved by Effros, Handelman and Shen in 1980, dimension groups classify the approximate finite dimensional $C^*$-algebras (via the $K_0$ functor).

I recommend this book by Goodearl -- very readable, he is an excellent writer.
 http://mathoverflow.net/questions/127949/is-there-any-nontrivial-monad-on-the-category-of-graphs Is there any nontrivial monad on the category of graphs? Gejza Jenča 2013-04-18T11:49:47Z 2013-04-19T21:49:50Z
The question is in the title, but let me specify what I mean by the category of graphs.

In the context of this question, the category of graphs is the category of symmetric irreflexive relations. That means, not the category of symmetric reflexive relations. That means, no loops and at most one edge between vertices.
 http://mathoverflow.net/questions/119726/discovering-and-selecting-conferences/120252#120252 Answer by Gejza Jenča for Discovering and selecting conferences Gejza Jenča 2013-01-29T20:07:53Z 2013-01-29T20:07:53Z
Conferences in General Algebra and Related Fields, maintained by Keith Kearnes.

Links to Combinatorial Conferences, maintained by Douglas B. West.

Combinatorics and related conferences, maintained by Peter Cameron.
 http://mathoverflow.net/questions/119294/generating-function-of-a-regular-language/119298#119298 Answer by Gejza Jenča for Generating function of a regular language Gejza Jenča 2013-01-19T00:22:10Z 2013-01-19T00:22:10Z
This is basically equivalent for finding an unambiguous regular expression for the language. This MO answer explains how to do it, given an DFA $\mathcal A$.

The rest is easy:

replace $\emptyset$ by $0$

replace $\epsilon$ by $1$

replace any symbol with $x$

replace concatenation with multiplication

replace $\cup$ with $+$

replace Kleene star with $1/1-f(x)$.

Source: this paper.
 http://mathoverflow.net/questions/3044/tools-for-collaborative-paper-writing/108070#108070 Answer by Gejza Jenča for Tools for collaborative paper-writing Gejza Jenča 2012-09-25T16:28:31Z 2012-09-25T16:28:31Z
Gist is very useful for initial writeup of ideas. Allows to create a git repository for a small file instantly. Anyone can edit the file and save (commit) a new version. Does not allow branching -- only the newest version is editable. Registration is not necessary, but useful.

Feel free to edit this gist.
 http://mathoverflow.net/questions/101014/fundamental-problems-whose-solution-seems-completely-out-of-reach/101155#101155 Answer by Gejza Jenča for Fundamental problems whose solution seems completely out of reach Gejza Jenča 2012-07-02T16:10:28Z 2012-07-02T16:10:28Z
Is every finite lattice a congruence lattice of a finite (universal) algebra?

Astonishingly, by Pálfy and Pudlák, this question is equivalent to a question in group theory: is every finite lattice isomorphic to an interval of the subgroup lattice of a finite group?
 http://mathoverflow.net/questions/91377/the-category-of-posets The category of posets Gejza Jenča 2012-03-16T15:53:21Z 2012-03-19T14:56:37Z
I am trying to teach myself category theory and, as a begginer, I am looking for examples that I have a hands-on experience with.

Almost every introductory text in category theory contains following facts.

The class of all posets with isotone maps is a category (called $Pos$).

Every individual poset $P$ is a category, with comparable pairs $x\leq y$ as arrows. This can be called "a categorified poset".

Sometimes, product and coproduct in $Pos$ is characterized and (less frequently) it is pointed out that a Galois connection can be characterized as a pair of adjoint functors of categorified posets. Also, it is sometimes mentioned that products and coproducts in categorified posets are joins $\vee$ and meets $\wedge$, so a categorified poset has products and coproducts iff it is a latttice.

Moreover, some texts contain the fact that the category of finite posets and the category of finite distributive lattices are dually equivalent -- this is extremely useful.

But I cannot find much more. For example, when I tried to search for equalizers and coequalizers in $Pos$, the only source I found is the PhD thesis by Pietro Codara, available here, which is from 2004 and characterizes (co)equalizers in $Pos$.

Does anyone know about some other sources of information about $Pos$ from the category-theoretic viewpoint? Specifically, I am looking for things like

useful functors to $Pos$ and from $Pos$,

pullbacks, pushouts and other universal constructions in $Pos$,

examples of adjoint functors, applications of Yoneda lemma etc.

 http://mathoverflow.net/questions/78149/what-is-this-subclass-of-k-colorable-graphs-called What is this subclass of $k$-colorable graphs called? Gejza Jenča 2011-10-14T16:51:54Z 2011-10-15T17:45:13Z
The following property emerged naturally when I was playing with certain generalizations of Kneser graphs.

Let $k>0$ be a natural number. Consider a property $P_k$ of graphs defined as follows.

For every non-edge $(u,v)$ there is a $k$-coloring such that $u$ and $v$ have the same color.

It is clear that every $k-1$-colorable graph has the $P_k$ property -- we can use the spare color for the non-edge and leave the other colors as they are.

Not every $k$-colorable graph has the $P_k$ property: $C_6$ is 2-colorable, but has not the $P_2$ property.

What is this property called?

EDIT: Some additional observations from last night.

If some $k$-colorable graph $G$ has not the $P_k$ property, then there is a non-edge $(u,v)$ in $G$ such that for every $k$-coloring of $G$ the colors of $u$ and $v$ are distinct. That means that every $k$-coloring of $G$ is a $k$-coloring of $G\cup(u,v)$.

Thus a graph $G$ has not the $P_k$ property iff we can add an edge with no effect on $k$-colorings and

$P_k$ property means that you cannot add an edge without losing some of the $k$-colorings.

So any $k$-colorable graph can be embedded into a graph with the $P_k$ property.

For example, if we start with $C_6$ we can add step-by-step 3 edges without any effect on 2-colorings; the resulting graph

has the $P_2$ property.
 http://mathoverflow.net/questions/71022/entangled-permutations-of-a-multiset Entangled permutations of a multiset Gejza Jenča 2011-07-22T21:48:59Z 2011-07-24T10:04:14Z
Let $M=\{1^{a_1},\dots,m^{a_m}\}$ be a multiset of numbers of cardinality $n$. Call a permutation of $M$ an $M$-word. We say that an $M$-word $w$ is entangled it cannot be written as a concatenation of two nonempty words $u,v$ such that $w=u.v$ and the sets of numbers/characters used in $u$ and $v$ are disjoint.

Examples: let $M=\{1^2,2^3,3^4\}$.

The words 122123333, 112323332 are not entagled:

122123333 = 12212.3333

112323332 = 11.2323332

The words 123213332, 311322233 are entangled.

Question: given a multiset $M$, how many entangled $M$-words are there?

Of course, it is possible to find a horrible-looking formula. But I feel that this problem should have a nice answer, maybe in a form of a generating function of some sort.

EDIT:

Another way how one can view entangled $M$-words: as lattice paths from $s=(0,\dots,0)$ to $e=(a_1,\dots,a_m)$ that avoid all extremal points of the box except for $s$ and $e$.
 http://mathoverflow.net/questions/1722/free-high-quality-mathematical-writing-online/65981#65981 Answer by Gejza Jenča for Free, high quality mathematical writing online? Gejza Jenča 2011-05-25T19:05:22Z 2011-05-25T19:05:22Z
Richard P. Stanley's Enumerative Combinatorics, volume 1, second edition is available at http://www-math.mit.edu/~rstan/ec/ec1/ .
 http://mathoverflow.net/questions/6538/generalizations-of-boolean-posets-lattices/64508#64508 Answer by Gejza Jenča for Generalizations of Boolean posets/lattices Gejza Jenča 2011-05-10T15:35:02Z 2011-05-10T15:35:02Z
I think you could look at MV-algebras. They were introduced in the 50's by Chang in order to prove completness of the Lukasziewicz propositional many valued (MV) logic. From what I know, this class of algebras is the most special proper generalization of Boolean algebras that makes sense.

Every MV-algebra is a subdirect product of totally ordered MV-algebras; this is a direct generalization of the algebraic version of Stone's theorem. In the finite case, this reduces to the fact that every finite MV-algebra is isomorphic to a direct product of finite chains and vice versa. Even some of the more elaborate parts of the theory of Boolean algebras, like the Loomis-Sikorski theorem have their MV-algebraic versions.

As proved by Mundici in the 80's, MV-algebras are categorically equivalent to lattice ordered abelian groups with strong order unit.

The standard reference book for MV-algebras is this one.
 http://mathoverflow.net/questions/61081/actions-of-z-n-and-actions-of-z-n-1 Actions of $Z_n$ and actions of $Z_{n-1}$ Gejza Jenča 2011-04-08T16:53:05Z 2011-04-20T11:59:30Z
I am playing with some questions concerning connections between certain poset partitions and their linear extensions. This is not my usual playground, I just happened to stumble upon something.

When I was playing with these things, I came up with a very simple construction that I cannot find anywhere.I suspect that this construction is a minor particular case of something well known and much more general. It reminds of an equivariant map, but the group is not fixed here.

Let $n>2$, let $X$ be a finite set of cardinality $n$. Let $\oplus_n$ be an action of $Z_n$ on $X$ such that the action of $1$ is a cycle of length $n$. Pick $x\in X$ and let $\pi$ be a partition of the set $X$ such that $\{x,x\oplus_n 1\}$ is the only nonsingleton block of $\pi$.

In a very simple way, this gives rise to an action $\oplus_{n-1}$ of $Z_{n-1}$ on $\pi$ by ,,squeezing the action'' at $x$:

Put

$\{x,x\oplus_n 1\}\oplus_{n-1} 1=\{x\oplus_n 2\}$

$\{x\oplus_n(n-1)\}\oplus_{n-1} 1=\{x,x\oplus_n 1\}$

$\{y\}\oplus_{n-1} 1=\{y\oplus_n 1\}$ for any $y\neq x\oplus_n(n-1)$.

It can be visualized in a simple way by a digraph construction: if we identify the action of $1$ on $X$ with an oriented cycle, this construction corresponds to a contraction of an edge.

Has anyone seen this construction before? Is there any name for it?
 http://mathoverflow.net/questions/127949/is-there-any-nontrivial-monad-on-the-category-of-graphs/127954#127954 Comment by Gejza Jenča Gejza Jenča 2013-04-19T06:43:47Z 2013-04-19T06:43:47Z Please, do not delete the answer. The last example is correct,I think. http://mathoverflow.net/questions/127949/is-there-any-nontrivial-monad-on-the-category-of-graphs/127954#127954 Comment by Gejza Jenča Gejza Jenča 2013-04-19T06:08:47Z 2013-04-19T06:08:47Z The third example is not a functor, I think: take the path with 3 vertices $P_3$. It can be 2-colored, so there is a morphism into $K_2$. But there is no morphism $K_3\to K_2$. http://mathoverflow.net/questions/127949/is-there-any-nontrivial-monad-on-the-category-of-graphs/127952#127952 Comment by Gejza Jenča Gejza Jenča 2013-04-18T20:19:59Z 2013-04-18T20:19:59Z I know that I am an not good at making examples but I do not understand how I could miss this one. http://mathoverflow.net/questions/127949/is-there-any-nontrivial-monad-on-the-category-of-graphs Comment by Gejza Jenča Gejza Jenča 2013-04-18T12:07:26Z 2013-04-18T12:07:26Z A trivial monad for a category $C$ is the one that arises from the adjoint pair of functors $(1_C,1_C)$. I do not understand what you mean by your second question. http://mathoverflow.net/questions/91377/the-category-of-posets/91391#91391 Comment by Gejza Jenča Gejza Jenča 2012-03-17T09:22:28Z 2012-03-17T09:22:28Z The sole purpose of this comment is to contain the word "quasiorder" (an alternative name for preorders) -- greetings to the all-seeing eye of google. http://mathoverflow.net/questions/91377/the-category-of-posets/91393#91393 Comment by Gejza Jenča Gejza Jenča 2012-03-16T17:41:09Z 2012-03-16T17:41:09Z Could not download it, but I found a direct link to pdf: intlpress.com/HHA/v12/n2/a7/v12n2a7.pdf http://mathoverflow.net/questions/91377/the-category-of-posets/91391#91391 Comment by Gejza Jenča Gejza Jenča 2012-03-16T17:16:59Z 2012-03-16T17:16:59Z A very nice answer, thank you. http://mathoverflow.net/questions/91377/the-category-of-posets/91381#91381 Comment by Gejza Jenča Gejza Jenča 2012-03-16T16:57:53Z 2012-03-16T16:57:53Z This is an extremely useful functor, when composed with other functors on the left. In combinatorics, one frequently takes an object (let us say a graph) constructs a poset (say a poset of certain sets of vertices) cuts off the bounds (to have a non-contractible space) and applies your Pos->Top functor. In some cases, the resulting space is a wedge of spheres and the dimension and/or the number of spheres express some properties of the original object. http://mathoverflow.net/questions/91377/the-category-of-posets Comment by Gejza Jenča Gejza Jenča 2012-03-16T16:47:19Z 2012-03-16T16:47:19Z @Martin Brandenburg: Maybe I misused the word "categorification": in the non-categorial mathematical literature a poset is a set (a 0-category) and the definition in my question is a 1-category: the elements become objects and the relations become arrows. It seems to me that your definition climbs one step higher. http://mathoverflow.net/questions/28612/do-names-given-to-math-concepts-have-a-role-in-common-mistakes-by-students/28625#28625 Comment by Gejza Jenča Gejza Jenča 2012-02-28T22:29:24Z 2012-02-28T22:29:24Z Why not "hill" and "valley"? http://mathoverflow.net/questions/78149/what-is-this-subclass-of-k-colorable-graphs-called Comment by Gejza Jenča Gejza Jenča 2011-10-15T08:24:09Z 2011-10-15T08:24:09Z @Joseph O'Rourke: Well, yes. I understand that as a subtle reminder that I should ask a slightly different question; something like "Has anyone seen anything like this before?". http://mathoverflow.net/questions/71022/entangled-permutations-of-a-multiset Comment by Gejza Jenča Gejza Jenča 2011-07-27T18:17:27Z 2011-07-27T18:17:27Z @mhum: First impression is that nothing really nice happens, but I have to think about it more. http://mathoverflow.net/questions/71022/entangled-permutations-of-a-multiset/71058#71058 Comment by Gejza Jenča Gejza Jenča 2011-07-23T14:11:42Z 2011-07-23T14:11:42Z @Tony Hyunh: Please, do not delete the answer. The mistake is typical -- everyone I asked (3 people) made exactly this mistake at first before realizing that the problem is a bit more complicated. So I think it is better to keep the answer here, but to mark it as wrong. http://mathoverflow.net/questions/71022/entangled-permutations-of-a-multiset Comment by Gejza Jenča Gejza Jenča 2011-07-23T12:35:06Z 2011-07-23T12:35:06Z For the record: the horrible-looking formula I found is based on the Moebius inversion of polynomial coefficients with respect to the poset of set partition of $\{1,\dots,m\}$ . http://mathoverflow.net/questions/71022/entangled-permutations-of-a-multiset/71058#71058 Comment by Gejza Jenča Gejza Jenča 2011-07-23T12:28:10Z 2011-07-23T12:28:10Z In your sum, you count the untangled permutation 112223333 twice, once for $X=\{1\}$ and second time for $X=\{1,2\}$.


text:
# Introduction to Machine Learning – Linear Regression

Machine learning is everywhere. You probably know that already. So you want to join the party. But where do you start from? There is a few thousand tutorials out there so there’s no reason to add yet another one. But here I am.

The basic principles of machine learning are easy to understand. In this tutorial, I’ll cover linear regression to introduce general concepts. If you’re not familiar with the theory, check out my YouTube video. By the end of this tutorial, you will have a pretty good idea what most of machine learning is about.

#### Linear Predictors

Let’s say you’re given input-output data pairs and you want to learn the mapping . Assuming and are one dimensional real numbers, we define a linear predictor to be:

(1)

where the function simply transforms the input into something called a feature vector.

##### What is a feature vector?

Linear predictors are linear in and , but not in . That is, when you plot your predictor as a function of , it won’t look like a line (or a plane if has dimension higher than 1). This means that your model will fit very nonlinear data but the solution will be a superposition of the nonlinear functions you include in the vector .

For example, if you know that your data looks like an oscillating function, you will probably define the feature vector to include sines and cosines . If you include enough terms, you will be learning the coefficients of a truncated Fourier transform! If you want to fit a 5-th order polynomial to your data, define your feature vector to be

(2)

The function is called a feature extractor and choosing it is part of a machine learning field called feature engineering. Once you make that choice, the rest is relatively straightforward in practice.

Our objective is to find the best set of coefficients (or weights) that minimize the difference between the true values and their corresponding predictions by optimizing the loss

(3)

for all data pairs . The vector of coefficients that gives you the smallest average loss over all the data set will give you the best predictor. This is where stochastic gradient descent comes in. But in practice you never have to worry about that as you’ll see in the code below.

#### Building a linear predictor with Python

Let’s first import the libraries we need for running the show

In [1]:
import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error

Any machine learning problem starts with data! If you have a machine learning idea in mind, first look for the data. If it’s hard to get, you might want to change your mind. The more data the better, especially if you planning to use neural networks.

In this problem we will generate the data instead of collecting it. This is not uncommon in some applications like physics constrained learning. Sometimes, you already have a predictor but you want to make it faster, so you create a surrogate model using machine learning to make faster predictions.

We’ll generate 100 data points for a parabolic function . We’ll add some “measurement noise” to mimic real-world data and explore the concepts of over- and under-fitting.

In [2]:
# Generate data
noise_strength = 10
x = np.linspace(0, 10, 100)
y = x**2 + noise_strength * (np.random.random((len(x)))-0.5)

Now we can split the data into training, validation and test sets. The training set is used to optimize the model and find the optimal weights , the validation set (a.k.a. dev set) is used to test the generalization error while trying different hyperparameters and models, and the test set is finally used to evaluate your final generalization error, right before you deploy.

In [3]:
test_size = 0.2 # Partion of data in test set
shuffle = False # Whether to sample anywhere in domain of x or separate training and testing domains

# Split data into train/dev/test
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=test_size, shuffle=shuffle)
x_train, x_dev, y_train, y_dev = train_test_split(x_train, y_train, test_size=test_size, shuffle=shuffle)

Note that I’m not shuffling the data to highlight the idea of extrapolation. This is common with time series data where the purpose of a machine learning model is to predict the future. This is illustrated in the visualization below. You’ll see how over-fitting doesn’t do well on extrapolation.

In [4]:
# Visualize the data
fig = plt.figure()
plt.plot(x_train, y_train, 'k.')
plt.plot(x_dev, y_dev, 'b.')
plt.plot(x_test, y_test, 'r.')
plt.legend(['train', 'dev', 'test'])
plt.ylabel('y')
plt.xlabel('x')
plt.show()

Once you visualize the data try to get an intuition on the trends, you’re ready to design your feature vector. We’ll define a function that takes the data as an input and transforms it into a matrix containing polynomial features. The first column is contain the bias because , and the -st column will have the data for .

Let’s define that function

In [5]:
def make_features(x, degree=1):
X = np.zeros((len(x), degree+1))
for i in range(degree+1):
X[:, i] = x**i
return X

Now we’re ready to create our input output data. In practice, you’ll have to split your data after building the feature matrix, not before (as I did above). We will start with a first order polynomial (i.e. a simple line).

To be consistent I will reshape to be a dimension vector instead of a dimensional vector.

In [6]:
d = 1

X = make_features(x, degree=d)
Y = y.reshape(-1, 1)

# Split data into train/dev/test
X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=test_size, shuffle=shuffle)
X_train, X_dev, Y_train, Y_dev = train_test_split(X_train, Y_train, test_size=test_size, shuffle=shuffle)

Now we’re ready to fit the model to the training set! Fortunately, in most cases, if you’re interested in applying machine learning to a problem, you don’t have to worry about the optimizer. You might need to choose some hyperparameters like the step size or the optimization algorithm but you don’t have to write the stochastic gradient descent algorithm from scratch. That would be a waste of time; unless you really enjoy it…

Here we will use scikit-learn to do that:

In [7]:
reg = LinearRegression(fit_intercept=False)
reg.fit(X_train, Y_train)

Out[7]:
LinearRegression(fit_intercept=False)

Done! Sklearn ML algorithms include the bias separately by default but we included it in the feature vector. To avoid duplicating the bias feature, we use the argument fit_intercept=False.
We can now look at the optimal coefficients

In [8]:
reg.coef_

Out[8]:
array([[-5.47924673,  6.07689638]])

Or to make these coefficients a bit more interpretable, let’s write a function that takes the optimal coefficients and returns the polynomial predictor. I’m using the IPython module to display the equation in a format.

In [9]:
from IPython.display import display, Math

def latexify_predictor(coefs):
s = ['$f_\mathbf{w}(x) = '] for i, c in enumerate(coefs): if abs(c) > 0: if c > 0 and i > 0: s.append('+') s.append('{:.3f}'.format(c)) if i > 0: s.append('x^{}'.format(i)) s.append('$')
return ''.join(s)

display(Math(latexify_predictor(reg.coef_[0])))

How good is this predictor? Now that we have the optimal model, it’s time to test it. Let’s define a get_error function that takes the input x, the output y, the predictor object reg and the polynomial degree as inputs, and returns the mean squared error. You can see that reg.predict(X) returns the prediction of the features X.

In [10]:
def get_error(x, y, reg, degree):
X = make_features(x, degree=d)
y_pred = reg.predict(X)
mse_val = mean_squared_error(y, y_pred)
return mse_val

We will also use the score (included in the predictor module), defined as

where is the prediction, is the true value, is the average of the true values across the data. For you have a perfect predictor, for , you’re just predicting the average of the distribution, and the more negative is, the worse your predictor. Let’s see what our predictor and the errors on the validation and training sets look like

In [11]:
mse_dev = get_error(x_dev, y_dev, reg, d)
mse_train = get_error(x_train, y_train, reg, d)

score_dev = reg.score(X_dev, Y_dev)
score_train = reg.score(X_train, Y_train)

# Print the errors
print('degree = %d'%(d))
print('\n')
print('validation score = %.4f'%( score_dev ))
print('train score = %.4f'%( score_train ))
print('\n')
print('validation MSE = %.4f'%(mse_dev))
print('train MSE = %.4f'%(mse_train))

degree = 1

validation score = -2.4356
train score = 0.8798

validation MSE = 197.4243
train MSE = 17.5591

Here’s what the prediction looks like

In [12]:
# Define the input to span training and validation sets (excluding test set) - no cheating!
x_c = np.linspace(x[0], np.max(x_dev), 100)

fig = plt.figure()
ax.plot(x_c, reg.predict(make_features(x_c, degree=d)), '--')
ax.plot(x_train, y_train, '.')
ax.plot(x_dev, y_dev, '^', ms=6)
ax.plot(x_dev, reg.predict(make_features(x_dev, degree=d)), '.')

ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_ylim(np.min(y_train), np.max(y_dev))
ax.legend(['polynomial fit', 'train data', 'dev data', 'dev prediction'])
plt.show()

You can see that the error on the training set is much lower than on the validation set. This is normal, but can we do better on the validation set? Are we overfitting or underfitting?

Here we’re clearly underfitting: the model is too simple. We need to make it a bit more complex. To do that, set , and try again. In this case, we know the right answer, but in real-world problems we don’t. We’d have to test different inputs and see which one fits best. That’s why automating feature selection and hyperparameter tuning can save you a lot of time.

To illustrate this point, I’ll define functions for splitting the data into train/dev/test sets and printing their error so we can train the model in a loop over different values of the degree .

In [13]:
# Split the data
def split_data(x, y, test_size=0.2, shuffle=False):
X = make_features(x, degree=d)
Y = y.reshape(-1, 1)

X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=test_size, shuffle=shuffle)
X_train, X_dev, Y_train, Y_dev = train_test_split(X_train, Y_train, test_size=test_size, shuffle=shuffle)

return X_train, Y_train, X_dev, Y_dev, X_test, Y_test

# Plot results
def plot_results(x_train, y_train, x_dev, y_dev, reg, d):
x_c = np.linspace(x[0], np.max(x_dev), 100)

fig = plt.figure()
ax.plot(x_c, reg.predict(make_features(x_c, degree=d)), '--')
ax.plot(x_train, y_train, '.')
ax.plot(x_dev, y_dev, '^', ms=6)
ax.plot(x_dev, reg.predict(make_features(x_dev, degree=d)), '.')

ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_ylim(np.min(y_train), np.max(y_dev))
ax.legend(['polynomial fit', 'train data', 'dev data', 'dev prediction'])
plt.show()

Now we can loop over different values of , pick the best predictor and finally test it on the test set. This is a good illustration of the whole machine learning process.

In practice, you might have to store your trained models (usually on a local drive) because most real-world machine algorithms take a lot of time to train. You don’t want to be training the same model multiple times. In this case, the models and data are small so we can afford to simply save them in a list.

In [14]:
degree_list = [1, 2, 3, 6]

reg_list = []
mse_dev_list = []
score_dev_list = []

for d in degree_list:

# Split data
X_train, Y_train, X_dev, Y_dev, X_test, Y_test = split_data(x, y)

# Fit model
reg = LinearRegression(fit_intercept=False)
reg.fit(X_train, Y_train)

# Compute errors
mse_dev = get_error(x_dev, y_dev, reg, d)
mse_train = get_error(x_train, y_train, reg, d)
score_dev = reg.score(X_dev, Y_dev)
score_train = reg.score(X_train, Y_train)

# Print the errors
print('\ndegree = %d'%(d))
print('validation score = %.4f'%( score_dev ))
print('train score = %.4f'%( score_train ))
print('validation MSE = %.4f'%(mse_dev))
print('train MSE = %.4f'%(mse_train))

# Print model
display(Math(latexify_predictor(reg.coef_[0])))

# Plot results
plot_results(x_train, y_train, x_dev, y_dev, reg, d)

# Store results
reg_list.append(reg)
mse_dev_list.append(mse_dev)
score_dev_list.append(score_dev)

degree = 1
validation score = -2.4356
train score = 0.8798
validation MSE = 197.4243
train MSE = 17.5591

degree = 2
validation score = 0.8464
train score = 0.9549
validation MSE = 8.8268
train MSE = 6.5966

degree = 3
validation score = 0.8122
train score = 0.9552
validation MSE = 10.7929
train MSE = 6.5447

degree = 6
validation score = -15.6113
train score = 0.9563
validation MSE = 954.5483
train MSE = 6.3899

In [15]:
# Let's see who wins!
best_degree = degree_list[np.argmax(score_dev_list)]
print('best predictor has degree (drum roll)... ', best_degree, '!')

best predictor has degree (drum roll)...  2 !

Clearly, the 6th degree polynomial is over-fitting and the first degree polynomial is under-fitting. But with a large noise magnitude and so little data, it’s not clear whether a second order or third order polnomial will do better. When I run the model, sometimes it prefers the polynomial of degree . Conclusion: there’s no guarantee that we can even recover the model we used to generate the data! That’s a sobering lesson to learn from this example. Machine learning algorithms in general do not always discover the underlying pattern. This is a good analogy to think about even for more complex machine learning models like deep networks.

Before we test our model on the test set, is there something else we can try? Can we do a better job to recover the quadratic model we used to generate the data? Of course! This is where regularization comes in.

Linear predictors are great but they’d be even greater if there is a way we can get them to minimize over-fitting and generalize over the validation set without trying all possible polynomial degrees. To achieve that, we minimize the norm of (by adding it to the original square loss). The norm, , makes the predictor more sparse (sets small coefficients in the polynomial to zero), while the norm makes the predictor less “wiggly” or smoother. Adding a loss term that minimizes the norm is called regularization.

Let’s check out what the norm does. In scikit-learn, the function that does that is Lasso, and you can find more details about it here. The syntax is exactly the same as before but replacing LinearRegression with Lasso

In [16]:
from sklearn.linear_model import Lasso

d = 2

# Split data
X_train, Y_train, X_dev, Y_dev, X_test, Y_test = split_data(x, y)

# Fit model
reg = Lasso(fit_intercept=False)
reg.fit(X_train, Y_train)

# Compute errors
mse_dev = get_error(x_dev, y_dev, reg, d)
mse_train = get_error(x_train, y_train, reg, d)
score_dev = reg.score(X_dev, Y_dev)
score_train = reg.score(X_train, Y_train)

# Print the errors
print('\ndegree = %d'%(d))
print('validation score = %.4f'%( score_dev ))
print('train score = %.4f'%( score_train ))
print('validation MSE = %.4f'%(mse_dev))
print('train MSE = %.4f'%(mse_train))

# Print model
display(Math(latexify_predictor(reg.coef_)))

# Plot results
plot_results(x_train, y_train, x_dev, y_dev, reg, d)

degree = 2
validation score = 0.8533
train score = 0.9523
validation MSE = 8.4324
train MSE = 6.9716

Beautiful! Lasso recovered our model almost perfectly. The motivation for using sparse regularization is Occam’s razor: the simplest explanation is usually the right one. The algorithm found that it only needs one term to fit the data, so it set the other terms to zero. This is the power of adding the norm to the loss. There’s something I ignored when I use Lasso: how much of the norm to include. In other words, what is in ? You will see in the documentation that it is set to by default, but in my experience, you’ll want to include much less than that to avoid making the model too simple. That’s a hyperparameter that you can also loop over and see what works best for your model.

Finally, we can test our model on the test set:

In [17]:
# Print the errors
print('\ndegree = %d'%(d))
print('validation score = %.4f'%( score_dev ))
print('train score = %.4f'%( score_train ))
print('validation MSE = %.4f'%(mse_dev))
print('train MSE = %.4f'%(mse_train))

fig = plt.figure()
ax.plot(x, reg.predict(make_features(x, degree=d)), '--')
ax.plot(x_train, y_train, '.')
ax.plot(x_dev, y_dev, '^', ms=6)
ax.plot(x_dev, reg.predict(make_features(x_dev, degree=d)), '.')
ax.plot(x_test, y_test, '*', ms=6)
ax.plot(x_test, reg.predict(make_features(x_test, degree=d)), '.')

ax.set_xlabel('x')
ax.set_ylabel('y')
ax.legend(['polynomial fit', 'train data', 'dev data', 'dev prediction', 'test data', 'test prediction'])
plt.show()

degree = 2
validation score = 0.8533
train score = 0.9523
validation MSE = 8.4324
train MSE = 6.9716

Adding regularization will also prevent higher order polynomials from over-fitting. Lasso might get rid of all other features except the one you need! This is a teaser. Download the code and try it out yourself.

One way of improving your predictions is to add more data. If you go back and set the data input to a 1000, you’ll see that your results will be much better. The higher dimensional your feature vector, the more data you need. This is particularly the case with neural networks: those beasts are always data-hungry!

#### Conclusion

I encourage you to download the Jupyter notebook and play with it. The only way to learn machine learning is to do it.


text:
# The length of a rectangular piece of carpet is 4 yards greater than the width. How do you express the area of the carpet as a function of the width?

Area (as a fun. of width w) = w^2+4w. sq.yards.
Denote by $w$ the width of the rectangular piece of carpet.
Then, by what is given in the problem, length$= 4 + w i \mathrm{dt} h = 4 + w .$
So the Area = length x width $= \left(4 + w\right) w = {w}^{2} + 4 w$ sq.yrd., as a fun. of width $w$.


text:
# A New Interpretation of Dr. Walter Lewin’s Paradox

Much has lately been said regarding this paradox which first appeared in one of W. Lewin’s MIT lecture series on ##{YouTube}^{(1)}##.  This lecture was recently critiqued by C. Mabilde in a second YouTube video and submitted as a  post in a PF ##{thread}^{(2)}##.  The latter cited the third source, that of K. T. McDonald of Princeton University, as support for Mabilde’s ##{presentation}^{(3)} {and}^{(4)}##.  Finally, Charles Link, PF Homework Helper, and Insight Author posted in Advisory Lounge Inner Circle (#1, May 25, 2018) on the same subject.  Furthermore, several other PF individuals (and probably others still)  have been involved in this topic.

I think a key concept, which none of the three sources mentions, is that there are two ##E## fields running around here.  One is the static field ##E_s## which by definition is conservative and the field lines of which begin and end on charges.  The second is the emf-induced field ##E_m## which is non-conservative in the sense that its circulation is non-zero.  ##E_m## can be created by a chemical battery, magnetic induction, the Seebeck effect, and others.

In the case of Faraday induction its circulation is Faraday’s  ## \frac {-d\phi} {dt} ##. The two fields cancel each other in any loop wire segment but only ##E_s## exists in the resistors.  (This statement assumes negligible resistor body lengths and zero-resistance wires).  The net ##E## field is anywhere and everywhere just ## E = E_s + E_m ##, algebraically summed.

A voltmeter reads the line integral of ##E_s##, not any part of ##E_m##.

For example, in his battery setup  (Fig. 1) Dr. Lewin assumes a net battery ##E## field opposite to the direction of the ##E## field in the resistor.  Yet the battery has two canceling ##E## fields.  ##E_s## points + to – and ##E_m## points – to +. The line integral of ##E_m## over the length of the battery (- to +)  is the emf of the battery.  A voltmeter senses the line integral of ##E_s## only, otherwise the meter would read 0V DC.  The resistor has an ##E_s## field pointing + to -; the circulation of ##E_s## around the loop is zero as required by Kirchhoff’s voltage law.  The circulation of ##E_m##, and thus ##E##, is ##iR##, ##i## being the current and ##R## the resistor.*

Now to address the main topic here, that of the solenoid, the single-turn loop, and voltmeters positioned as shown in Fig. 2. In what follows, loop resistance is again assumed zero.

Let

##\phi## = magnetic flux inside loop,

loop current = ##i##

total loop induced emf = ## \oint \bf E_m \cdot \bf dl ##

then $$E_m = \frac {\frac {-d\phi} {dt}} {2\pi a}$$.

Around the loop with or without the two resistors ##R1## and ##R2## in it, a continuum of ##E_m## field exists throughout the loop, with an ##E_s## field running in the opposite direction.

In the resistors ##E_s## can be very large as ## E_s = iR/d ##  with d the length of each resistor, ##d \ll {2\pi a} ##. All of this follows immediately from the realization that  ##\oint \vec E_s \cdot d \vec l = 0## and the line integral of the two resistors’ ##E_s## fields = ##\mathcal E##, being canceled around the loop by the wire segments’ ##E_s## fields.

Let us next show that a voltmeter as arranged in Fig. 3 and connected at two points a and b along the loop not including a resistor, reads 0V.  That this crucial fact is perhaps paradoxical but entirely logical can be shown as follows:

First, we remind ourselves that ##E_s## and ##E_m## are always equal and opposite in the wire including the shorter section a-b, as well as in the meter leads since a perfect conductor cannot have a net E field.  This is a crucial assumption.

Let

##E_{mw}## = the static field in the meter leads ,

##E_{sw}## = the emf field in the meter leads,

##E_{sv}## = the static field  in the voltmeter,

##E_{mv}## =the emf  field int he voltmeter,

##l_w## = the total meter lead length,

We model the voltmeter as a resistor ##r## of finite physical length ##d##, of arbitrarily high resistance ##r## and  passing correspondingly low current  ##i_v##  with the voltmeter reading ## i_v \cdot r####.

We must then also take cognizance of the fact that, for the voltmeter, ##i_v \cdot r  =  (E_{sv} – E_{mv}) \cdot d ## since ##E_{sv} ## and ##E_{mv} ## oppose. Thus, ##d \cdot E_{sv} = i \cdot r   +   d \cdot E_{mv} ##.

With this in mind, performing the circulation of ##E_s## around the meter circuit,

## +E_{sw} \cdot l_w   +  i_v \cdot r + E_{mv} \cdot d ~  –  ~ E_s\theta a  = 0 ##

The circulation of ##E_m## is also zero since there are no sources of emf within or around that contour:

## E_{mw} \cdot l_w + d \cdot E_{mv}  – E_m \theta a = 0 ##

Combining these last  two, with ##E_{sw} = E_{mw} ## and ##E_s = E_m ## as required,

##i_v\cdot r  = 0,  i_v = 0, VM = 0 ##.

Since VM = 0 for an uninterrupted section of the loop, it follows that the voltage read by a voltmeter probing a length of wire with a resistor ##R## in-between, VM = ##iR## and is not dependent on the length of wire segments surrounding ##R##. This argument includes of course Lewin’s famous A and D points which are located at the top and bottom respectively of the loop as in figs. 2 or 3.

We thus distinguish between VM readings and the so-called “scalar potential” difference which is here ##\int \bf E_s \cdot \bf dl.##  McDonald rightly offers that meter wire coupling is accountable for the difference, which is why he argues for accepting scalar potential differences as the “true” potential difference, not subject to measurement detail.  This is also the explanation offered by Mr. Mabilde. The latter demonstrated an apparently valid way of measuring the scalar potential experimentally with his interior voltage measuring setup, arriving at the correct scalar potential in all cases.  However, his demo is simply a simulation of the Es field profile around the ring, set up by the area of his meter leads..

His statement criticizing Lewin’s “Kirchhoff was wrong” is however spot-on if we understand that the Kirchhoff voltage law applies to voltages in the correct sense of the word, which is the line integral of the Es field only and does not apply to Em fields.

I want to emphasize that the voltmeter readings in Lewin’s setup can be entirely accounted for without splitting the E field into Em and Es.  What I think I contribute is more insight into the observed phenomena.   I believe I have offered a precise explanation for the difference between meter readings and scalar potential differences.  It’s not meter lead dress as suggested by Mr. Mabilde that matters; any meter loop in any orientation will give the same results.  It’s simply ##E_m## and ##E_s## sharing between loops.  As McDonald points out, if you want to avoid the consequences of loop coupling then the meter probes must be connected right at a resistor or the scalar potential difference reading will be wrong since those potentials associated with the loop wiring will not be included..

Lewin did not to my recollection place the VM leads in the middle of the solenoid.  I think we can all accept that the reading would be half-way between -0.1V and + 0.9V, i.e +0.4V.  Reflecting on the numerical mismatch between expected and actual VM readings, we see that the ##R1## meter reading was -0.1V – 0.4V = -0.5V i.e. too negative, while for the ##R2## loop it was +0.9V – 0.4V = +0.5V (too positive).  Now, if we integrate the ##E_s## field over the meter loop with the meter positioned half-way, i.e. directly above, the solenoid, we can sum the line integral of ##E_s## as follows:

## \mathcal E##/2 – ##iR2##  +  VM = 0 or VM  = +0.4V.

Or,  –VM + ##\mathcal E##/2 –##iR1## = 0 also giving VM = +0.4V.  Which agrees with the data.  Suspending the voltmeter with its leads directly above the magnetic source gives the correct voltage.

To summarize, one should be aware of two separate electric fields in the loop and meter lead wiring vs. (essentially) one only in the resistors.  Voltmeters give erroneous voltage readings if the meter circuit forms an alternative path for the Em field, as it does in the Lewin set up and readings.    Coupling effects are predictable and can be shown to be ##E_m## and ##E_s## field sharing between the main loop and the meter loop.  Spurious coupling must be identified and avoided if one wishes to obtain actual scalar potential differences; this may not always be an easy task.

Failure to recognize the two types of ##E## field is bound to lead to confusion or even violation of physics laws in any circuit containing one or more sources of emf, be they batteries, magnetic induction, or any other form of emf generation.

Cf. Stanford Professor Emeritus H. H. Skilling, Fundamentals of Electric Waves, probably out of print but readily available on the Web.

* Footnote added 09/12/2018: since the circulation of the ##E_m## field = ##iR##, by Stokes’s theorem there must also exist net curl within the contour.  If we set up  x-y-z coordinates in fig. 1 with the contour in the x-y plane, x axis at the neg. terminal of the battery, y axis coincident with just inside the battery on its right-hand side, L = battery length neg. to pos. terminal, then ## iR = \oint \vec E_m \cdot d \vec l = \iint_S (\nabla \times \vec E_m) \cdot d \vec A ##.
A curl that satisfies this equation is ## \nabla\times\vec E_m = \frac {\partial E_m} {\partial x}~ {\mathbf k}  = E_m \delta(x)~ {\mathbf k} ##.  Then ## \iint_S (\nabla\times\vec E_m) \cdot d \vec A = \int_{0-}^{L+} E_mL~ \delta(x) \, dx = E_mL ##  as expected.

References:

Tags:
65 replies
1. rude man says:
anorlunda

At minutes 30-35 in the video, he says that Kirchoff's Laws only apply when the external magnetix flux is zero. And since the flux is nonzero in his experiment (assumption #1) you can't use Kirchoff's Laws or circuit analysis to describe that experiment. Well duh. :rolleyes:

Bottom line, you can't say that KVL and KCL apply always.

By the way, be careful when you say you don't agree with those assumptions. They are repeated in many standard textbooks. Peer reviewed journals and standard textbooks are the bible here on PF.Voltage is the line integral of the electrostatic field. And the circulation of that field is zero.
I suggest perusal of the two papers by Princeton's K. McDonald I cited in my Insight article on this subject.
And if I may counter with my own "standard textbook": Fundamentals of Electric Waves by Stanford's H H Skilling. Let me know if you need chapter & pages.

2. anorlunda says:
rude man

The Lewin setup includes time rate of change of magnetic flux outside a conductor being non-zero if I'm interpreting your statement per your intention, yet there Kirchhoff's laws certainly hold.At minutes 30-35 in the video, he says that Kirchoff's Laws only apply when the external magnetix flux is zero. And since the flux is nonzero in his experiment (assumption #1) you can't use Kirchoff's Laws or circuit analysis to describe that experiment. Well duh. :rolleyes:

Bottom line, you can't say that KVL and KCL apply always.

By the way, be careful when you say you don't agree with those assumptions. They are repeated in many standard textbooks. Peer reviewed journals and standard textbooks are the bible here on PF.

3. rude man says:

I think I disagree with your #1. The Lewin setup includes time rate of change of magnetic flux outside a conductor being non-zero if I'm interpreting your statement per your intention, yet there Kirchhoff's laws certainly hold.

I agree with the rest. Quasi-stationariness must be assumed, ortherwise lumped-circuit anaylis laws have to be superseded by Maxwell's equations. A radiating circuit is one example, as is a distributed circuit.

But that is not the discussion here.

4. rude man says:
arydberg

I did this experiment and it shows what Dr. Lewin stated. I took a 500 foot roll of wire used for dog fencing. ( it measured 5 ohms). Unspooled it, Cut it in half and rewound 250 feet back on the spool. I brought out a pigtail and connected it to a 1meg resistor. The other end of the resistor went to the 2nd 250 foot wire. I then wound the 2nd piece on the spool in the same direction. and connected a 100 K resistor to the beginning and end of the coil.

I put 2 strong magnets in the center of the coil and snatched them away and got a pulse on my Oscilloscope. The pulse on the 1 meg resistor was 10 times that on the 100 K resistor. I have 2 pictures and hopefully included them.Dr. Lewin's data was never in contention. That was not the issue. It's his explanations that were wrong, in particular the statement that "Kirchhoff was wrong". Kirchhoff's laws hold in all cases. They refer to voltage drops, which is not necessarily the same as measurements using voltmeters.

A voltmeters always correctly measures the voltages it "sees" but this voltage can be artificially induced by the voltmeter and its leads and is thus not the voltage in the absence of the voltmeter and its leads. For example, in Lewin's setup there is a voltage between any two points along a wire not including a resistor, yet the voltmeter reads zero.

The sum of voltages along any closed path is always zero irrespective of the nature of the emf generating them.

5. arydberg says:

I did this experiment and it shows what Dr. Lewin stated. I took a 500 foot roll of wire used for dog fencing. ( it measured 5 ohms). Unspooled it, Cut it in half and rewound 250 feet back on the spool. I brought out a pigtail and connected it to a 1meg resistor. The other end of the resistor went to the 2nd 250 foot wire. I then wound the 2nd piece on the spool in the same direction. and connected a 100 K resistor to the beginning and end of the coil.

I put 2 strong magnets in the center of the coil and snatched them away and got a pulse on my Oscilloscope. The pulse on the 1 meg resistor was 10 times that on the 100 K resistor. I have 2 pictures and hopefully included them.

6. rude man says:

You are referring to the electric field "inside the conductor". The "inside the conductor" part was not clearly stated. (Outside the conductor, the electric fields do not cancel).No I'm not. I'm referring to the net axial E field, comprising equal and opposite ##E_m## and ##E_s## fields. Shouldn't be much argument as to what "axial" means IMO.

The E field in the wire is zero if the wire has zero resistance and is entirely ##E_m## if the resistance is finite.

7. rude man says:
vanhees71

Why is ##-vec{nabla} phi## necessarily 0? In my opinion the problem description is to incomplete to make a statement about the source part of ##vec{E}## simply because the sources of the em. field are not specified.Referring back to post 22, I was referring to the circular E fields within the solenoid, which are in air, for which obviously there can be no static component, ergo no potential gradient.

If you're thinking of the axial E fields along the solenoid – there are two E fields, one is emf-generated and one is static. They cancel each other so there is no net axial E field in the solenoid.

8. vanhees71 says:

That's not precisely the one I meant, but it seems to be good too (I'll watch it completely later this weekend). What I had in mind was a collection of an entire introductory experimental physics course with a lot of experiments done by Lewin in the lectures. Originally it was at MIT, but it's also still on Youtube, as your link shows. I think, this one is the movie I had in mind:

9. vanhees71 says:

BTW: This also applies to Walter Lewin's paradox either, and this is a kind of paradox which can be even easier avoided than the twin paradox, because it's due to sloppy language, i.e., because some people call an EMF a voltage, although a voltage is a potential difference. As Faraday's Law, ##vec{nabla} times vec{E}=-partial_t vec{B}## explicitly states (again math is your friend) this is precisely a situation where the fundamental concept is that ##vec{E}## in this case has no potential and thus that line integrals between two points are path dependent, and that's also very nicely explained by Lewin in his famous lectures (I hope they are still available on Youtube although he stupidly ruined his reputation by stupid emails to students).

10. vanhees71 says:

I see what you mean now. You want to calculate ##vec{E}## in the hand-waving way how sometimes the electric field of a statically charged sphere or infinitely long cylinder is calculated by making use of the integral laws. Well, this is only possible for very very symmetric situations and a solid portion of physics intuition not to make mistakes with hand-waving arguments. In general, this is something for magician genisuses rather than us usual mortals, who better use math. Of course, for sufficiently symmetrical problems the math becomes usually very simple, as this example shows.

Another observation is that almost everything which is dubbed "a paradox" in physics is simply due to the fact that some people rather obscure the didactics by trying to avoid math, making the understanding of the problem at least difficult if not impossible and then leading to apparent contradictions. The prime example is the so-called twin paradox, usually presented in the first few lectures about special relativity, instead of simply stating that an ideal clock always shows its proper time. It's anyway wrong to present special relativity as a collection of apparent paradoxes rather than stressing that it resolves the paradoxes of Newtonian physics, but that's another topic.

11. vanhees71 says:
rude man

@Charles, that is what I responding to. I think you're right, you can't assume symmetry of the E field around the off-axis solenoid; all you can assume is the circulation of E = -d(phi)/dt. And as I said it's like trying to apply Ampere's law to a finite wire: the circulation of H = I always, but that H is not uniform around any circular path. I remember getting faked out (temorarily only of course ha ha) just this way.

As far as vanHees' post is concerned, there is no E[SUB]s[/SUB] field anywhere around your path so the gradient term -∇Φ is zero so that does not seem to offer any further enlightenment. I can only think that you have to solve ∇xE = ∇xE[SUB]m[/SUB] at every point along your chosen path which is probably prohibitively difficult.

In your case, going with polar coordinates, ∇xE = [∂E[SUB]φ[/SUB]/∂r+ E[SUB]φ[/SUB]/r – (1/r) ∂E[SUB]r[/SUB]/∂φ] k = -∂B/∂t. With the third term on the LHS non-zero plus the boundary values that would be more than the feeble math knowledge of a dumb EE like myself could handle!

EDIT :even if your path doesn't include any B so that ∂B/∂t = 0 the problem is probably not much easier!Why is ##-vec{nabla} phi## necessarily 0? In my opinion the problem description is to incomplete to make a statement about the source part of ##vec{E}## simply because the sources of the em. field are not specified.

Yes, thank you, I have completely solved this one. I do believe I have seen textbooks that present the problem of a uniform ## frac{dB}{dt}=beta ## into the plane of the paper and ask you to compute ## E ## around an arbitrary circle. ## \ ## The long solenoid with current ## I(t)=alpha t ## does have uniform ## frac{dB}{dt}=beta ##, (in the ## hat{z} ## direction), throughout its interior. The surprising thing is it is incorrect to pick an arbitrary circle to compute ## E ## and assume uniformity of ## E ##. The circle must be centered on the axis of the solenoid, or ## E ## is not constant, (in the ## hat{a}_{phi}## direction), around the circle. The computation of the EMF ## mathcal{E}=oint E cdot dl ## works, but a uniform ## frac{dB}{dt} ##, surprisingly, doesn't have sufficient symmetry to compute ## E ## from the uniform ## frac{dB}{dt} ## inside the circle. ## \ ## The ## E ## gets computed everywhere by drawing circles of varying radii, that are all centered on the axis of the solenoid. For these circles, ## mathcal{E}=oint E cdot dl=2 pi , r , E(r) =-pi r^2 frac{dB}{dt}=-beta pi r^2 ##.Let's see again. I still don't get this obvious contraction of fundamental math, in this case Stokes's integral theorem.

Let's do it once more: As usual, the local treatment is the most simple approach. You have given the (approximate) magnetic field
$$vec{B}=beta t vec{e}_3.$$
Then we have
$$vec{nabla} times vec{E}=-partial_t vec{B}=-beta vec{e}_3.$$
The solution of this is
$$vec{E}=-beta vec{r} times vec{e}_3-vec{nabla} Phi,$$
where ##Phi## is undetermined since the sources are not given.

For the EMF this is of course unimportant since any closed-loop integral over a gradient in a simply connected region (which is the case for the interior of the solenoid you are discussing) gives zero. Thus we have
$$int_{partial A} mathrm{d} vec{r} cdot vec{E}=int_{A} mathrm{d}^2 vec{f} cdot (vec{nabla} times vec{E}) = -int_{A} mathrm{d}^2 vec{f} cdot beta vec{e}_3.$$
For any (!!!) circle of radius ##R## parallel to the ##x_1 x_2## plane completely in the interior of your solenoid gives thus ##-pi beta R^2##. What's, in your opinion, wrong with this simple argument?

12. vanhees71 says:
rude man

@Charles, that is what I responding to. I think you're right, you can't assume symmetry of the E field around the off-axis solenoid; all you can assume is the circulation of E = -d(phi)/dt. And as I said it's like trying to apply Ampere's law to a finite wire: the circulation of H = I always, but that H is not uniform around any circular path. I remember getting faked out (temorarily only of course ha ha) just this way.

As far as vanHees' post is concerned, there is no E[SUB]s[/SUB] field anywhere around your path so the gradient term -∇Φ is zero so that does not seem to offer any further enlightenment. I can only think that you have to solve ∇xE = ∇xE[SUB]m[/SUB] at every point along your chosen path which is probably prohibitively difficult.

In your case, going with polar coordinates, ∇xE = [∂E[SUB]φ[/SUB]/∂r+ E[SUB]φ[/SUB]/r – (1/r) ∂E[SUB]r[/SUB]/∂φ] k = -∂B/∂t. With the third term on the LHS non-zero plus the boundary values that would be more than the feeble math knowledge of a dumb EE like myself could handle!

EDIT :even if your path doesn't include any B so that ∂B/∂t = 0 the problem is probably not much easier!Why is ##-vec{nabla} phi## necessarily 0? In my opinion the problem description is to incomplete to make a statement about the source part of ##vec{E}## simply because the sources of the em. field are not specified.

13. rude man says:

I think we are very fortunate in this case to have a long solenoid, with current ## I(t)=alpha , t ##, that is able to generate exactly what we need in terms of a uniform B with a ## frac{dB}{dt}=## constant, into the paper, so that we have a practical apparatus to make such a magnetic field. Otherwise it becomes a case where the EMF can be computed from Faraday's law, but not the electric field ## E ##. ## \ ## I do think it is likely the solenoidal geometry proved very important for Faraday and others in coming up with the understanding of magnetism that we presently have. ## \ ## It is not immediately obvious from Biot-Savart or Ampere's law, but detailed calculations do show that ## B ## is completely uniform inside a long solenoid with ## B=mu_o , n , I , hat{z} ##.If the contour and B field are circular and concentric, you can compute the E field everywhere along the contour, whether the contour is inside or outside the B field (solenoid).

If the path is irregular and the B field is circular you can use your variable-radius technique to determine E everywhere along the contour.

Agreed?

14. rude man says:

I agree with what you say. I still don't see why it's surprising. Interesting but not surprising. I don't think I would ever have assumed otherwise even before your posts but who knows. I cite again the analogy with Ampere's law (mis)applied to a finite-length wire. Circulation of H: check. Detailed knowledge of H: X. In the ampere case the finite length of wire must produce a B field from the returning wiring which distorts the H field. And so with an external B field generating separate E fields which will distort the symmetry of the local E field. Quite complementary, looks like.

Given an arbitrary configuration of the B field covering and surrounding your closed path would mean solving for E[SUB]r[/SUB] and E[SUB]φ[/SUB] in Maxwell's equation which would be hard or impossible in closed form. In any case I fail to see what's surprising about the non-uniform E field.

15. rude man says:

Anyway, my equation in post 26 must apply and is valid irrespective of surroundings. The thing is you know dB/dt everywhere along the closed circular path but you'll never find the boundary values on E[SUB]φ[/SUB] and E[SUB]r[/SUB]. Or so I think.

16. rude man says:

So you assume a B field with finite extent and a circular path somewhere within that field?

17. rude man says:

Great idea, using varying radii about the B field center to find the E field anywhere around any contour! But that still assumes a circular B field, doesn't it? Of course, that's what you get with your long solenoid. Anyhow, you thereby answered your question and why does the lack of symmetry surprise you? Varying radii will give varying E field magnitudes and directions as you go around your contour, right? Nothing symmetrical there.

18. rude man says:

@vanhees71 @rude man Please see the "Edit" at the bottom of post 22=that is the solution to this problem that puzzled me.@Charles, that is what I responding to. I think you're right, you can't assume symmetry of the E field around the off-axis solenoid; all you can assume is the circulation of E = -d(phi)/dt. And as I said it's like trying to apply Ampere's law to a finite wire: the circulation of H = I always, but that H is not uniform around any circular path. I remember getting faked out (temorarily only of course ha ha) just this way.

As far as vanHees' post is concerned, there is no E[SUB]s[/SUB] field anywhere around your path so the gradient term -∇Φ is zero so that does not seem to offer any further enlightenment. I can only think that you have to solve ∇xE = ∇xE[SUB]m[/SUB] at every point along your chosen path which is probably prohibitively difficult.

In your case, going with polar coordinates, ∇xE = [∂E[SUB]φ[/SUB]/∂r+ E[SUB]φ[/SUB]/r – (1/r) ∂E[SUB]r[/SUB]/∂φ] k = -∂B/∂t. With the third term on the LHS non-zero plus the boundary values that would be more than the feeble math knowledge of a dumb EE like myself could handle!

EDIT :even if your path doesn't include any B so that ∂B/∂t = 0 the problem is probably not much easier!

19. rude man says:

Charles Link@vanhees_71 What happens if we choose a circle that does not have the origin at the center? Does that mean the symmetry of ## E ## around the circle is no longer applicable?You mean with a circular B field centerd at the origin I assume. I would think the symmetry is then shot. The only guarantee is in the form of the circulation of E, not symmetry of E.. LIke trying to apply Ampere's law to a finite-length wire.

In ##∇xE = – ∂B/∂t ## with ## E = E[SUB][/SUB][SUB]m[/SUB] + E[SUB][/SUB][SUB]s[/SUB] ## the ## E[SUB]s[/SUB] ## of course does not contribute to the curl. ## E[SUB]s[/SUB] ## is the ## -∇φ ## of post 19 ## .
##
BTW about your two circles touching – I offhand would say there is no effect on either ring after contact is made. Each ring has its E[SUB]m[/SUB] field in the same counterclockwise direction. At the point of contact the fields cancel but I see no issue with this. E fields, both emf and static, can exist alongside, linearly augmenting or canceling each other to some extent. 'Bout all I have to say I guess.

20. vanhees71 says:

I still don't get your problem. Obviously your electric field is fulfilling Faraday's Law (maybe I misunderstand your undefined notation again since you don't tell what ##vec{j}## is; I don't see any current density explicitly mentioned in the problem).

$$vec{E}=-1/2 vec{r} times vec{beta}-vec{nabla} phi = -beta/2(x_2,-x_1,0).$$
If I understand you right, we suppose ##vec{beta}=beta vec{e}_3## and
Circle 1 is parametrized by
$$vec{r}(varphi)=(R cos varphi,R sin varphi,0).$$
The gradient part vanishes when integrated over the closed circle (since there shouldn't be any further "potential vortex like" singularities in this part). Thus we have
$$int_{C_1} mathrm{d} vec{r} cdot vec{E}=int_{0}^{2 pi} mathrm{d} varphi frac{mathrm{d} vec{r}}{mathrm{d} varphi} cdot vec{E} = pi R^2 beta.$$
For Circle 2 you have
$$vec{r}=(R cos varphi,R sin varphi,0)+(2R,0,0).$$
Since the electric field is assumed to be homogeneous in the entire range of consideration the evaluation of the EMF is literally the same as for circle 1 and thus of course yields the same result. You can of course also integrate the magnetic field over the corresponding circular disk, showing that everything is consistent also with the integral form of Faraday's Law as it must be thanks to Stokes's integral theorem.

21. vanhees71 says:

There's nothing wrong with your calculation. If the field is homogeneous in the region you get of course always ##-beta A##, provided you integrate over a plane area perpendicular to ##vec{beta}##. So I don't understand your statement that you get something else for another circle. As long as you are in the region where the fields are homogeneous, there's no difference where you put the origin of the circle (it only must be entirely in the region where the fields are homogeneous).

Of course, this is just math. It's hard to imagine how to produce such fields in reality.

22. vanhees71 says:

Of course only knowing ##vec{nabla} times vec{E}## is not sufficient to calculate the field. It determines the field only up to a gradient. I'm not sure, whether this is a sound example, because it's not clear to me whether your setup fulfills all of Maxwell's equations. Only solutions that fulfill all Maxwell equations are consistent in describing a situation.

I also don't understand the very beginning of your argument.

Suppose (without thinking much about the physicality of the assumptions) there's a region, where
$$vec{B}=vec{beta} t$$
with ##vec{beta}=text{const}##. You get
$$vec{nabla} times vec{E}=-vec{beta}=text{const}.$$
This implies
$$vec{E}=frac{1}{2} vec{r} times vec{beta} -vec{nabla} phi$$
for an arbitrary scalar field ##phi##.

Up to this gradient the electric field is unique, and thus also the EMF is uniquely defined for any closed loop, giving by construction the ##-dot{Phi}## with the flux according to this loop. Maybe I simply misunderstand your description. Perhaps you can give your concrete calculation to look into the issue further.

23. rude man says:

Hi
In figure 2 inside the resistors, do the Em and Es fields add and help rather than oppose like they do in the connecting wire?

The answer is yes, they are both clockwise in the figure. E[SUB]m[/SUB] is always clockwise but in a resistor the E[SUB]s[/SUB] field points + to – so they add.
Line-integrated E[SUB]m[/SUB] will be small, especially if the resistor is short, but line -inegrated (E[SUB]s[/SUB] + E[SUB]m[/SUB]) = iR so you can see that E[SUB]s[/SUB] is the dominant field in R.

24. rude man says:

I have made some emendations to the original blog. Aside from a few typo corrections etc. I have simplified the math and removed the assumption of finite resistor and meter physical dimensions which were implicit in the original version.

25. rude man says:

@rude man The EMF from a battery seems to be of a slightly different nature than the EMF of Faraday's law. I was trying to come up with an analogy that might describe the type of mechanism involved where the chemical reactions create a potential difference resulting in an electrostatic field: One perhaps related mechanism would be a spring system that pushes apart positive and negative charges: e.g. You could have two capacitor plates, initially at ## d=0 ## with one having positive charge and the other negative charge. The spring system could supply energy to push them apart and create a voltage. In this case, electrostatic fields would be generated having ## oint E_s cdot ds =0 ##. The force from the spring is quite localized and is essentially in the form of an EMF. The external loop could be completed between the two plates with a large resistor that could essentially be the resistance of a voltmeter. ## \ ## Once again, the equations are quite similar, and agree with the concept your Insights article promotes, that the voltmeter actually measures the integral of the electrostatic field ## E_s ## external to the battery. Sounds good.
Somewhere I mentioned another analogy I liked, given by Prof. Shankar of Yale. He likened the process to a ski lift; you need force (Em) to overcome gravity (Es) to get from the bottom to the top, then you ski down the slope (current thru the resistor) but you bump into trees along the way (heat dissipation) so when you get to the bottom you have zero k.e. Then you repeat the process. He mentions this analogy again later when he discusses induction so I still think the two are very much the same thing except as you point out a real battery has internal resistance in which case the Es field has to be reduced from |Em| to allow for the excess Em to push the charges thru the internal R.

I highly recommend Prof. Shankar's youtube lectures. I have picked up a lot from them and am still absorbing.

Thanks for continuing the discussion!

26. rude man says:


text:
# Alternative to \SwapAboveDisplaySkip for AMSmath equation environment?

I need to use the amsmath equation environment as the outer environment within which the inner aligned environment is used for 2 equations aligned at the = symbol. I did this to obtain a common/single equation number for both of these equations.

However, this leaves too much space above and below and looks too loosely typeset with respect to surrounding paragraphs. This is especially bad in my case since I need to use double-spacing.

I do not want to manually remove spaces by using \vspace commands. This is because I cannot figure out how much space needs to be removed if I need to change the font or convert the document from 12pt to 11pt etc (and I suspect it is not a good practice anyway).

I think the \SwapAboveDisplaySkip command from the mathtools package comes in handy. But the manual clearly says that it does not work with the amsmath equation environment. I nevertheless tried it and as expected, ran into errors such as

Misplaced \noalign.....

What would be a viable workaround for this scenario?

You have, from nccmath, \useshortskip. Contrary to \SwapAboveDisplaySkip, it has to placed before entering the environment:

\documentclass{article}
\usepackage{mathtools, nccmath}

\begin{document}

The discriminant of the cubic equation $\,x^3 + px + q = 0$ is
$$\Delta = 4p^3 + 27 q^2.$$

The discriminant of the cubic equation $\,x^3 + px + q = 0$ is \useshortskip
$$\Delta = 4p^3 + 27 q^2.$$

\end{document}

• Thank you. That does work indeed. But I see that nccmath is an old package and not really maintained anymore. Is there a modern replacement? – Dr Krishnakumar Gopalakrishnan Apr 28 '18 at 14:09
• I don't know really, but it's a package I use regularly, as it has some very handy macros (medium-sized fractions, in particular and an optional spacing argument for \intertext, in particular ). – Bernard Apr 28 '18 at 14:23

As far as I can tell equation with aligned inside will use the short above display skip when appropriate. If you really want access to \SwapAboveDisplaySkip to do this manually you can replace the outer equation by a gather:

\documentclass{article}

\usepackage{mathtools}

\begin{document}
Some text before our equations to demonstrate vertical spacing is this
one context:
\label{eq:x} \begin{aligned} a &= b\\ c &= d \end{aligned}
Some text before our equations to demonstrate vertical spacing is this
further context:
\begin{gather}
\label{eq:y}
\begin{split}
a &= b\\
c &= d
\end{split}
\end{gather}
Some text before our equations to demonstrate vertical spacing is this
further context:
\begin{gather}
\SwapAboveDisplaySkip
\label{eq:y}
\begin{split}
a &= b\\
c &= d
\end{split}
\end{gather}

\end{document}