Import Chrome bookmarks to Safari under iOS

Choose a random number between 1 and X (thereby avoiding 0) and multiply it with 1 or -1 based on a uniform distribution (thereby obtaining a sign):

enter image description here

\documentclass{article}

\usepackage{tikz}
\pgfmathsetseed{\number\pdfrandomseed}

\newcommand{\InitVariables}{%
  \pgfmathsetmacro{\a}{int(ifthenelse(rand > 0, 1, -1)*random(1,5))}%
}

\begin{document}

\foreach \x in {1,...,100}{\InitVariables$\a$ }

\end{document}

The first calculation only chooses the number of random values that are needed. The inclusive range [-5, 5] without 0 has 10 values.

\pgfmathsetmacro{\a}{random(0,9)-5}% range [-5, 4]

Then the negative values are in the correct range. The non-negative values are increased by one to move the range [0, 4] to [1, 5].

\pgfmathsetmacro{\a}{int(ifthenelse(\a<0, \a, \a + 1)}%

Full example:

\documentclass{article}
\usepackage{pgf}
\usepackage{pgffor}
\pgfmathsetseed{\number\pdfrandomseed}

\newcommand{\InitVariables}{%
  \pgfmathsetmacro{\a}{random(0,9)-5}%
  \pgfmathsetmacro{\a}{int(ifthenelse(\a<0, \a, \a + 1)}%
}

\begin{document}

\noindent
\foreach \i in {0, ..., 200} {%
  \InitVariables
  \a\space
}

\end{document}

Result

Version with the minimum and maximum values as macros:

\documentclass{article}

\usepackage{pgf}
\usepackage{pgffor}
\pgfmathsetseed{\number\pdfrandomseed}

\newcommand*{\RandomMinimum}{-300}
\newcommand*{\RandomMaximum}{700}

\newcommand*{\InitVariables}{%
  \pgfmathsetmacro{\a}{%
     \RandomMinimum + random(0, int(\RandomMaximum - int(\RandomMinimum)))
  }%
  \pgfmathtruncatemacro{\a}{ifthenelse(\a<0, \a, \a + 1}%
}

\begin{document}

\noindent
\foreach \i in {0, ..., 200} {%
  \InitVariables
  \a\space
}

\end{document}

Result


In no case would a coil driven at resonance be better than one driven with DC.
This is presuming that the job of the coil is to make a magnetic field, and that this requirement exists regardless of how the coil is driven.

Given the above, one way or another current must be kept flowing thru the coil to produce the desired result. That means energy will be wasted due to the I2R losses. This means you want the lowest RMS current that still causes the desired magnetic field, no matter how that current is caused by the circuit external to the coil.

With DC, you can supply exactly that current that causes the Amp*turns of magnetic field you require. The ratio of RMS current to minimum possible current is 1.

Even if you don't care about the polarity of the magnetic field, you still have to have the same average(abs(current)) from whatever waveform you use. If that is anything other than a flat line (DC), the RMS(current) will be higher than the average(abs(current)) that drives the magnetic field. However, the I2R power losses use the RMS value for I.

I think you are considering resonance because you envision recycling the energy already in the coil. While resonance does make it possible to save the energy from one cycle and use it again on the next, it can't get around the basic physics of the I2R losses. Resonance is really a trick of the driving circuitry, not anything the coil itself "sees". Note that with a good DC driving system, the energy already in the inductance is continuously re-used. Only the energy to overcome the I2R loss is added over time.

You might also be thinking you are saving power by lowering the resistance, hence lower I2R losses. That is true, but applies just as well to any drive waveform. For example, a good buck converter would draw less current from its source to drive a solenoid of lower R to the same current as one with higher R. The power savings of lower R is passed on to the upstream power source.

Lets look at the extreme of a super-conducting solenoid with 0 DC resistance. You can say that with a efficient capacitor, you can keep the solenoid engaged by it being part of a tank circuit. Ideally, no additional input power is need to keep the solenoid engaged. However, the same savings applies to simply shorting the solenoid once the desired current is built up. The current would circulate forever and produce a permanent magnetic field.

There is no need to slosh the energy back and forth between a capacitor and the inductor to save it. You can simply leave it in the inductor just as well. The latter is simpler, allows for easier and more efficient drive circuitry, and is more optimum in terms of I2R losses in the solenoid.

Example

Let's say a solenoid requires 100 mA to be maintained to perform whatever its desired operation is. Magnetic polarity doesn't matter. The coil has a DC resistance of 50 Ω.

With 100 mA DC thru the coil, it dissipates (100 mA)2(50 Ω) = 500 mW.

Let's compare that to driving the coil with a sine wave. We'll analyze one half wave of the sine. The average of a sine from 0 to Π is 2/Π = 0.637. The peaks would therefore need to be Π/2 = 1.571 of the average, or 157 mA. The RMS of this sine is 1/sqrt(2) of the peak = 111 mA. The I2R loss is thus (111 mA)2(50 Ω) = 617 mW.

There simply is no way to cheat this basic physics of power dissipated in the coil itself.

This says nothing about losses in the driving circuitry. In some cases, a particular waveform may be produced more efficiently than another resulting in lower overall system losses with a sine. However, that still has to overcome the inherent higher efficiency of DC thru the coil to produce the same average magnetic field magnitude.

Circuits to produce DC are usually easier to make efficient than ones that produce AC, so finding a win with AC would be unusual in practice. I just don't see a win with AC, whether maintained by resonance or not, in any normal case.

Response to comment

For a DC solenoid, once the current is established the losses are purely I2R, say 50R. For a resonant solenoid, for the same supply voltage you can make use of the resonant impedance design to establish the same effective I for the same given supply voltage (again say 50R ignoring the time averaging effects). However, in the latter case the R is MUCH less (Say 2R), and I2R losses are less too. IV is of course the same, however, in the resonator, the current is only supplied briefly at the peaks of the resonance so total power is reduced.

I may be starting to see what you are getting at. You want to use the reactance of the coil to allow driving it with a reasonable voltage, whereas that same DC voltage would cause way too much current. The coil will be made to minimize DC resistance so the reactance would dominate.

Yes, the I2R losses would be lower, but that's purely due to the lower R, not the fact that the driving waveform is a sine, or that you use resonance to capture energy from one cycle to re-energize the solenoid on the next cycle.

It seems your concept comes down to two points:

  1. Wind the coil so that its inductance dominates for useful driving frequencies. This includes making the DC resistance low.

  2. Use resonance to capture the energy from one cycle and then be able to restore that energy into the coil on the next cycle. The only net power input to this system is to overcome the I2R losses, which would be a short blip each cycle.

OK, both those strategies work in isolation, but still don't make AC drive, even if perfectly resonant, better than DC drive.

The real savings in power comes from the lower DC resistance. That's definitely a good thing do to power-wise. The reason solenoids aren't made with arbitrarily low resistance is that it costs both money and size.

Imagine some arbitrary solenoid with N turns, R resistance, and I current is required to activate it. Now go thru the thought process of halving the resistance. You can start out by doubling the wire cross-section area. Now the wire has R/2 but twice the copper costs. You now wind the same number of turns and you've got your R/2 solenoid, although the coil takes up twice the volume as before.

But let's say you try to get clever and think "Wait, I'll just use half the length of wire and change the spec to twice the current". That gets you the same magnetic field in the same space for the same amount of copper. Even better, you now have R/4.

Unfortunately though, the power lost in the resistance is proportional to the square of the current. You have 1/4 the resistance, but twice the current. In the end, you have the same dissipation as before, just a coil that runs at half the current and twice the voltage but the same power.

This was all a long-winded way to show that your point #1 is fine, but economic and space constraints make you pick a tradeoff somewhere.

In the end none of this matters for evaluating resonant drive versus DC drive. One way or another, you have a coil with a certain DC resistance, and a certain inductance, that requires a certain average current to operate. The square of that current times the resistance is power loss you can't make go away.

Resonance is merely one means of making AC drive as efficient as possible. It does not make AC drive more efficient than DC drive. I showed above how sine drive always results in higher loss in the solenoid than DC drive.

So sloshing energy between the coil and a capacitor is a clever way to not loose the whole energy each cycle, but it is even more efficient to never move the energy out of the coil in the first place. Even if your resonance mechanism is 100% efficient, it will always have the inherent 23.4% higher power loss of sine drive relative to DC drive.

Your scheme would be useful if it were difficult to make efficient DC drive circuits compared to AC resonant circuits. However, the reverse is probably more true. Switching power supplies with fixed DC voltage or current output are relatively easy to make efficient. This is especially true of driving a solenoid, where the coil can be used as the inductor of the switching power supply.

Flipping the efficiencies around, DC drive dissipates 81% of the power of sine drive in the solenoid. Put another way, any DC supply more than 81% efficient inescapably beats any AC drive, no matter how efficient, and whether it uses resonance or not.