text:
## Weller correlation

https://doi.org/10.1351/goldbook.W06671
Empirical correlation for the energy of full charge-transfer @[email protected] relative to the @[email protected] in n-hexane as a function of the electrochemical one electron standard reduction potential of the @[email protected] produced upon electron donation and standard reduction potential of the acceptor measured in a @[email protected] for the donor (D) and the acceptor (A) involved $\Delta H(\text{D}^{+}\text{A}^{-},\text{hexane}) = e\left [ E^{0}(\text{D}^{+\bullet }/\text{D}) - E^{0}(\text{A}/\text{A}^{-\bullet }) \right ]+e\Delta E$ with $$E^{0}(D^{+\bullet }/D)$$ and $$E^{0}(A/D^{-\bullet })$$ the standard electrode potentials of the donor and acceptor, respectively.
Notes:
1. In the case diethylaniline as donor and aromatic @[email protected] as acceptors, the last term on the right, i.e., $$e\Delta E = (0.15 \pm 0.10)\ \text{eV}$$. This equation assumes a constant @[email protected] term and a constant @[email protected] change within a particular series of partners. $$e$$ is the @[email protected]
2. The IUPAC recommendations for the sign and symbols of standard potentials are used in the equation as written above.
3. Although not complying with the IUPAC recommended nomenclature for the standard electrode potentials, traditionally the equation has been written as: $\Delta H(\text{D}^{+}\text{A}^{-},\text{hexane}) = e\left [ E_{\text{ox}}^{0} - E_{\text{red}}^{0} \right ]+(0.15 \pm 0.10)\ \text{eV}$ with $$E_{\text{ox}}^{0}$$ the @[email protected] at which the @[email protected] occurs, and $$E_{\text{red}}^{0}$$ the @[email protected] at which the reduction occurs. This writing of the first term within the square brackets is misleading and not recommended.
Source:
PAC, 2007, 79, 293. (Glossary of terms used in photochemistry, 3rd edition (IUPAC Recommendations 2006)) on page 439 [Terms] [Paper]


text:
## ratio-of-uniforms [#4]

Posted in Books, pictures, R, Statistics, University life with tags , , , , on December 2, 2016 by xi'an

Possibly the last post on random number generation by Kinderman and Monahan’s (1977) ratio-of-uniform method. After fiddling with the Gamma(a,1) distribution when a<1 for a while, I indeed figured out a way to produce a bounded set with this method: considering an arbitrary cdf Φ with corresponding pdf φ, the uniform distribution on the set Λ of (u,v)’s in R⁺xX such that

0≤u≤Φοƒ[φοΦ⁻¹(u)v]

induces the distribution with density proportional to ƒ on φοΦ⁻¹(U)V. This set Λ has a boundary that is parameterised as

u=Φοƒ(x),  v=1/φοƒ(x), x∈Χ

which remains bounded in u since Φ is a cdf and in v if φ has fat enough tails. At both 0 and ∞. When ƒ is the Gamma(a,1) density this can be achieved if φ behaves like log(x)² near zero and like a inverse power at infinity. Without getting into all the gory details, closed form density φ and cdf Φ can be constructed for all a’s, as shown for a=½ by the boundaries in u and v (yellow) below

which leads to a bounded associated set Λ

At this stage, I remain uncertain of the relevance of such derivations, if only because the set A thus derived is ill-suited for uniform draws proposed on the enclosing square box. And also because a Gamma(a,1) simulation can rather simply be derived from a Gamma(a+1,1) simulation. But, who knows?!, there may be alternative usages of this representation, such as innovative slice samplers. Which means the ratio-of-uniform method may reappear on the ‘Og one of those days…

## asymptotically exact inference in likelihood-free models [a reply from the authors]

Posted in R, Statistics with tags , , , , , , , , , , , , , , , , , on December 1, 2016 by xi'an

[Following my post of lastTuesday, Matt Graham commented on the paper with force détails. Here are those comments. A nicer HTML version of the Markdown reply below is also available on Github.]

Thanks for the comments on the paper!

A few additional replies to augment what Amos wrote:

This however sounds somewhat intense in that it involves a quasi-Newton resolution at each step.

The method is definitely computationally expensive. If the constraint function is of the form of a function from an M-dimensional space to an N-dimensional space, with MN, for large N the dominant costs at each timestep are usually the constraint Jacobian (c/u) evaluation (with reverse-mode automatic differentiation this can be evaluated at a cost of O(N) generator / constraint evaluations) and Cholesky decomposition of the Jacobian product (c/u)(c/u) with O(N³) cost (though in many cases e.g. i.i.d. or Markovian simulated data, structure in the generator Jacobian can be exploited to give a significantly reduced cost). Each inner Quasi-Newton update involves a pair of triangular solve operations which have a O(N²) cost, two matrix-vector multiplications with O(MN) cost, and a single constraint / generator function evaluation; the number of Quasi-Newton updates required for convergence in the numerical experiments tended to be much less than N hence the Quasi-Newton iteration tended not to be the main cost.

The high computation cost per update is traded off however with often being able to make much larger proposed moves in high-dimensional state spaces with a high chance of acceptance compared to ABC MCMC approaches. Even in the relatively small Lotka-Volterra example we provide which has an input dimension of 104 (four inputs which map to ‘parameters’, and 100 inputs which map to ‘noise’ variables), the ABC MCMC chains using the coarse ABC kernel radius ϵ=100 with comparably very cheap updates were significantly less efficient in terms of effective sample size / computation time than the proposed constrained HMC approach. This was in large part due to the elliptical slice sampling updates in the ABC MCMC chains generally collapsing down to very small moves even for this relatively coarse ϵ. Performance was even worse using non-adaptive ABC MCMC methods and for smaller ϵ, and for higher input dimensions (e.g. using a longer sequence with correspondingly more random inputs) the comparison becomes even more favourable for the constrained HMC approach. Continue reading

## sampling by exhaustion

Posted in Books, Kids, R, Statistics with tags , , , , on November 25, 2016 by xi'an

The riddle set by The Riddler of last week sums up as follows:

Within a population of size N, each individual in the population independently selects another individual. All individuals selected at least once are removed and the process iterates until one or zero individual is left. What is the probability that there is zero individual left?

While I cannot see a clean analytical solution to this problem, it reminds me of an enveloppe-versus-letter (matches) problem I saw in graduate school. Indeed, the expected number of removed (or selected) individuals is given by

$N\left\{1-\frac{N-2}{N-1}\right\}^{N-1}$

which is equivalent to (1-e⁻¹)N for N large, meaning that the population decreases by an average factor of e⁻¹ at each round. And that it takes on average approximately log(N) iterations to reach a single individual. A simulation of the first probabilities of ending with one individual led me to the above curve, which wiggles in an almost periodic way around the probability ½, equal to the average of those probabilities. Using the R code

rad=function(N){#next population size
ut=sample(rep(2:N,2),1)
for (i in 2:N)#sampling
ut=c(ut,sample(rep((1:N)[-i],2),1))
return(N-length(unique(ut))}
sal=rep(0,m);sal[1]=1
for (N in 3:M){
prop=0;
for (t in 1:T){#one single step
if (i>0) prop=prop+sal[i]}
sal[N]=prop/T}

which exploits the previously computed probabilities. The variability is most interesting if unexpected, but looking back at Feller‘s sections and exercises on the classical occupancy problem, I could not find a connection with this problem. If it exists. Still, if N is large enough, the exclusion of one index from the selection becomes negligible and the probability of moving from n to m individuals should be approximately [Feller, eqn (2.4), p.102]

$p_n(m)={n\choose m}\sum_{v=}^{n-m} (-1)^v {n-m\choose v} \left(1-\frac{m+v}{n}\right)^n$

This formula approximates quite well the exact probability, but as in a previous post about the birthday problem, it proves quite delicate to compute. As already noticed by Feller.

## Monty Python generator

Posted in Books, Kids, pictures, R, Statistics, University life with tags , , , , , , , on November 23, 2016 by xi'an

By some piece of luck I came across a paper by the late George Marsaglia, genial contributor to the field of simulation, and Wai Wan Tang, entitled The Monty Python method for generating random variables. As shown by the below illustration, the concept is to flip the piece H outside the rectangle back inside the rectangle, exploiting the remaining area above the density. The fantastic part is actually that “since areas of the rectangle add to 1, the slim in-between area is exactly the tail area”! So the tiny bit between G and the flipped H is the remaining tail.In the case of a Gamma Ga(a,1) variate, the authors express this variate as the transform of another variate with a nearly symmetry density, on which the Monty Python method applies. The transform is

$q(x)=(a-1/3)(1 + x/\sqrt{16a})^3$

with -√16a<x. The second nice trick is that the density of x is provided for free by the Gamma Ga(a,1) density and the transform, thanks to the change of variable formula. One lingering question is obviously how to handle the tail part. This is handled separately in the paper, with a rather involved algorithm, but since the area of the tail is tiny, a mere 1.2% in the case of the Gaussian density, this instance occurs rarely. Very clever if highly specialised! (The case of a<1 has to be processed by the indirect of multiplying a Ga(a+1,1) by a uniform variate to the power 1/a.)

I also found out that there exists a Monte Python software, which is an unrelated Monte Carlo code in python [hence the name] for cosmological inference. Including nested sampling, unsurprisingly.

## postdoc on missing data at École Polytechnique

Posted in Kids, pictures, R, Statistics, Travel, University life with tags , , , , , , , , , , , on November 18, 2016 by xi'an

Julie Josse contacted me for advertising a postdoc position at École Polytechnique, in Palaiseau, south of Paris. “The fellowship is focusing on missing data. Interested graduates should apply as early as possible since the position will be filled when a suitable candidate is found. The Centre for Applied Mathematics (CMAP) is  looking for highly motivated individuals able to develop a general multiple imputation method for multivariate continuous and categorical variables and its implementation in the free R software. The successful candidate will be part of research group in the statistical team on missing values. The postdoc will also have excellent opportunities to collaborate with researcher in public health with partners on the analysis of a large register from the Paris Hospital (APHP) to model the decisions and events when severe trauma patients are handled by emergency doctors. Candidates should contact Julie Josse at polytechnique.edu.”

## simulation under zero measure constraints

Posted in Books, Kids, R, Statistics, University life with tags , , , , , , , on November 17, 2016 by xi'an

A theme that comes up fairly regularly on X validated is the production of a sample with given moments, either for calibration motives or from a misunderstanding of the difference between a distribution mean and a sample average. Here are some entries on that topic:

In most of those questions, the constraint in on the sum or mean of the sample, which allows for an easy resolution by a change of variables. It however gets somewhat harder when the constraint involves more moments or, worse, an implicit solution to an equation. A good example of the later is the quest for a sample with a given maximum likelihood estimate in the case this MLE cannot be derived analytically. As for instance with a location-scale t sample…

Actually, even when the constraint is solely on the sum, a relevant question is the production of an efficient simulation mechanism. Using a Gibbs sampler that changes one component of the sample at each iteration does not qualify, even though it eventually produces the proper sample. Except for small samples. As in this example

n=3;T=1e4
s0=.5 #fixed average
sampl=matrix(s0,T,n)
for (t in 2:T){
sampl[t,]=sampl[t-1,]
for (i in 1:(n-1)){
sampl[t,i]=runif(1,
min=max(0,n*s0-sum(sampl[t,c(-i,-n)])-1),
max=min(1,n*s0-sum(sampl[t,c(-i,-n)])))
sampl[t,n]=n*s0-sum(sampl[t,-n])}}

For very large samples, I figure that proposing from the unconstrained density can achieve a sufficient efficiency, but the in-between setting remains an interesting problem.

## analysing the US election result, from Oxford, England

Posted in pictures, R, Statistics, Travel, University life with tags , on November 14, 2016 by xi'an

Seth Flaxman (Oxford), Dougal J. Sutherland (UCL), Yu-Xiang Wang (CMU), and Yee Whye Teh (Oxford), published on arXiv this morning an analysis of the US election, in what they called most appropriately a post-mortem. Using ecological inference already employed after Obama’s re-election. And producing graphs like the following one:

format: plain


text:
The polymath project “Finding primes” has now officially launched at the polymath blog as Polymath4, with the opening of a fresh research thread to discuss the following problem:

Problem 1. Find a deterministic algorithm which, when given an integer k, is guaranteed to locate a prime of at least k digits, in time polynomial in k.

From the preliminary research thread, we’ve discovered some good reasons why this problem is difficult (unless one assumes some powerful conjectures in number theory or complexity theory), so we have also identified some simpler toy problems:

Problem 2. Find a deterministic algorithm which, when given an integer k, is guaranteed to locate an adjacent pair n, n+1 of square-free numbers of at least k digits, in time polynomial in k.

(Note that finding one large square-free number is easy – just multiply a lot of small primes together.  Adjacent large square-free numbers exist in abundance, but it is not obvious how to actually find one deterministically and quickly.)

Problem 3. Assume access to a factoring oracle.  Find an algorithm which, when given an integer k, is guaranteed to find a prime of at least  k digits (or an integer divisible by a prime of at least k digits) in time $\exp(o(k))$.

The current record time is $O(10^k)^{0.535}$ unconditionally, or about $O( (10^k)^{1/2} )$ on the Riemann hypothesis.

In the new research thread, a number of possible strategies are discussed, and will hopefully be explored soon.  In addition to this thread, there is also the wiki page for the project, and a discussion thread aimed at more casual participants.  Everyone is welcome to contribute to any of these three components of the project, as always.


text:
## Answer: Flight Of Stairs

I got this problem from Shelley Chang, who says it’s one of her favorites.

Simple trial and error will allow you to get the number of ways to climb one, two, three, four, and five steps. This turns out to be one, two, three, five, and eight.

That probably looks familiar as the Fibonacci sequence. Fibonacci comes into play here because there are two ways to reach the $20^{th}$ stair. You can go up a single step from the $19^{th}$ or go up two steps at once from the $18^{th}$. So the number of ways you can reach step $20$ is the sum of the number of ways you can reach steps $18$ and $19$. Since the first and second steps correspond to the second and third Fibonacci numbers (depending on where you think the Fibonacci numbers start), the number of ways you can reach the $n^{th}$ stair is the $(n-1)^{th}$ Fibonacci number.

I wrote up a derivation of the formula for this number here.

If you followed the post linked above, it becomes trivial to generalize this question. The maximum number of steps you can take at a time becomes the dimension of the matrix. The matrix has mostly zeroes along the diagonal with ones next to the diagonal, and nothing else until the last row. The last row then has ones in all the columns that correspond to steps you could use to get to the final step. Then by diagonalizing this matrix and exponentiating the eigenvalues, we could find, for example, how many ways there are to get up $932$ steps going $4,7,$ or $9$ at a time. (This would require a 9X9 matrix).


text:
# How do you graph y=-cscx?

Draw $y = \csc x$, then flip flop the graph around the x-axis

#### Explanation:

Let's start with the graph of $y = \csc x$:

graph{cscx [-6.30, 3.6.30, -10, 10]}

The scale of the graph is set to run from $- 2 \pi$ to $2 \pi$. The asymptotes are at $n \pi$ (where n is an integer), $y = 1$ at $x = \frac{\pi}{2} \pm n 2 \pi$ and $y = - 1$ at $x = \frac{3 \pi}{2} \pm n 2 \pi$.

With the addition of the negative sign, we'll be making positive y values negative and negative ones positive, so in essence we'll flip-flop the graph around the x-axis:

graph{-cscx [-6.30, 3.6.30, -10, 10]}


text:
# Question

In the peak-load pricing model, we assumed that the capacity level is a decision variable. Assume now that capacity has already been set at 30 kwh. Change the model appropriately and run Solver. Then use SolverTable to see how sensitive the optimal solution is to the capacity level, letting it vary over some relevant range. Does it appear that the optimal prices will be set so that demand is always equal to capacity for at least one of the two periods of the day?

Sales0
Views27


text:
# Fox To-Ong

Geometry Level pending

what is the angle of rotation of the given equation: $$52x^{2} - 72xy + 73y^{2} = 200$$?

×


text:
# Definition of an "engine-driven electrical system"?

### Help Support HomeBuiltAirplanes.com:

#### cluttonfred

##### Well-Known Member
HBA Supporter
C'mon, Marc, haven't you figured it out? Because we're cheap and don't want to pay several thousand dollars just for the privilege of entering the 30 nm Mode C veil around a major airport without entering the actual Class B airspace.

But I don't know why you keep insisting that transponders will suck up all the current output.

#### Marc Zeitlin

##### Exalted Grand Poobah
C'mon, Marc, haven't you figured it out? Because we're cheap and don't want to pay several thousand dollars just for the privilege of entering the 30 nm Mode C veil around a major airport without entering the actual Class B airspace.
Hey - I'm a cheap bastard as well - just ask my family. "We can afford this" I hear them say. And my response is "We can afford this because I NEVER BUY IT".

At any rate, I certainly sympathize with the desire not to have to spend a substantial portion of the cost of smaller, cheaper, slower aircraft on a new device, although I've managed to convince myself to spend $35K on an IP replacement for my 17 year old instrument panel, due to starting with the need to upgrade to ADS-B... Go figure. There may be valid reasons for not requiring ADS-B Out. And whether a plane has an engine driven electrical system, and what the exact definition of that is, may be a strange reason to exempt (or not) an airplane. But using arguments that can be demonstrably proven false with the investment of 2 minutes of research isn't going to help the case. I would argue that any plane that has an engine that generates electricity SOLELY for the purpose of running itself is NOT an engine driven electrical system. I would argue that if the plane has an engine that generates electricity for ANY purpose other than keeping the engine running IS an engine driven electrical system, and is not exempt from the transponder or ADS-B requirement. But I'm not the FAA, and who knows what they would say if asked. I just wouldn't want to find out the answer through their enforcement mechanism... My$0.02.

#### TFF

##### Well-Known Member
The answer is... don’t get caught. If you do, play dumb. If the plane looks the part, no one will question. If you get written up in SA, because you want to show off, someone will call the bluff. Most FAA don’t know these rules unless they had to question it before. What they are trained to do is ask the question to you then ask their supervisors. If the answer is the same, they move along. If not, you will have to defend yourself. You actually might be right, but it will keep moving up their chain until someone does agree with you. Not one of them will stick their neck out and loose their pension.

#### Joe Fisher

##### Well-Known Member
The Dawn Patrol bunch flew Small scale Newport 17s with VW engines. They had chainsaw engines for starters. It looked like it worked pretty good.

#### TFF

##### Well-Known Member
The Kitplane articles by Ron W on the dawn patrol were some of the best articles written.

#### Toobuilder

##### Well-Known Member
Log Member
Today's starter motors and battery technology will be lighter, easier and more reliable than those chainsaw contraptions. Starting the engine is not hard.

#### Wanttaja

##### Well-Known Member
The Kitplane articles by Ron W on the dawn patrol were some of the best articles written.
You're half right.

The articles were actually written by Dick Starks.

Ron Wanttaja

#### TFF

##### Well-Known Member
Missed it by THAT much.

BJC

#### pictsidhe

##### Well-Known Member
Whatever happened to hand propping? Yeah, the hand crank starting on the early RR Merlins proved to be a bit too much exertion, but anything direct drive in our size range should be quite feasible.

Some quick calcs show that a \$99 20V drill driver may be enough to start a 627 v-twin. It wouldn't even need a dedicated aeroplane battery, just grab a charged battery from your tool kit. Should run a radio for many hours, too. Good chance of being able to charge it at many airports if it is a major brand, too. I want around a 2.6:1 reduction ratio, which will make my engine feel seven times bigger for hand propping, so I'm a little dubious that hand propping will work for me. But there are recoil starters for the v twins that will work. Direct drive would be easy to hand prop.
A bigger ground charged tool battery system could be a light option for those running real airplane engines, too.

#### Wanttaja

##### Well-Known Member
Whatever happened to hand propping? Yeah, the hand crank starting on the early RR Merlins proved to be a bit too much exertion, but anything direct drive in our size range should be quite feasible.
Bring back the Hucks starter!

Ron Wanttaja

#### recmob

##### Well-Known Member
It's irritating as hell that I have to spend between a quarter and a half the value of my airplane because some pilots can't be bothered to look for traffic outside the airplane.
I've been installing a lot of Dynon equipment in my clients aircraft. I understand your sentiment here, but I have to say that at least where I'm flying after scanning for traffic and THEN looking at the screen, I'm surprised at just how many aircraft are out there that aren't picked up in the visual scan. I don't want to spend the money either, however I can certainly see the benefit of it.

#### BJC

##### Well-Known Member
HBA Supporter
Bring back the Hucks starter!

Ron Wanttaja
Nice job, Ron.

How long did that take?

BJC

#### Toobuilder

##### Well-Known Member
Log Member
The need for a transponder is not universal. I personally think that using the "no electrical" excuse to get around a transponder in high traffic areas is pretty silly these days, but I do object to the ADS-B mandate for aircraft that steer clear. My Rocket and RV-8 go high, far, and penetrate all airspace. I have no issue equipping them to coexist with other traffic. On the other hand, The T-craft and my "someday" Pitts will rarely leave sight of my house. Really no need for even a radio in these. The Pitts will get electronic ignition though, and that's the rub. And while many a Pitts is hand propped, in this age of miracle batteries and lightweight starters it just doesn't make sense to me. Much rather be strapped in and completely in control during the engine start.

So I think the thing to do for my future Pitts is to build it as a total loss electrical and then down the road add the "ignition system sustainer" SD-8 alternator. If some of the excess capacity from the alternator happens to leak into the battery during flight, so be it.

#### TFF

##### Well-Known Member
First it’s government, they always want a head count. It would have been nice to to assigned an altitude. 5000 ft AGL and above requires ADSB. I would be happy with 3000 ft. Below and out of B/C airspace, optional. Unlucky that is not what they put in affect. It’s dumb to not have it if traveling or if the traffic is high. Simple airplanes should remain simple. Complex airplanes should not be trying to pull
One over. ADSB is just in the beginning, once it is ten years old, I expect an adjustment if the government keeps cutting services.

#### Wanttaja

##### Well-Known Member
Nice job, Ron.

How long did that take?
Did it several years ago, but IIRC, it took less than an hour for the Photoshop work. Hardest thing is matching the contrast and color palette of the two images. It's easier to work in black and white, though I'm still not happy with the Hucks starter image.

But when 'shopping in a Fly Baby picture, the thing that takes the most time is finding a picture taken at about the same angle.

Fortunately, Drew Fidoe (the owner of that camouflaged Fly Baby) takes a lot of shots of his airplane.

Because of that, I do *lot* with Drew's airplane...

(Drew...a retired RCN sailor...named his Fly Baby, "Stringbag," hence this photo)

Bill Hills has a camouflaged Fly Baby, too, and I've used his as well....

They're more fun when they're subtle....

Far, FAR too many more examples at: http://www.bowersflybaby.com/stories/altered.HTM

Ron Wanttaja

#### pictsidhe

##### Well-Known Member
Is that the Shuttleworth Hucks? Many of their groundcrew wear white coveralls. Those seem impractical for wartime...

#### Sockmonkey

##### Well-Known Member
Looked at some portable generators. The littlest ones weigh around 20 lbs and 150-200 bucks.

#### TFF

##### Well-Known Member
So if you taxi up to the warbirds parking at Oshkosh and show the pictures, do you think the ground people would let you park? It would be a fun prank.


text:
## Algebra 2 (1st Edition)

n-th term:$\quad a_{n}=\displaystyle \frac{2n-1}{10n}$ The next term is $\displaystyle \quad a_{5}=\frac{9}{50}$
The n-th numerator is the n-th odd number $\quad (2n-1)$ The nth denominator is the n-th multiple of 10, $\quad (10n)$ So, the nth term is $a_{n}=\displaystyle \frac{2n-1}{10n}$, and the next term is $a_{5}=\displaystyle \frac{2(5)-1}{10(5)}=\frac{9}{50}$


text:
# Requests for Reopen & Undeletion Votes (volume 07/2018 - today)

The purpose of this thread is to help focus the attention of the community on posts that may require reopen and undeletion votes. A request should be posted as an answer below (one request per answer).

Some guidelines:

• Please be polite, and respect the many different viewpoints in our diverse community. This goes for the person making the request as well as those commenting on it.

• There is a reopen queue. Please wait until a post has gone through this queue, before posting here. Notice that the first edit after the question was put on-hold pushes the question into reopen review queue, if the edit was done within 5 days of closure. So does a reopen vote. (If the review has already been finished, it is shown on the timeline of the question.) In doubt, wait 24 hours after the last substantive action.

• To inform readers of the current (and past) states of the targeted post, please add once the request resulted in some action the information Reopened or Undeleted at the start. (If it the action is undone, add this too, like Reopened, reclosed.)

• Do not only post a request, like "request reopening of ". Instead make a case for your concern. Yet keep in mind that it can be easier to get your request handled if you try to frame in a away that takes the feedback the post received into account in a positive way rather then seeking confrontation. Also, try to improve the post before posting here.

• In case of "small" requests, like one missing vote, it can make sense to ask in chat instead of posting here. The room CRUDE is a reasonable place for such requests. The same guidelines apply there.

Earlier versions of this thread that served as a model:

Reopened

This is on the chopping block again: Is zero a prime number? The question was the subject of this meta discussion: How to prevent the loss of excellent answers to poor questions. which resulted in reopening.

(Disclosure, I have a solution on the question. I feel the question and solutions are worth fighting for, in this case.)

The reason this time for closure is "too broad", but it is far from obvious that this objection is valid. The OP asks three complete and answerable questions, two of which have answers elsewhere on the site. The remaining question became the focus of some of the answers, and there does not appear to duplicate with comparable content.

So for all intents and purposes, there is a single, clear question that seems rather likely for a layperson to ask, and there are good answers. There is nothing about the breadth of the question which inhibits solutions, as can be seen.

Furthermore, on the holistic side, after so many upvotes on the question and its solutions, and approaching now 30000 views, it seems that the post IS manifestly useful. So, I request your votes to re-open this.

• I agree that this rather should not be closed, especially after the improvement of the post. (Yes, the question still has some shortcomings, but I feel it is "good enough".) I tangentially got involved last time; but stopped short of taking action. I reopened it now. (This is less of a so-called unilateral action as it was 'nearly' reopened two weeks ago. ) – quid Jul 16 at 17:42
• @quid Thank you for your attention to this! – rschwieb Jul 16 at 18:28
• @quid I'm curious: my understanding was that closed questions were still viewable and not eligible for automatic deletion (assuming that the question is upvoted and has upvoted answers). Why is it inappropriate to close the question and leave a message to the effect of "This question has been preserved because of a good answer. It is never-the-less not a high quality question." For example, the lock message on this question. – Xander Henderson Jul 16 at 19:04
• @XanderHenderson 'Why is it inappropriate to close the question and leave a message to the effect of "This question has been preserved because of a good answer. It is never-the-less not a high quality question.' Why do you use the indicative here? No one did that, as far as I know. In any case not recently. The question was reopened after a substantive edit, and then reclosed without comment, as 'too broad'. It also had a delete vote. Maybe more to the point, I would not consider it as inappropriate. But frankly given the edit I don't consider the question as all that bad. – quid Jul 16 at 20:57
• Sure, it is a bit of a laundry list, and the last question is a bit strange, but in it's naive way even this seems like a genuine question. But it is also not unreasonably broad. Would it be asked now, I'd recommend to split it up, maybe. But this is not easy to fix now, and maybe not that important either. Maybe the combination of question even can be seen as hinting at the level at which the questions is asked. To only ask "is zero a number" might be ill-posed or underdefined, but in context I think it works. – quid Jul 16 at 21:04
• Then there is also a community-aspect. Somebody actually put some non-trivial effort into improving this question, and the result is not that bad. If even this is not enough, at some point the line of argument that users should improve post they care about loses credibility, which leads to less improvements. @XanderHenderson – quid Jul 16 at 21:10
• @quid I apologize---my original comment was poorly phrased, and likely not really related to this reopen request. A better phrasing might have been "In cases where there are really good answers to questions of marginal merit, (1) don't those answers automatically get preserved even if the question is closed? and (2) can such answers be protected? Since you seemed kind of ambivalent with respect to reopening (which I see now was an over-interpretation on my part), I was asking about an alternative. – Xander Henderson Jul 16 at 23:38
• In any event, thank you for the feedback. I honestly do value it. :) – Xander Henderson Jul 16 at 23:39

Reopened

I edited the question Variable in upper bound of sum when it had 4 votes to close, and I also posted a rather detailed answer (which the OP accepted). It got "put on hold as unclear what you're asking" even though I think it's now quite clear and on-topic. Can the question be re-opened?

Reopened

I would like, if it is possible, remove the labels close-hold for some of next of my recent post

The equation $\varphi(n)=n-\log_2(1+\operatorname{gpf}(n))-\operatorname{gpf}(n)+1$ and Mersenne primes

I think that the answers are very interesting and very good, and I think that the questions are in the standard of questions of MSE. Any case many thanks.

Reopened

I just came across this question: Derivative of Square Root Visual after failing a reopen review audit and I'm wondering why it's still closed: unclear what you're asking. I agree that the MathJax formatting isn't the best, but it is still readable.

The OP has actually shown what they've tried, and what they didn't get, so the reason for closure is beyond my understanding. I thus request to reopen the question.

I have now edited the question to make it look neater.

• Well it is definitely unclear what they are asking... One has to take roughly 10 mins to watch the youtube videos to see what they are trying to say (watching parts of 2:25 and 12:48 don't quite work, at least to me). – John Ma Jul 17 at 10:32
• @JohnMa I think they meant 3:25, as it looks much more relevant? – TheSimpliFire Jul 17 at 10:43
• They start the $x^2$ example at 2:35, and then to power rule (up to 10:30). Then they switch to $1/x$ (it seems this is the more relevant one). – John Ma Jul 17 at 10:50

(This is to break this request post into two)

I would like, if it is possible, remove the labels close-hold for some of next of my recent post Convergence of $\prod_{n=2}^\infty\left(1-\frac{1}{n^2}\right)^{i^n}$, where $i$ is the imaginary unit

I think that the answers are very interesting and very good, and I think that the questions are in the standard of questions of MSE. Any case many thanks.

Please consider undoing the duplicate votes here. The duplicate target asks for algorithms while this questions asks for easy ways to calculate determinant (so that careless errors are less likely to commit). The duplicate target is a question without context too (though with some decent answers).

FYI: I hope I did not miss something obvious. It failed the reopening review three times before.

Undeleted, then closed and deleted

I think there's a consensus that we undelete questions when they are deleted by the user who posted them after someone else has posted an answer (see, for example, the comment here: https://math.stackexchange.com/questions/2759560/extending-the-triangle-inequality#comment5694741_2759560). In accordance with that consensus, I propose undeletion of https://math.stackexchange.com/questions/2840649/solutions-to-sum-j-ok-r-j23r-j2-equiv-0-mod-p

Now I'll own up that I'm the one who posted the answer to the question. My answer was exceedingly terse, and came out of a review with the note, "This does not provide an answer to the question (and so on, and so forth)." But it does provide an answer. The question was to prove or disprove that there are no solutions to a certain equation (congruence, actually, but never mind), and my answer gave a solution.

• Is this actually a consensus? – Did Jul 23 at 12:30
• @Did, if you look at the previous edition of this thread, you'll find that in April-May, GNU Supporter posted 4 requests for undeletion, all on the grounds that OP had deleted a question after receiving an answer, and all four questions were undeleted. – Gerry Myerson Jul 23 at 12:51
• Yes, and?   – Did Jul 23 at 18:11
• @Did For what it's worth, I have the same impression about the consensus. Preventing an asker from covering up their own question seems to be something the community values, even if it's closed later. – T. Bongers Jul 23 at 18:35
• @T.Bongers (and also Gerry Myerson): I think that there is a moderate consensus that it is bad form to ask a question, get an answer, then delete the question. It belies an ignorance of the functioning of the site (i.e. questions are supposed to be helpful to everyone, not just the one person asking the question). However, in this particular case, the question is of pretty low quality, and should be closed and deleted (in my opinion). It seems like a waste of resources to have opened it back up again... – Xander Henderson Jul 23 at 19:00
• For what it's worth, I have expanded my answer to the question on main. – Gerry Myerson Jul 24 at 0:34
• "For what it's worth, I have expanded my answer to the question on main." On this topic, my understanding is that the consensus is that a good (or even great) answer is not really enough to justify keeping a poor question around. This and this are relevant. – Xander Henderson Jul 24 at 13:27
• @Xander, the highest-voted answers and comments on your first link hardly support your understanding. The second link, even there there is considerable support for not deleting questions with good answers. I'm not convinced there is, was, or ever will be a consensus on this issue. A majority, maybe, but no consensus. – Gerry Myerson Jul 24 at 21:31
• @GerryMyerson I think you and I must be reading very different answers. In answer to the question of whether bad questions with good answers should be preserved, my reading of the top three answers ((1), (2), (3)) suggest that it might be worth protecting a poor question if it hosts an excellent answer. – Xander Henderson Jul 24 at 22:54
• On the question of upvoting poor questions with good answers, the top voted answer is this one, essentially "I don't do it, but there could be an argument in favor of it." The second answer is similar, with the idea being that a good answer should be preserved if it might be helpful for others in the future. – Xander Henderson Jul 24 at 22:55
• In both cases, it seems clear to me that the consensus is that it might be reasonable to preserve a poor question if it attracted a really good, useful, generally helpful answer. Again, a good answer (or possibly even a great answer) is not, by itself, enough to preserve a poor question. – Xander Henderson Jul 24 at 22:58
• Finally, I note that I made my initial comment in response to your assertion that you have improved your answer. Are you further asserting that the improvements created something that is of such lasting value that it will be beneficial beyond asking that poor question? Despite the fact that this question and answer have been the topic of discussion here for a couple of days, your answer has not attracted any upvotes... – Xander Henderson Jul 24 at 22:59
• @Xander, I'm not in it for the upvotes. I objected to a user posting a question and then deleting it when it got an answer, as I agree with a moderator that such an action is an abuse of the site. Once the question was undeleted, I took the opportunity to improve my answer, in response to a comment from another user. What's wrong with that? I'm not asserting anything about the lasting value of the question or the answer, other than the answer being fuller now than it was. The answer may help someone coming along who is interested in sums of two squares modulo a prime. Fire away. – Gerry Myerson Jul 24 at 23:30
• @GerryMyerson: it isn't pleasant to see one's own answer deleted, but in this case the question is clearly not up to many users' standards, so I think it is not surprising to see it deleted. At this point, the question is no longer deleted by the OP, but by several other users. – Carl Mummert Aug 5 at 21:06
• @Carl, it isn't pleasant to see any answer with nonzero mathematical content deleted. More to the point, I would not have put the question up for undeletion, had it been deleted by votes of users. My objection was to OP abusing the site by deleting the question after getting an answer. I thought that was clear. – Gerry Myerson Aug 5 at 23:09

Reopened

The question A Proof of the Fundamental Theorem of Arithmetic was rightfully quickly closed as unclear, but the asker has since edited to clarify what they meant and what specific difficulty they had adapting the standard proofs to get what they want. It seems to me to be a perfectly reasonable question which is mostly clear (though a constraint like "not using integers or rational numbers" is inevitably going to be a little slippery).

Reopened

Prove $\lim_{z \rightarrow z_o} f(z) \in \mathbb{C}$ if $\lim_{z \rightarrow z_o} (z-z_0) f(z) = 0$

I made a new question, where I tried to be as clear and narrow as possible.

Reopened

Please re-open this question which is put on hold:

Understanding De/Suspension $\Sigma^{-1}(\Sigma{X})\neq X$

It was said that "unclear what you're asking" and people do not know the def of de-suspension.

However, the suspension is introduced earlier in the cited question:

The suspension (topology) and elementary examples

While the desuspension is also quoted/linked to the Wikipedia (withe refs given by Wiki). I also include a new note: "The desuspension is arguably firstly introduced in the cited text mentioned in H. R. Margolis (1983). Spectra and the Steenrod Algebra. North-Holland. p. 454." And the ref cited.

Question: How do we define desuspension exactly? (Please see the comments below, people complain about the meanings of desuspension in Wikipedia is useless).

Are we able to have the desuspension acting on the topological space as the suspension does? Or do we only have the desuspension act on the spectra but not the space?

I am not sure why it was deleted. If someone explains why it was deleted, I can rewrite it to fit into the format of the site.

• Perhaps it was deleted because it was, as several people wrote, nonsense. I don't think any amount of rewriting, short of burning it and writing something completely different, maybe by someone else, will make it fit the site. – Gerry Myerson yesterday
• @GerryMyerson, If it were truly nonsense, nobody would have even attempted to answer it, yet 3 people did. – Craig Feinstein yesterday
• @CraigFeinstein Please don't mistake some people's attempt at a charitable reading of the question for an actual, sensible post. – T. Bongers yesterday
• @T.Bongers, declaring that something is nonsense doesn't make it so. – Craig Feinstein yesterday
• @CraigFeinstein Of course, but the burden of proof is on you to convince people that this question has merit. Considering the large number of (experienced) people who have told you that the question is nonsense, that may be a bit difficult. – T. Bongers yesterday
• @T.Bongers, The only question without merit is the question that doesn't get asked. – Craig Feinstein yesterday
• @CraigFeinstein Trite witticisms aside, there are minimum quality standards for questions here. The linked question does not have merit on MSE, in my humble opinion, and shouldn't be reopened without very substantial changes. – T. Bongers yesterday
• @TBongers, you haven't answered my question. Why was my question deleted? I would like to know so I do not make the same mistakes in the future. – Craig Feinstein yesterday


text:
# What is reductive group intuitively?

I am studying Geometric invariant theory and wonder how I should understand linearly reductive algebraic group. We say that an affine algebraic group $G$ is linearly reductive if all finite dimensional $G$-modules are semi-simple.

I am not sure if linearly reductive groups are the same as reductive groups, which are defined as algebraic groups $G$ over algebraically closed field such that the unipotent radical of $G$ is trivial. But this definition is still beyond my intuition.

Are there any good way to understand (linearly) reductive groups? It would especially be nice if reductive (Lie) groups can be characterized in geometry.

-

"Linearly reductive" and "reductive" are equivalent when the base field is of characteristic zero, but for prime characteristic they are different -- in fact, in prime characteristic, the only connected linearly reductive groups are algebraic tori, though for example $\operatorname{GL}_n$ is reductive.
There is a nice characterization of reductive groups over $\mathbb{C}$: they are precisely the complexifications of compact connected Lie groups. More precisely: every compact connected Lie group is actually a real algebraic group, and every smooth homomorphism of compact Lie groups is algebraic. We can then look at the points of this group over $\mathbb{C}$, and thereby obtain a complex algebraic group. For example, the complexification of $U(n)$ is $\operatorname{GL}_n(\mathbb{C})$ -- this can be seen at the level of Lie algebras from $\mathfrak{gl}_n(\mathbb{C}) = \mathfrak{u}(n) \oplus i\mathfrak{u}(n)$. It turns out that in fact every complex reductive group arises in this way from a maximal compact subgroup, and this gives an equivalence between the category of compact connected Lie groups (with smooth homomorphisms) and the category of complex reductive groups (with algebraic homomorphisms).


text:
## Intermediate Algebra: Connecting Concepts through Application

$\color{blue}{36a^2b^4c^7\sqrt{ac}}$
Factor the radicand so that at least one factor is a perfect square: $=\sqrt{(1296a^4b^8c^{14})(ac)} \\=\sqrt{(36a^2b^4c^7)^2(ac)}$ Bring out the square root of the perfect square factor to obtain: $=\color{blue}{36a^2b^4c^7\sqrt{ac}}$


text:
• entries
222
606
• views
587739

# VGA output for the dsPIC33 VDC

2569 views

I have spent quite a while working on different projects that generate PAL video signals in software. This may seem a bit odd if you consider the fact that I don't own a TV, so tend to rely on a video capture card or VGA box to see the output of these projects on a computer monitor -- something I do have a fair number of.

This reliance on another piece of technology between my project and the display device is not something I'm too keen on, so have spent some time adding native 640x480 60Hz VGA output to my dsPIC33 video display controller.

Another advantage of using a VGA monitor directly is that individual pixels are shown very crisply, unlike my video capture card or VGA box which tend to blur the image horizontally. This is shown in the zoomed in part of the above photo.

Generating a video signal for a VGA monitor is easier than generating a composite video signal for a PAL TV, as there are distinct pins for the image data, horizontal sync and vertical sync. One problem I did have, however, is with the length of the vertical sync pulse. I started with a very brief pulse (the same duration as the horizontal sync pulse) which worked fine with my old analogue CRT monitors but didn't work at all with my modern LCD monitor. The documentation I was using for timing information indicated that there were "two scanlines" for vertical sync so I extended the pulse to last for those two frames, which worked on the LCD but didn't on the CRTs. My final compromise has been to assert the vertical sync pin for the duration of a single scanline, which seems to work on all of my monitors.

When connected to a TV two microcontroller pins are used to drive a single load (composite input). When connected to a VGA monitor, however, a single microcontroller pin is used to drive three loads (red, green and blue inputs). I thought it prudent to check the datasheet for the dsPIC before connecting this increased load to the output pin where I was surprised to discover that the maximum source or sink current for each output pin is a measly 4mA -- not even enough to drive an LED! I have added a buffer to each video output pin to protect the dsPIC -- any buffer capable of sourcing up to 30mA or so should be sufficient (I'm using a 74F125, which can be seen in the bottom right of the above photo). I had previously been occasionally using the video output pins as inputs to check if there is a load on the output or not (such a load would indicate whether a TV or VGA monitor is plugged in or not) but I can no longer do this with the external buffer IC so have had to revise the circuit somewhat. Updated source code featuring the new VGA output code and an accompanying schematic are available for those who are interested!

Nice work.
If you are generating VGA signals then you should be able to generate RGB colour too? I expect the memory and speed requirements are a bit too high for that though?

It this going to be the output device for your z80 project at some point?

Interesting though, the PIC24 I used seems to have considerably higher rating on the I/O pins. It doesn't have the DMA ability that you were using and presumably still are?

Nice work.
If you are generating VGA signals then you should be able to generate RGB colour too? I expect the memory and speed requirements are a bit too high for that though?

It this going to be the output device for your z80 project at some point?

Very cool!
My query's along the same lines as jbb: on a scale of 0x0 to 0xf, what's the likelihood you'll want to go 16b vga sometime in the near future?

Thanks for the kind comments! [smile]
Quote:
 Original post by jbb If you are generating VGA signals then you should be able to generate RGB colour too? I expect the memory and speed requirements are a bit too high for that though? It this going to be the output device for your z80 project at some point?
Yes, RGB colour would indeed be possible but I would have to drop the resolution (or switch to a tilemap-based system) to accommodate it. As this is intended to be the output device for the Z80 computer project I'd like the horizontal resolution to be at least 320 pixels, as CP/M assumes an 80 column display and four pixels is about as narrow as I can make characters and still have legible text.

One way to easily, though expensively, add colour output would be to use three dsPICs; one containing the red channel buffer, one the green channel buffer, and another the blue channel buffer. I reckon that changing the design to one that uses external RAM would seem to be a more sensible way to do it (or finding a microcontroller that has a lot of on-board RAM).
Quote:
 Interesting though, the PIC24 I used seems to have considerably higher rating on the I/O pins. It doesn't have the DMA ability that you were using and presumably still are?
It did strike me as a bit odd, as I've never used a microcontroller that couldn't drive an LED directly from an I/O pin before. Yes, I'm still using the DMA feature to stream pixels out of the SPI peripheral as his reduces CPU overhead significantly. Unfortunately I can only do this in TV or VGA output modes as the LCD requires four pixels to be clocked out at a time, not one.
Quote:
 Original post by DWN My query's along the same lines as jbb: on a scale of 0x0 to 0xf, what's the likelihood you'll want to go 16b vga sometime in the near future?
For this particular project, I'd go for 0, unfortunately, due to the reasons above. It's something I may well pursue in the more distant future, however!

Thanks for the kind comments! [smile]
Quote:
 Original post by jbb If you are generating VGA signals then you should be able to generate RGB colour too? I expect the memory and speed requirements are a bit too high for that though? It this going to be the output device for your z80 project at some point?
Yes, RGB colour would indeed be possible but I would have to drop the resolution (or switch to a tilemap-based system) to accommodate it. As this is intended to be the output device for the Z80 computer project I'd like the horizontal resolution to be at least 320 pixels, as CP/M assumes an 80 column display and four pixels is about as narrow as I can make characters and still have legible text.

One way to easily, though expensively, add colour output would be to use three dsPICs; one containing the red channel buffer, one the green channel buffer, and another the blue channel buffer. I reckon that changing the design to one that uses external RAM would seem to be a more sensible way to do it (or finding a microcontroller that has a lot of on-board RAM).
Quote:
 Interesting though, the PIC24 I used seems to have considerably higher rating on the I/O pins. It doesn't have the DMA ability that you were using and presumably still are?
It did strike me as a bit odd, as I've never used a microcontroller that couldn't drive an LED directly from an I/O pin before. Yes, I'm still using the DMA feature to stream pixels out of the SPI peripheral as his reduces CPU overhead significantly. Unfortunately I can only do this in TV or VGA output modes as the LCD requires four pixels to be clocked out at a time, not one.
Quote:
 Original post by DWN My query's along the same lines as jbb: on a scale of 0x0 to 0xf, what's the likelihood you'll want to go 16b vga sometime in the near future?
For this particular project, I'd go for 0x0, unfortunately, due to the reasons above. It's something I may well pursue in the more distant future, however!

3mA seems to be sufficient to light a standard LED. It's clearly not going to be nearly as bright as 20mA but it's sufficient for many things.

Is VGA the same voltage levels as scart? In which case a quick calculation seems to indicate that you need about 10mA... Hmm, my arm chip might have trouble with that.

I'm looking at using my LPC1343 for video. It has serial hardware like the pic24 and at 75mhz it might be fast enough to refill the buffers on an interrupt meaning that that I can get a reasonable resolution and still get some work done during each line.

I need to obtain and build some proper connectors though. Bodging it together by pushing wires into holes in scart connectors and so on really isn't sufficient for anything other than basic testing. I don't really have the time at the moment with trying to fit it around job interviews and research but trying to fit it in because it's fun :)

Quote:
 Original post by jbb 3mA seems to be sufficient to light a standard LED. It's clearly not going to be nearly as bright as 20mA but it's sufficient for many things.
I usually go for at least 10mA, but your point is taken.
Quote:
 Is VGA the same voltage levels as scart? In which case a quick calculation seems to indicate that you need about 10mA... Hmm, my arm chip might have trouble with that.
VGA is the same voltage level as SCART RGB (0.7V) which is a little lower than composite video (1V, SCART or otherwise). The impedance is the usual 75Ω.
Quote:
 I'm looking at using my LPC1343 for video. It has serial hardware like the pic24 and at 75mhz it might be fast enough to refill the buffers on an interrupt meaning that that I can get a reasonable resolution and still get some work done during each line.
Sounds good, I look forwards to seeing where you take it. [smile] I'm a little surprised at the amount of RAM offered, though; even the dsPIC33 I'm using has 16KB. I'm still pondering the Propeller as another option.
Quote:
 I need to obtain and build some proper connectors though. Bodging it together by pushing wires into holes in scart connectors and so on really isn't sufficient for anything other than basic testing. I don't really have the time at the moment with trying to fit it around job interviews and research but trying to fit it in because it's fun :)
I'd go mad (well, more mad) if I didn't have my hobbies to balance out my work; best of luck with the interviews!

My local Poundland sells SCART leads (with every pin connected) and SCART splitters; these may provide a cheap supply of SCART plugs and sockets.

You might find it 'better' to do DMA to the PMP or to PORTB because that gives you 8 or 16 pins toggling at once. You'll need a bit of memory to store an expanded scanline (from whatever bpp you want) and a few cycles to expand each line before displaying it, but it also gives you the option of a palette for VGA (expand, say, 2 or 4 bits to 5:5:5).
Really, though, using an FPGA as a video card for the uC probably makes the most sense. Using even a low-pin inexpensive chip would allow you much more complex logic interfacing with reasonable ram buffers, etc.

Part of my reason to sticking to monochrome 320?240 is that the graphical LCD that I intend to use as the primary display device is a 320?240 monochrome one. That and memory becomes a bit of a problem for higher resolutions or coloured displays. Some microcontrollers can be connected to external RAM but these tend to be fiddly SMD parts that I don't really have the equipment to work with.

That said, I would be quite interested in getting into programmable logic anyway; I can imagine how I could build a better VDC out of discrete logic and RAM chips but it would end up being physically very large and a pain to solder together. Do you have any recommendations for inexpensive FPGA equipment (if such a thing exists?) Even then I'm not sure it would be available in DIP. [sad]

sparkfun.com sell some kind of FPGA on a breakout board but it's not particularly cheap at about $80 but you can get a lot of their stuff in the UK from various suppliers so maybe you can get it here. I have no knowledge about the chip on the board though, or what it's good for. Or what else you need to use one. Or about programming them :P #### Share this comment ##### Link to comment On your last photograph you have what appears to be a socket for a composite video connector plugged directly into your breadboard. All the ones I've seen seem to be solder connections. But it's a bit small to see exactly. I had a look for such a connector a while ago and couldn't see anything suitable. So is it what it looks like to me? And if so do you know where you got it? #### Share this comment ##### Link to comment Quote:  Original post by benryves Part of my reason to sticking to monochrome 320?240 is that the graphical LCD that I intend to use as the primary display device is a 320?240 monochrome one. That and memory becomes a bit of a problem for higher resolutions or coloured displays. Some microcontrollers can be connected to external RAM but these tend to be fiddly SMD parts that I don't really have the equipment to work with. That said, I would be quite interested in getting into programmable logic anyway; I can imagine how I could build a better VDC out of discrete logic and RAM chips but it would end up being physically very large and a pain to solder together. Do you have any recommendations for inexpensive FPGA equipment (if such a thing exists?) Even then I'm not sure it would be available in DIP. [sad] You are correct in stating that FPGAs are rarely available in DIP packages, so you might want to avoid them if you plan on making your project into a soldered circuit board. However, there are many kits designed around FPGAs that you could use if you're fine sticking to solderless prototyping. For example, on the inexpensive end (for FPGA kits) at$200 there is Cyclone III FPGA Starter Kit which has everything you'll probably ever need out of an FPGA (including plenty of i/o pins exposed). There are several similar options available at Terasic spanning to much higher costs if you want fancier outputs and onboard peripherals, etc.
Another approach you could take (especially if you'd rather work with components) is to use adapter sockets like those a futurlec.

Quote:
 Original post by jbb On your last photograph you have what appears to be a socket for a composite video connector plugged directly into your breadboard.
It's a 3.5mm stereo jack socket with a 3.5mm mono jack to RCA adaptor plugged into it. I've only ever seen them available as panel mounted or line connectors, not PCB mounted, I'm afraid.
Quote:
 Original post by Extrarius However, there are many kits designed around FPGAs that you could use if you're fine sticking to solderless prototyping. [...]
Thank you very much for your suggestions! I've bookmarked your reply for future reference. \$199 doesn't seem bad for such a nice development kit. [smile] Ultimately I do prefer to end up with a finished project rather than a pile of breadboards so those Futurlec parts look useful for the more fiddly IC packages. Cheers!

## Create an account

Register a new account


text:
# TabView: Reset some dynamic variable on tab selection

Given a TabView panel like this one

TabView[{
DynamicModule[{x = False}, {Checkbox[Dynamic[x]], Dynamic[x]}],
"foo"}]

I would like to reset the value of x to its initial value (False) every time the first tab gets selected - that is, I basically want to "reset"/"reload" the tab on each selection.

Also, the variable(s) in question should remain local variables on a per-tab basis, if possible. This is, I hope to avoid a solution declaring x globally.

Any help very much appreciated (either on reloading the whole tab or on setting specific dynamic variables).

• Brilliant, thanks a lot! – Bernd Mar 3 '15 at 9:17

### edit

This is an old question but it came to my mind I know the solution now.

DynamicModule[{tab = 1},
TabView[{
DynamicModule[{x = False},
Row[{  Dynamic[tab; x = False; "", TrackedSymbols :> {tab}],
{Checkbox[Dynamic[x]], Dynamic[x]}}]]
,
"foo"},
Dynamic[tab]]
]

So the trick is to keep invisible Dynamic which triggers resetting x whenever tab is changed. x is scoped in the tab only while tab is in outer DynamicModule.

### old stuff

I don't know how to deal with it when x is scoped to first tab, but I don't think it is the most important thing here.

TabView[{
1 -> {Checkbox[Dynamic[x]], Dynamic[x]},
2 -> "foo"}, Dynamic[k, If[# == 2, x = False; k = #;, k = #] &]]

This solution is using TabView in form TabView[{ }, i ] which is described in Help. Second argument in Dynamic is monitoring which tab is active and switching value of x.

• But this way I'd replace the DynamicModule with Dynamic, so in each case I would need to make sure that the variable (x, in this case) is not used in some other instance? – Bernd May 29 '13 at 10:09
• unfortunately yes. – Kuba May 29 '13 at 10:21

Here is a version which fully localizes the variables. Other than that it does the same as Kubas answer so I'd suggest to accept his answer:

With[{xDefault = False},
DynamicModule[{x = xDefault, visibleTab = 1},
TabView[{
Row[{Checkbox[Dynamic[x]], " ", Dynamic[x]}],
Dynamic[x]
}, Dynamic[visibleTab, (visibleTab = #; If[visibleTab == 1, x = xDefault]) &]
]
]
]

Here is another solution which will regenerate the content completely, including initialization. It needs some hacky tricks to persuade Mathematica to really update the outermost Dynamic in the first tab, Mathematica seems to put quite some effort into not destroying the state of that Checkbox. Anyway, this seems to work for me:

DynamicModule[{visibleTab = 1, trigger = AbsoluteTime[]},
TabView[{
Dynamic[
DynamicModule[{x = False},
Row[{Pane[trigger, {0, 1}], Checkbox[Dynamic[x]], Dynamic[x]}]]
],
"foo"
}, Dynamic[
visibleTab,
(visibleTab = #; trigger = AbsoluteTime[]) &
]
]
]

You should note that in many cases it is good enough to e.g. do Row[{trigger;Checkbox[Dynamic[x]],Dynamic[x]}], but here it seems that you really have to trick Mathematica into believing that the value of dummy-variable triggeris actually seen on screen (which it actually is, but at a size of 0x1 pixels that shouldn't be too irritating :-)). The above technique can be used to create a wrapper which makes it somewhat simpler to use:

reinitializingTabView[{tabs___}, opts : OptionsPattern[TabView]] :=
DynamicModule[{tabidx, trigger},
TabView[
Dynamic[Row[{Pane[trigger, {0, 1}], #}]] & /@ {tabs},
Dynamic[tabidx, (tabidx = #; trigger = AbsoluteTime[]) &],
opts
]
]

and then can be used e.g. like this:

reinitializingTabView[{
DynamicModule[{x = False}, {Checkbox[Dynamic[x]], Dynamic[x]}],
DynamicModule[{x = False}, {Checkbox[Dynamic[x]], Dynamic[x]}],
"foo"
}]

handling of the second argument and options could probably be improved, but whether that's worth the effort depends on how often you'll use it...

Here is yet another solution which will localize per tab but doesn't regenerate, also quite complicated and somewhat hacky:

DynamicModule[{visibleTab = 1, needsupdate = False},
TabView[{
DynamicModule[{x = False},
DynamicWrapper[
Row[{Checkbox[Dynamic[x]], " ", Dynamic[x]}]
,
Hold@Print["called"];
If[TrueQ[needsupdate],
Hold@Print["doing something"];
x = False;
needsupdate = False
],
UpdateInterval -> Dynamic[If[TrueQ[needsupdate], 1, Infinity]],
TrackedSymbols -> {needsupdate}
]
],
"foo"
}, Dynamic[visibleTab, (visibleTab = #; needsupdate = True) &]
]
]

If you delete the Hold wrapper for the Prints you'll note that it's now updated 3 times but it only actually does something one time.

I'd really wish this would be possible somewhat simpler but couldn't find something. I consider solutions like that to just be workarounds and hope there is something cleaner to achieve the same thing.

• But it does not localize them in each tab like Bernd wants. Or maybe I've missed something. – Kuba May 29 '13 at 10:23
• @Kuba: that's true, but probably hard to avoid: if it would be local to the tab only, we can't access it, by definition. I see two possibilities to achieve that: either regenerate the tab content completely or create a "callback" to be accessable to the tab view selection-Dynamic. Both seem to not be simple to achieve. Maybe I'll get back when I have something working... – Albert Retey May 29 '13 at 10:33
• I Agree. So far I failed in in aproach to regenerate :) – Kuba May 29 '13 at 10:35
• Thanks for both proposals. If it's okay I'd wait if anyone comes up with a "regenerating" solution before I accept an answer? – Bernd May 29 '13 at 10:44
• @Bernd I would say You should wait :) – Kuba May 29 '13 at 10:47


text:
## Why CRC with EPROM?

Started by 1 month ago22 replieslatest reply 1 month ago78 views
On the one hand I feel guilty and embarrassed about asking all of my simplistic questions, but I always end up learning so much here.

This relates to my previous poser regarding how to initialize a struct in a union:  https://www.embeddedrelated.com/thread/13867/initi...

So, here’s the deal -- I’m in the process of building a 10-character display, where each character is a modern (tricolor LED-based) implementation of a 21-segment Victorian display from 1898. You can read more about this here: https://www.eejournal.com/article/recreating-retro...

I’m also using this as the basis for a series of Cool Beans Columns in the electronics and computing hobbyist magazine “Practical Electronics” in the UK: https://www.electronpublishing.com/

This little beauty is going to have a lot of modes and effects. This leads us to the settings, of which there will be a bunch, like the display format for the time mode (12 vs. 24 hour) and the display format for the date mode (YYYY/MM/DD vs. MM/DD/YYYY vs. DD/MM/YYYY) and which effect should be associated with which mode and…

The default settings will be stored in the program (in the DefSettings variable from my previous post) but the user can change these defaults and the updated versions will be stored in the MCU’s EEPROM.

Apart from anything else, this is providing us with a “teachable moment” about checksums in general and CRCs in particular, because we are going to generate our own CRC using an LFSR for the data stored in the EEPROM.

So, finally, my question… what reason should I give for having to use a CRC for the data in the EEPROM in the first place? Is EEPROM so unreliable? How can I position this to beginners?

Thanks as always for your taking the time to peruse and ponder my rambling musings -- Max
[ - ]

Hi Max.

There are a few reasons that I see for it.  One, erasing and writing the eeprom takes a long time (in microcontroller time) and many operations, and if the user does something like turn off the power in the middle of a write, it could end up with corruption.

Also there's the matter of wearout of the eeprom, which could cause errors down the road, or quickly if the programmer does something like write to the eeprom every millisecond...

And then, there's the chance that the read itself might be corrupted by noise or an unfortunate cosmic ray event.

John

[ - ]

Hi John -- thanks so much -- this is just what I needed -- Max

[ - ]

To overcome data corruption (due to cell wearing/power failure/whatever) you can write always sequentially two identically data sets. If, when reading, one CRC is bad, you still have one good copy. If both CRCs are bad, you're stuck.

[ - ]

Ooh -- that is a great point -- I hadn't thought of that -- thanks for sharing.

[ - ]

There could be one third...security. We always forget it

[ - ]

What do you mean by security?

[ - ]

Security is when you are in a beach from the moon drinking a fresh bear and you Know that noone will change your bear for something.

That is security...jejeje

[ - ]

Sorry, I don't understand how security relates to CRCs.

[ - ]

Sorry It was a Joke.

Whit CRC you can test and repair data from EEPROM. If one hacker change the data from de EEPROM you could repair them. If dont you cant.

The only impossible is that you'll are in a beach from the moon....

Thanks and sorry

[ - ]

With CRC you can:

test: yes

repair: no! You need redundancy to repair data ...

[ - ]

I'll see it. I think remember that was possible. Maxmaxfield havent sponken about that point.

Repass is good always. Anyway I'll see it.

Thank you very much

[ - ]

I just rapid take a look and the solution was Hamming code. Not CRC

a thousand sorries.

[ - ]

Another approach with similar error detection capabilities to CRCs, but which doesn't require bit-level manipulations and bit shifting, is the Fletcher's Checksum.

I've employed this approach in a couple of projects in order to avoid programmer unfamiliarity with those bit-level operations. Another reason to consider it is that certain programming languages don't provide the necessary operators to easily implement CRCs: Visual Basic.

Regardless, error detection of any critical data, critical for the mission / application, should be provided. The available devices are sufficiently large enough, that consideration should be given to whether error correction using Hamming codes or something as simple as Triple Modular Redundancy (TMR) should be used as well.

[ - ]
"Another approach [...] is the Fletcher's Checksum" I've never heard of that -- now I'm excited to learn something new -- I will Google that as soon as a get a free moment -- thanks for sharing -- Max
[ - ]

It's not that EEPROM is unreliable it's that you cannot guarantee that your writes will be coherent WRT the data structures you are writing out to the EEPROM. If I have a struct like this:

struct Entry {
uint32_t version;
uint32_t length;
uint32_t length_complement;
uint32_t crc;
uint8_t  data[]; // Flexible array member
};

static uint8 s_buffer[4 * sizeof(uint32_t) + 32 * 1024)];
struct Entry *s_entry = (struct Entry *) s_buffer;

s_entry->version = 0x100;
s_entry->length = 0x8000;
s_entry->length_complement = ~s_length;
memset(s_entry->data, 'D', s_entry->length);
s_entry->crc = calc_crc(s_entry);

eeprom_write(<some-offset>, s_buffer, sizeof buffer);

And the erase page size is < 32k then eeprom_write() will need to erase and program more than one page to complete the write coherently. What if the CPU resets due to a brown-out condition or a poorly time user reset while writing these pages? The CRC will not match on read-back if you use the CRC and you'll know the entry is junk. If you assume things are fine you could be processing junk.

[ - ]

Hi Mr. Firmware -- this is great feedback -- thanks so much for taking the time to share. One thing I'm going to note in my column is that my project is a simple clock, but the reason for getting this right is to prepare us for creating mission-critical systems in the future.

[ - ]

You bet. Be sure to specify a C ISO standard, e.g. "C11" and then stick to it. Don't go back to the dark pre-C99 days.

[ - ]
"Don't go back to the dark pre-C99 days." But they were so exciting -- so much was unknown -- porting a program was full of mystery and adventure LOL
[ - ]

#### Linear Feedback Shift Registers for the Uninitiated, Part XV: Error Detection and Correction

[ - ]

Awesome -- thanks as always for sharing -- Max

[ - ]

jmford94 and others have given the primary reasons. Other items/raw notes not explicitly noted:

• Using a CRC or other checksum (I personally use one per logical grouping of settings) also helps the software determine, during boot up, if the EEPROM or Flash is "raw" and must be initialized with default values.
• Always create a spreadsheet for the product that estimates the lifespan. Flash/EEPROM are typically the one piece of electronics in the product where the behavior of the user and/or software will impact the life of the product. I worked at Toshiba for over a decade, and they were rather religious about this. Every product had to have a written approval for EEPROM/Flash wear, with estimates based on software usage, behavior, etc. Toshiba required at least 7 years for our standard consumer products.
• If a particular NVM setting will be modified frequently, and is therefore negatively impacting the estimated product lifespan, it is now time to introduce banks for that setting, for wear leveling. This is why I always have each logical setting or related group of settings abstracted behind a class or API. The API may be doing nothing more than reading/writing to a single location in EEPROM. Or... it may be searching an assigned set of banks for the correct bank to read, or write, to help with wear leveling. EEPROM lifespans generally make it easier than Flash, and of course Flash typically involves banks with minimum erase sizes, etc.
• The CRC will also prove to be useful if you need banks for wear-leveling.
• Many microcontrollers will have a CRC HW function. I personally will generally just use whatever the HW provides for my CRC.

Hope that helps!

Best regards,

Matthew

https://covemountainsoftware.com/services/

[ - ]


text:
# Product of two continous functions is continous

1. Jun 24, 2011

### l888l888l888

1. The problem statement, all variables and given/known data
prove that the product of continous functions is continous

2. Relevant equations

3. The attempt at a solution
f is continous for all a. given epilon>0 there exists a delta>0 st |x-a|<delta implies |f(x)-f(a)|< episilon.g is continous for all a. given epilon>0 there exists a delta2>0 st |x-a|<delta2 implies |g(x)-g(a)|< episilon.|f(x)g(x)-f(a)g(a)|=|f(x)g(x)-f(x)g(a)+f(x)g(a)-f(a)g(a)|...
1. The problem statement, all variables and given/known data

2. Relevant equations

3. The attempt at a solution

2. Jun 24, 2011

### micromass

Staff Emeritus
Hi l888l888l888!

Continue on this path. Apply the triangle inequality to get a sum of two absolute values...

3. Jun 24, 2011

### l888l888l888

im sorry. I forgot to add that step. What i got was...
|f(x)g(x)-f(x)g(a)+f(x)g(a)-f(a)g(a)|<=
|f(x)||g(x)-g(a)|+|g(a)||f(x)-f(a)|. This was where I got stuck. But I do know from the assumptions that |g(x)-g(a)| and |f(x)-f(a)| are less that epsilon. so we get...
|f(x)||g(x)-g(a)|+|g(a)||f(x)-f(a)|<|f(x)|*epsilon+|g(a)|*epsilon?

4. Jun 24, 2011

### micromass

Staff Emeritus
Yes, the only problem lies with |f(x)| which is still dependent of x. But we know that

$$|f(x)-f(a)|<\varepsilon$$

Can we deduce something about $|f(x)|$ this way?

5. Jun 24, 2011

### l888l888l888

What do you mean. the only way I can think of seperating |f(x)| is...
epsilon>|f(x)-f(a)|>=|f(x)|-|f(a)|. but i dont even think that works because you have to put another absoulte vale around that last term????

6. Jun 24, 2011

### micromass

Staff Emeritus
Think of

$$|f(x)|=|f(x)-f(a)+f(a)|$$

7. Jun 24, 2011

### l888l888l888

Ok so |f(x)|=|f(x)-f(a)+f(a)|<=|f(x)-f(a)|+|f(a)|<epsilon + |f(a)|

8. Jun 24, 2011

### micromass

Staff Emeritus
Indeed, so that gives you what you're looking for.

9. Jun 24, 2011

### l888l888l888

10. Jun 24, 2011

### micromass

Staff Emeritus
Well, you've proven now that

$$|f(x)g(x)-f(a)g(a)|\leq \epsilon^2+\varepsilon |f(a)|+\varepsilon |g(a)|$$

Thus the left-hand side can be made arbitrarily small. And this is what you want...

11. Jun 24, 2011

### l888l888l888

OHHH. ok thanks!!!!

12. Jun 25, 2011

### l888l888l888

a minor detail that i overlooked was that f and g are continous real valued functions on a metric space M. needed to show fg is continous on M also. Does this change the outcome?

13. Jun 25, 2011

### micromass

Staff Emeritus
No. You can show in general that the multiplication map

$$\cdot:\mathbb{R}\times\mathbb{R}\rightarrow\mathbb{R}:(x,y)\rightarrow x\cdot y$$

is continuous (using techniques above). Then the product of two functions is continuous as composition of continuous functions:

$$fg=\cdot(f,g)$$

You may wish to work this out in detail.

14. Jun 25, 2011

I'm not an expert in topology, but if your metric is not defined as d(x,y) = |x-y| then you'll need modifications because your definition of being continuous assumes that the metric is the Euclidean metric but the outcome will be the same.

15. Jun 25, 2011

### l888l888l888

the metric is not defined specifically. where will the modifications need to be placed, just in the assumption of continuity?

16. Jun 25, 2011

### micromass

Staff Emeritus
You just need to modify the first bit:

That is, you'll need to change the appropriate absolute values with the metric. However, the absolute value of things like |f(x)-f(a)| remain because you're working in $\mathbb{R}$ there.

17. Jun 25, 2011

I think the definition of continuity says that a function f:X->Y is continuous at the point x if for any neighborhood of fx in Y there exists a neighborhood of x that its image is contained in the neighborhood of fx. in other words, fN(x,delta,X) must be a subset of N(fx,epsilon,Y). so, if your metric is defined to be the Euclidean metric, you'll have the old nice definition of continuity but if your metric is not Euclidean, then the calculations will be different because this time |x-a|<delta -> |f(x) - L|<epsilon is not necessarily what you have. I mean let our metric be something different and then this definition need to be modified to something that comes from our metric function.
Actually I'm a freshman in pure mathematics and have no experience in Topology, so maybe It was stupid to comment on something that I don't know much about it but I think that when the metric is not Euclidean the Bolzano definition of continuity should be modified. but still, that won't change the outcome I guess.

18. Jun 25, 2011

### micromass

Staff Emeritus
The only thing that needs to be modified for real-valued functions is the first absolute value. So it becomes

$$\forall \varepsilon>0:\exists \delta>0:\forall x:~d(x,a)<\delta~\Rightarrow~|f(x)-f(a)|<\varepsilon$$

19. Jun 25, 2011


text:
# Keep path within axis

In the following example:

\documentclass{article}
\usepackage{tikz, pgfplots}
\usepgfplotslibrary{fillbetween}
\pgfplotsset{compat=1.14}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot [name path = plot1] coordinates {
(0, 2)
(2, 5)
(3, 7)
};
\draw [name path = plot2] (0, 2) -- (5, 2);
\end{axis}
\end{tikzpicture}
\end{document}

the path plot2 extends out of the axis scope as seen in the result:

How to make the axis adjust itself to enclose the path plot2 as much as it does the adjustment to enclose the path plot1?

• Your definition of "within" is a bit strange, that line is cut off, so it never (visibly) goes outside the axis. Are you after something like \draw [name path = plot2] (0, 2) -- (\pgfkeysvalueof{/pgfplots/xmax}-0.5, 2);? Or \draw [name path = plot2] (0, 2) -- (end |- 5, 2);, after adding coordinate (end) at the end of the first \addplot? – Torbjørn T. Dec 6 '17 at 21:33
• @TorbjørnT. I want axis to adjust itself to enclose completely the path plot2 as much as it does the adjustment to enclose the path plot1. – Viesturs Dec 6 '17 at 21:36
• Any reason why you can't use \addplot for that line as well? – Torbjørn T. Dec 6 '17 at 21:40
• @TorbjørnT. In the end I would be using \path as the path plot2 does not need to be drawn. Can I use \addplot to construct a path and not draw the actual line? – Viesturs Dec 6 '17 at 21:41
• \addplot [draw=none,name path = plot2] coordinates {(0, 2)(5, 2)}; – Torbjørn T. Dec 6 '17 at 21:43

pgpflots doesn't take \paths into account when calculating the bounding box, but you can draw the line with \addplot instead. If the line should not be visible, add draw=none to the \addplot settings.

\documentclass{article}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\pgfplotsset{compat=1.14}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot [name path = plot1] coordinates {
(0, 2)
(2, 5)
(3, 7)
} coordinate (end);
\addplot [draw=none,name path = plot2] coordinates {(0, 2)(5, 2)};

\addplot [blue!10] fill between[of=plot1 and plot2];
\end{axis}
\end{tikzpicture}
\end{document}


text:
Elementary and Intermediate Algebra: Concepts & Applications (6th Edition)

An equation can be linear (such as $y=2x+3)$, quadratic (such as $y=x^2+3)$, cubic (such as $y=x^3$), and other degrees. Among these equations, only a linear equation has a line as its graph. Thus, the given statement is false.


text:
# Centimeters per second squared to feet per second squared

This free conversion calculator will convert centimeters per second squared to feet per second squared, i.e. cm/s^2 to fps^2. Correct conversion between different measurement scales.

The formula is $A_{fps^2} = 0.032808398950131 A_{\frac{cm}{s^2}}$, where $A_{\frac{cm}{s^2}} = 15$.

Therefore, $A_{fps^2} = 0.492125984251969$.

Answer: $15 \frac{cm}{s^2} = 0.492125984251969 fps^{2}$.