text:
# Indexing more than one field #31

Closed
opened this Issue Aug 19, 2012 · 32 comments

None yet

### 4 participants

Contributor
commented Aug 19, 2012
 Hello, I would like to index more than one fied, to have index entry like author!title!pages. I did'tn see how can I do. For yet, I index these 3 fields separtly and concate them bt python script.
Owner
commented Aug 22, 2012
 I'm not sure this is currently possible as the indexing of say "author" uses an internal macro which has to look at the structure of the name - it's not as simple as just \index{field}. It may be possible to implement something but it looks tricky. @josephwright or @aboruvka?
Contributor
commented Aug 22, 2012
 Yes, I understand it's not easy. Right now, I have just make a python scritpt maieul/indexation-sources, but I think it's not very easy to use for other people (it's need terminal)
Collaborator
 One workaround you could try is to save the indexsorttitle, title and pages fields and use these in a bibliography macro like index:name. I can look into a real fix over the weekend.
Contributor
commented Aug 22, 2012

## yes, it could be. But now the solution with script python is functional. Not very easy, but functional.

Le 22 août 2012 à 15:05, aboruvka a écrit :

One workaround you could try is to save the indexsorttitle, title and pages fields and use these in a bibliography macro like name:index. I can look into a real fix over the weekend.

Reply to this email directly or view it on GitHub.

Collaborator
 @maieul I'm not sure what you mean. Coincidentally Paul demonstrated a workaround similar to the one I mentioned here: http://tex.stackexchange.com/a/68208.
Contributor
commented Aug 22, 2012
 @aboruvka I explain my technic in a french article.
Collaborator
 You can extend the existing bibliography macros in biblatex.def to index multiple fields. Care is needed in expansion and sorting. Index entries for titles, for example, should have the form @. Here  should not be fully expanded to ensure correct formatting in the "actual"/printed index entries. Control sequences like \TeX should be protected (\protect\TeX) unless you're using a robust indexing package like index. Indexing page references in the postnote field isn't straightforward. In the code below, page ranges are sorted only using the starting value. \makeatletter \def\thefirstpage#1{\thefirstpage@i#1-&} \def\thefirstpage@i#1-#2&{#1} \makeatother \DeclareIndexNameFormat{title:pages}{% \ifboolexpr{ not test {\iffieldundef{title}} and test {\iffieldnums{postnote}} } {\usebibmacro{index:entry}{\index}{% \mkbibindexname{#1}{#3}{#5}{#7}% \mkbibindexsubentry {\thefield{indexsorttitle}}{\emph{\csfield{indextitle}}}% \mkbibindexsubentry {\usefield{\thefirstpage}{postnote}}{\usefield{\mkfirstpage}{postnote}}}} {}} \renewbibmacro*{citeindex}{% \ifciteindex{\indexnames[title:pages]{labelname}}{}} There are multiple ways to specify page ranges. This just handles range delimiters starting with a hyphen.
 I think it's likely to be very hard to offer a suitable interface, for a range of reasons. Among other things: the very wide range of possible different use cases; the different formats used by different multiple index packages; problems with expansion and so forth. It seems to me that this may be more a documentation issue than a package coding issue. Any sophisticated indexing system (beyond that already provided, I mean) is going to need to be written by delving rather deeply into some rather difficult stuff, especially with expansion. It's hard (at least, I find it very hard). But it's not impossible, even as things stand, and for my own part I'd rather doubt that the effort that would have to go into developing a fully flexible system at the package level would be worthwhile, because I think you'd either end up with something simply but inflexible or something immensely complex. So some modest development along the lines Audrey suggests seems exactly right to me, FWIW.
Owner
commented Aug 23, 2012
 I agree - it's impossible to do a generic interface - I think Audrey's documentation solution is a very good idea. I'm not even sure there is much point putting a new macro in biblatex.def, it's fine in the docs?
Collaborator
 I think the author-title index is fairly common. This motivates putting a new indexing macro in biblatex.def. If you have a strong preference either way, I'll go with that. Just let me know. I can push the changes in the next few days.
Contributor
commented Aug 23, 2012
 yeh, the author title is very common. For my personal use, I make author title titleaddon. Titleaddon is use for de division of source (which is different of pagination). I think the best way for user will be a macro which allow to define every part of index command (between each !). For example :  \indexentry{format1!format2!format3}  And the auhor will have to define 3 formats of indexing, and will have to check for expansion and sorting.
Collaborator
 @maieul This is easier said than done. The \theindexentry needs to be expanded inside a formatting directive; you can't simply build an index entry from the output of three separate directives. I suppose we could define multi-field formatting directives, but we would need to know the field data types (e.g. name list, literal list, field) and iterating through multiple list fields would be messy. If we go through all this trouble and still put the onus of of proper sorting and expansion on the user, I'd have a hard time seeing an improvement of this new interface over the current one.
Contributor
commented Aug 23, 2012
 yes, I understand it's not easy. I just say the ideal way. But I won't be angry if you can't ;-)
Owner
commented Aug 23, 2012
 I will bow to Audrey on this - I am not as competent to judge it, so whatever you think is best.
 Just a quick note on Audrey's code above, which I have been playing with overnight (largely in order to correct an answer I wrote on tex/sx) ... with some frustration. Audrey's code works perfectly if we are using index to create multiple indexes: but it fails for multind or imakeidx. If you run it through them, the indextitle field still seems to end up fully expanded. I only have a suspicion about why that's happening (there's a comment in the code in biblatex.def which gives a hint that different systems expand differently); and I don't really understand why the "ordinary" title indexing system (which "expands" the indextitle under a \DeclareIndexFormat control and then passes it to the indexing macro) doesn't. Even simple expansion issues tend to puzzle me, and while I think I understand Audrey's code I can't pretend to have a clear grasp of everything that's going on. At the end of this comment I've posted an example file which can be used to play around with: basically you can comment or uncomment some lines at the start and end, and see the results using either index, multind or imakeidx. I do have a tentative workaround, which I think will be "index-backend-agnostic": if, instead of trying to (partially) expand the indextitle field one simple replaces it in the indexing command with an unexpanded \citefield{\thefield{entrykey}}{indextitle}, then we avoid expansion trouble: in other words, we seem to be OK with zero expansion, but even partial expansion in the edef trips us up. I think this works, though it vexes me to get there by trial or error rather than logic. (The technique is one I have used in oscola, where I needed to print very complex index entries, effectively full citations; but that's another story.) I've also put this alternative in the example, but commented out, if anyone wants to play with it. I guess what this does underline is the difficulty of arriving at GENERAL solutions, given the need to interface with other packages with their own quirks. Good luck deciding what to do! \documentclass{article} \usepackage[style=verbose,indexing=cite,backend=biber]{biblatex} \addbibresource{biblatex-examples.bib} % using index %\usepackage{index} %\newindex{authortitle}{adx}{and}{Author Title Index} % using imakeindex \usepackage{imakeidx} \makeindex[name=authortitle, title={Author Title Index}] % using multind %\usepackage{multind} %\makeindex{authortitle} \makeatletter \def\thefirstpage#1{% \expandafter\expandafter\expandafter\firstpage@i \expandafter\expandafter\expandafter{\csname abx@field@#1\endcsname}} \def\firstpage@i#1{\firstpage@ii#1-\@nil} \def\firstpage@ii#1-#2\@nil{#1} \newbibmacro*{index:name:title:pages}[5]{% \begingroup \ifuseprefix {\def\abx@tempa{% \ifblank{#4}{}{#4 }% \@firstofone #2% remove spurious braces \ifblank{#5}{}{ #5}% \ifblank{#3}{}{, #3}% \actualoperator \ifblank{#4}{}{\MakeCapital{#4} }% #2% \ifblank{#5}{}{ #5}% \ifblank{#3}{}{, #3}}} {\def\abx@tempa{% \@firstofone #2% remove spurious braces \ifblank{#5}{}{ #5}% \ifblank{#3#4}{}{,}% \ifblank{#3}{}{ #3}% \ifblank{#4}{}{ #4}}}% \savefield{indextitle}{\abx@tempb}% \iffieldpages{postnote} {\protected@edef\theindexentry{\unexpanded{#1}{% \abx@tempa!\thefield{indexsorttitle}% \actualoperator\emph{\expandonce\abx@tempb}% !\thefirstpage{postnote}\actualoperator\thefield{postnote}}}} {\protected@edef\theindexentry{\unexpanded{#1}{% \abx@tempa!\thefield{indexsorttitle}% \actualoperator\emph{\expandonce\abx@tempb}}}}% \theindexentry \endgroup} % ALTERNATIVE APPROACH %\renewbibmacro*{index:name:title:pages}[5]{% % \begingroup % \ifuseprefix % {\def\abx@tempa{% % \ifblank{#4}{}{#4 }% % \@firstofone #2% remove spurious braces % \ifblank{#5}{}{ #5}% % \ifblank{#3}{}{, #3}% % \actualoperator % \ifblank{#4}{}{\MakeCapital{#4} }% % #2% % \ifblank{#5}{}{ #5}% % \ifblank{#3}{}{, #3}}} % {\def\abx@tempa{% % \@firstofone #2% remove spurious braces % \ifblank{#5}{}{ #5}% % \ifblank{#3#4}{}{,}% % \ifblank{#3}{}{ #3}% % \ifblank{#4}{}{ #4}}}% % \iffieldpages{postnote} % {\protected@edef\theindexentry{\unexpanded{#1}{% % \abx@tempa!\thefield{indexsorttitle}% % \actualoperator\unexpanded{\citefield}{\thefield{entrykey}}{indextitle}% % !\thefirstpage{postnote}\actualoperator\thefield{postnote}}}} % {\protected@edef\theindexentry{\unexpanded{#1}{% % \abx@tempa!\thefield{indexsorttitle}% % \actualoperator\unexpanded{\citefield}{\thefield{entrykey}}{indextitle}}}}% % \theindexentry % \endgroup} \global\newtoggle{usingmultind} \AtBeginDocument{% \@ifpackageloaded{multind} {\@ifpackageloaded{imakeidx} {\global\togglefalse{usingmultind}} {\global\toggletrue{usingmultind}}}% {\togglefalse{usingmultind}}} \togglefalse{usingmultind} \makeatother \DeclareIndexNameFormat{title:pages}{% \iftoggle{usingmultind} {\usebibmacro{index:name:title:pages}{\index{authortitle}}{#1}{#3}{#5}{#7}} {\usebibmacro{index:name:title:pages}{\index[authortitle]}{#1}{#3}{#5}{#7}}} \renewbibmacro*{citeindex}{% \ifciteindex{\indexnames[title:pages]{labelname}}{}} \begin{document} \cite{knuth:ct:a} \cite[234]{knuth:ct:a} \cite{knuth:ct:d} %multind %\printindex{authortitle}{Author-Title Index} % imakeidx and index \printindex[authortitle] \end{document}
Collaborator
 @PaulStanley Thanks. I've since simplified the code, but need to do more testing. So this is very helpful. Does PL's indextitle formatting directive work here?
 @aboruvka It works perfectly with the existing macros where you simply index the title, and that pumps the indextitle out using a \DeclareIndexFieldFormat... and that in turn gets passed through to the protected@edef wrapped in \unexpanded: then we get "one level" of expansion, whichever indexing package we use (i.e. we "see" the field as written in the .bib file, without any further expansion). But that deals only with one field, and I couldn't work out how to deal with multiple fields that way (in other words, there is no analogue for an index of the driver that applies to formatting bibliography entries) -- so we are either working on the \IndexNameFormat for author OR on the \IndexFieldFormat for title, but I couldn't work out how to get both at the same time; there's a very complex flow of data through various macros at this point and that, coupled with my own obtuseness about expansion and the interaction with the indexing packages, means I can't pretend to have got to the bottom of it. I'm sure you will. It's an additional curse that there are so many indexing packages with their little quirks and some voodoo of their own, but I suppose that's just a fact to be faced.
Collaborator
 @PaulStanley Works perfectly with every package? imakeidx fully expands \TeX in the titles on my end.
 @aboruvka You might be right. I don't think I tested with imakeidx last night; I think I did test with multind, which was OK. I did no testing at all with splitindex as such. (My code above does work with imakeidx ... unless I'm going mad!)
Collaborator
 @PaulStanley Sorry for the confusion - I didn't test your code. I'm just trying to see if example 21 runs with packages other than index. The reasoning being that if PL's directives don't work with some packages, we may not want to bother pursuing a solution for them. imakeidx seems problematic because it doesn't generate "self-protecting" entries like index. Do you mind if I bother you via email when I look at this again in the next few days? I think I need some help with testing. We should also look at what you're doing with oscola in considering any new indexing features. @plk I'll copy you on any correspondence.
Owner
commented Aug 24, 2012
 I really appreciate this - it's beyond my TeX abilities. Maybe @PaulStanley would consider joining the biblatex development team? My emphasis is usually on biber and it would be good to have another TeX person sine Joseph is often very busy with latex3 things.
 @aboruvka By all means -- though I have a very heavy week of teaching next week so I don't guarantee to be very immediately responsive. I'd rather you didn't look too hard at oscola, because the indexing is rather a mess and needs cleaning up, though it appears to be working. I had difficulty getting neat expansion of macros which "pick apart" references like 1(2) so as to produce \index{blah@blah!1!2} and the result was what I think Andrew Stacey called "cargo-cult" code which would shock your sensibilities. But the basic idea of dealing with difficult formatting by writing an unexpanded \cite command to the index file, and actually doing the typesetting when it comes back in may not be totally mad. (Probably all you really need to know is that I define a citation command (\citeinindex) which never indexes itself or bothers with prenotes and postnotes, and which calls a variant driver for each entry-type to print suitable text. The primary sorted part of the index I deal with using indexsorttitle or other fields that get constructed by biber in some cases. I then write the \citeinindex completely unexpanded via the \index macro, so that all the indexing software ever sees is {blah@\citeindex{foo}!w@x!y@z. And do bear in mind that of necessity this is (a) designed for a specialised use where macro problems are unlikey to occur and (b) only tested so far on a limited set of data. I certainly wasn't trying to solve the problem you are dealing with here.) There is an advantage to supporting at least one of imakeidx or splitindex, given the hardwired limitation on output files. It might seem absurd to suppose that one might need nine or ten separate indexes ... but I'm afraid legal writing is replete with absurdity, and I don't think index will do the job. But it might be reasonable to put the onus on style authors who want to support them to do the legwork. Biblatex is a Swiss army knife, to be sure, but even then there are just so many blades and widgets you can support.
Collaborator
 @PaulStanley Great. Thanks. The indexing syntax is generic so it'll support the standard indexing packages; the results just may not be as robust as they are with index. I think we can make up for that with some additional documentation. imakeidx users for example will occasionally have to protect fields used in the index: indextitle = {\protect\TeX book}. Regarding oscola - The code I have going right now adds more auxiliary commands for low-level access to unformatted fields. You might find them helpful. I'll pickup this discussion via email soon.
 @plk I doubt that I would contribute usefully as a member of the team in any formal sense: I don't have Audrey's mastery, just a bunch of war wounds, acquired in a rather obscure battle! But I'm certainly happy to help as much as I can. FWIW my next biblatexy project was to try to produce some sort of tutorial introduction, perhaps especially on adaptation, because quite a lot of people find the comprehensive documentation, excellent as it is, rather forbidding.
Owner
commented Aug 24, 2012
 Well, that tutorial introduction has been very much needed and requested so if you would tackle that, it would be great and we'd certainly include it with biblatex.
added a commit that referenced this issue Aug 27, 2012
 aboruvka Refinements to indexing macros (#31) 9fed7f7
Collaborator
 The referenced commit provides some extensions to the indexing macros. You can build index entries using the bibmacro index:entry{}{}. Additional macros aid in formatting the entry. I've updated the code I posted above to give an example.
Contributor
commented Aug 27, 2012
 thank a lot. I will made test after closing some ticket in maieul/ledmac. Thank
added a commit that referenced this issue Aug 28, 2012
 aboruvka Updated docs (in part #31) 166747d
referenced this issue Sep 1, 2012
Closed

Contributor
commented Sep 2, 2012
 Hello, I juste made test. with a single example :  \renewbibmacro*{citeindex}{% \ifciteindex {\indexnames[name-title]{labelname}}{}} \DeclareIndexNameFormat{name-title}{ \usebibmacro{index:entry}{\index[name-title]}{% \mkbibindexname{#1}{#3}{}{#5}% \subentryoperator% \mkbibindexfield{\thefield{indexsorttitle}}{\emph{\thefield{title}}} \subentryoperator\mkbibindexfield{\thefield{titleaddon}}{\thefield{titleaddon}}} }  (i will add test for empty field later and for sorting). I think the issue can be closed.
Contributor
commented Sep 2, 2012
 and so think a lot !
closed this Sep 2, 2012
reopened this Sep 2, 2012
Collaborator
commented Sep 6, 2012
 @maieul Are the new macros sufficient? Can we close this one?
Contributor
commented Sep 6, 2012
 I think it's ok. We can have sub entry, so every can be possible with standard biblatex macro. Think a lot (it's very dommage that it' can be in previous version of biblatex, I could integrate that in my book http://geekographie.maieul.net/95)
Collaborator
commented Sep 6, 2012
 @maieul OK. Thanks for this feature request. I think we've made some improvements here.
closed this Sep 6, 2012
was assigned Oct 4, 2012
referenced this issue in maieul/latexhumain Feb 4, 2015
Open


text:
## Politics

Some of the usual suspects are out this morning with criticism of Tom Carper’s compromise proposal to insert a robust public option into the Democrats’ health care bill, but allow states to opt out of it by legislative or popular action. I’m not going to call these people out by name because I consider some of them friends and they’re doing good, important, productive work. But this compromise is leaps and bounds better than most of the others that have been floated, such as Chuck Schumer’s proposal to have a public insurance option that would be forced to negotiate at private market rates. Here’s why:

1) If the public option is indeed popular — and the preponderance of public polling suggests that it is — we should expect the solid majority of states to elect to retain it. Perhaps some Republican governors or legislatures would seek to override the popular will in their states — but they would do so at their own peril (and at Democrats’ gain).

2) Behavioral economics further suggests that default preferences are extremely powerful. Making the public option the default would probably lead to much greater adaptation than requiring states to “opt in”.

All Politics

### The Eagles, Cowboys And Giants Look Good Next To The Disaster In D.C.Sep 4, 2015

Never miss the best of FiveThirtyEight.

format: plain


text:
Build a deterministic Go AI

Here's an interesting problem I thought of the other day, which involves bits of code competing against other bits of code not just in a property that the code has, but by playing a game against those other bits of code.

Your task is to build a program that takes the current state of a Go board, and determines what move to make or to pass.

Your program will accept the following as input:

• 19 lines, each with 19 characters, representing the pieces currently on the Go board. A character of 0 represents an empty square, 1 is black, and 2 is white.

• Two numbers representing the number of prisoner pieces each player has (black, then white).

• One number representing whose turn it is to move (black or white). As above, 1 is black, and 2 is white.

and output one of the following:

• A pair of coordinates a b representing the coordinates at which to move. 1 1 is the top-left square, and the first and second numbers represent moving down and to the right respectively.

• The string pass, which represents a move to pass.

For example, the program may receive the following input:

0000000000000000000
0000000000000000000
0000000000000000000
0001000000000002000
0000000000000000000
0000000000000000000
0001210000000000000
0000100000000000000
0000000000000000000
0000000000000000000
0000000000000000000
0000000000000000000
0000000000000000000
0000000000000000000
0000000000000000000
0002000000000001000
0000000000000000000
0000000000000000000
0000000000000000000
0 0 1

which represents a game where only a few moves have been played.

Then the program might output 6 5, which means "put a black stone on the point 6th from the top and 5th from the left". This would capture the white stone at 7 5. The state of the board would then change to:

0000000000000000000
0000000000000000000
0000000000000000000
0001000000000002000
0000000000000000000
0000100000000000000
0001010000000000000
0000100000000000000
0000000000000000000
0000000000000000000
0000000000000000000
0000000000000000000
0000000000000000000
0000000000000000000
0000000000000000000
0002000000000001000
0000000000000000000
0000000000000000000
0000000000000000000
1 0 2

(Note that although a white stone was captured, it counts as a prisoner for black.)

• If your program is given the same input state, it must always produce the same output. This is the determinism of the Go AI. It must not have a random component.

• Your program must not take more than approximately 60 seconds to determine what move to make. This rule will not be strictly applied due to variations in computing power, but it must make a move in a reasonable amount of time.

• Your program's source code must not exceed a total of 1 megabyte (1,048,576 bytes).

• Your program must always make legal moves. Your program cannot make a move where a stone already exists, and cannot place a piece that would result in a group of its own stones being captured. (One exception to the rules for the purposes of this challenge is that a program is allowed to create a position that was originally there - because it is only given the current position of a board, it cannot be expected to store which moves had been made before.)

Your submission will then play in an all-play-all tournament against all the other submissions, in a game of Go where the state of the board begins as empty, and each program takes turns being fed the position of the board and making a move.

Each pair of submissions will play two rounds - one round with each player being black. Because the AIs in this problem are completely deterministic, two of the same AIs playing together will always result in exactly the same game being played.

Conditions for a win are as such:

• If your program plays to the end of the game, the Chinese scoring rules of Go will be used to determine the winner. No komi will be applied.

• If your program plays to the point that an earlier state is reached, thus causing an infinite loop, the two programs will be declared to have tied.

Your submission will be scored by how many points it scores against other submissions. A win is worth 1 point, and a tie is worth half a point. The submission with the most points is the overall winner.

This is a king-of-the-hill challenge, in which anybody can post a new entry at any time, and the standings will be re-evaluated periodically when this happens.

• Ok, waiting for all other submissions and then write my own in order to beat them - should be possible since the solutions are deterministic. – Howard Jan 14 '14 at 7:50
• It seems playing in ko such that the previous position is repeated is allowed but leads to immediate draw (since it causes a loop). Interesting... – FireFly Jan 14 '14 at 11:04
• Looks like that your problem is too dificult and nobody would work hard enough to produce a worthful answer (it is really a lot of work). It is a nice problem, but go is way too hard to work with. – Victor Stafusa Jan 19 '14 at 6:31
• Why not use a smaller board? 9x9 is common enough for beginner players. It cuts the search space down dramatically, but it's not so small that it's been "beaten" yet by analysis (I think the largest that's been fully solved is 5x6). – Geobits Mar 6 '14 at 3:09
• How does input work? stdin or command line arguments? – Ypnypn May 4 '14 at 16:35

Here is my entry to get this challenge off the ground. Python code:

print "pass"

According to your rules always playing "pass" is a valid (albeit bad) strategy.

• Your code will always lose against anyone that makes any play against it. Still, nice base-case answer. – Joe Z. Jan 14 '14 at 17:09
• @JoeZ. And from the looks of it he won with it :P – David Mulder Apr 2 '14 at 16:10

Java : Pick a spot, any spot

Simply chooses spots on the board to test for validity. It uses the PRNG, but with a set seed so that's it's deterministic. It uses different chunks of the PRNG cycle depending on how many turns have passed.

For each candidate position, it checks to see that it's a valid move (but not that it's a smart move). If it isn't, it moves on to the next candidate. If it cannot find a valid move after 1000 tries, it passes.

import java.util.Random;
import java.util.Scanner;

public class GoNaive {

int[][] board;
boolean[] checked;
int me;

public static void main(String[] args) {
new GoNaive().run();
}

void run(){
int turns = init();
Random rand = new Random(seed);

for(int i=0;i<turns*tries;i++)
rand.nextInt(size*size);

for(int i=0;i<tries;i++){
int pos = rand.nextInt(size*size);
for(int c=0;c<size*size;c++)
checked[c]=false;
if(board[pos%size][pos/size] == 0)
if(hasLiberties(pos, me)){
System.out.print((pos%size+1) + " " + (pos/size+1));
System.exit(0);
}
}
System.out.print("pass");
}

boolean hasLiberties(int pos, int color){
if(checked[pos])
return false;
checked[pos] = true;

int x = pos%size, y=pos/size, n;

if(x>0){
n = board[x-1][y];
if(n==0 || (n==me && hasLiberties(y*size+x-1, color)))
return true;
}
if(size-x>1){
n = board[x+1][y];
if(n==0 || (n==me && hasLiberties(y*size+x+1, color)))
return true;
}
if(y>0){
n = board[x][y-1];
if(n==0 || (n==me && hasLiberties((y-1)*size+x, color)))
return true;
}
if(size-y>1){
n = board[x][y+1];
if(n==0 || (n==me && hasLiberties((y+1)*size+x, color)))
return true;
}
return false;
}

int init(){
int turns = 0;
board = new int[size][size];
checked = new boolean[size*size];
turns = 0;
Scanner s = new Scanner(System.in);
String line;
for(int i=0;i<size;i++){
line = s.nextLine();
for(int j=0;j<size;j++){
board[j][i] = line.charAt(j)-48;
if(board[j][i] > 0)
turns++;
}
}
String[] tokens = s.nextLine().split(" ");
turns += Integer.valueOf(tokens[0]);
turns += Integer.valueOf(tokens[1]);
me = Integer.valueOf(tokens[2]);
s.close();
return turns;
}

final static int size = 19;
final static int seed = 0xdeadface;
final static int tries = 1000;
}

Some Scala:

package go;

class Go {
def main(args : Array[String]) {
System.out.printLn("1 1")
System.out.printLn("pass")
}
}

From reading Wikipedia, I think this will beat the current solution.

• In fact, it will win by 361 points in both cases. – Joe Z. Apr 26 '14 at 18:03
• Actually, I'll have to take that back, it doesn't follow spec. The AI is supposed to be stateless. It's only actually supposed to print one thing given the state of the board, and you've made it print two (1 1 and pass). – Joe Z. Apr 29 '14 at 22:53
• @JoeZ. Fixed it. Wouldn't have compiled anyway. – yayestechlab May 4 '14 at 15:43
• That will always print 1 1, actually, since the program is always run anew every time the board changes. – Joe Z. May 4 '14 at 17:51

Java

public class Go {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
for (int i = 0; i < 361;) {
char c = s.nextChar();
if (c != '\n') {
if (c == '0') {
System.out.println((i % 19 + 1) + " " + (i / 19 + 1));
System.exit(0);
}
i++;
}
}
}
}

Chooses the first empty space. Wins against any of the AIs as of time of posting.

• This doesn't guarantee a legal move. If the first available space has no liberties, it can't be played. For instance, if this AI played itself: After the first row of alternating pieces, 1 1 would be captured by white (now empty) and could not be played by black on the next turn. – Geobits May 5 '14 at 15:06


text:
# zbMATH — the first resource for mathematics

Qualitative analysis of differential, difference equations, and dynamic equations on time scales. (English) Zbl 1354.00078
From the text: It is our pleasure to present this special issue. Differential, difference, and dynamic equations on time scales are often used for modeling various problems arising in the engineering and natural sciences. Therefore, analysis of qualitative properties of solutions to such equations is crucial for applications. It is important to develop new efficient methods, as well as to modify and refine well-known techniques adjusting them for the analysis of new classes of problems.
##### MSC:
 00B15 Collections of articles of miscellaneous specific interest 34-06 Proceedings, conferences, collections, etc. pertaining to ordinary differential equations 34N05 Dynamic equations on time scales or measure chains 39-06 Proceedings, conferences, collections, etc. pertaining to difference and functional equations
RODAS; ROS3P
Full Text:
##### References:
 [1] Adam, Y., Highly accurate compact implicit methods and boundary conditions, Journal of Computational Physics, 24, 1, 10-22, (1977) · Zbl 0357.65074 · doi:10.1016/0021-9991(77)90106-1 [2] Mitchell, A. R.; Griffths, D. F., The Finite Difference Method in Partial Differential Equations, (1980), John Wiley & Sons, New York, NY, USA [3] Ramos, J. I., Linearization methods for reaction-diffusion equations: multidimensional problems, Applied Mathematics and Computation, 88, 2-3, 225-254, (1997) · Zbl 0904.65089 · doi:10.1016/S0096-3003(96)00327-X [4] Ramos, J. I., Implicit, compact, linearized $$\theta$$-methods with factorization for multidimensional reaction-diffusion equations, Applied Mathematics and Computation, 94, 1, 17-43, (1998) · Zbl 0943.65098 · doi:10.1016/S0096-3003(97)10103-5 [5] Chu, P. C.; Fan, C., A three-point combined compact difference scheme, Journal of Computational Physics, 140, 2, 370-399, (1998) · Zbl 0923.65071 · doi:10.1006/jcph.1998.5899 [6] Luan, V.; Ostermann, A., Exponential rosenbrock methods of order five–construction, analysis and numerical comparisons, Journal of Computational and Applied Mathematics, 255, 1, 417-431, (2014) · Zbl 1291.65201 · doi:10.1016/j.cam.2013.04.041 [7] Luan, V. T.; Ostermann, A., Explicit exponential Runge-Kutta methods of high order for parabolic problems, Journal of Computational and Applied Mathematics, 256, 168-179, (2014) · Zbl 1314.65103 · doi:10.1016/j.cam.2013.07.027 [8] Kassam, A.-K.; Trefethen, L. N., Fourth-order time-stepping for stiff pdes, SIAM Journal on Scientific Computing, 26, 4, 1214-1233, (2005) · Zbl 1077.65105 · doi:10.1137/S1064827502410633 [9] Rosenbrock, H., Some general implicit processes for the numerical solution of differential equations, The Computer Journal, 5, 329-330, (1963) · Zbl 0112.07805 [10] Haines, C. F., Implicit integration processes with error estimate for the numerical solution of differential equations, The Computer Journal, 12, 2, 183-188, (1969) · Zbl 0185.41203 [11] Liao, W.; Yan, Y., Singly diagonally implicit Runge-Kutta method for time-dependent reaction-diffusion equation, Numerical Methods for Partial Differential Equations, 27, 6, 1423-1441, (2011) · Zbl 1243.65112 · doi:10.1002/num.20589 [12] Dahlquist, G. G., A special stability problem for linear multistep methods, BIT Numerical Mathematics, 3, 27-43, (1963) · Zbl 0123.11703 · doi:10.1007/BF01963532 [13] Gourlay, A. R., A note on trapezoidal methods for the solution of initial value problems, Mathematics of Computation, 24, 629-633, (1970) · Zbl 0233.65040 · doi:10.1090/S0025-5718-1970-0275680-3 [14] Hairer, E.; Wanner, G., Solving Ordinary Differential Equations, II, Stiff and Algebraic Problems, (1996), Springer, Berlin , Germany · Zbl 1192.65097 · doi:10.1007/978-3-642-05221-7 [15] Alexander, R., Diagonally implicit Runge-Kutta methods for stiff O.D.E.’s, SIAM Journal on Numerical Analysis, 14, 6, 1006-1021, (1977) · Zbl 0374.65038 · doi:10.1137/0714068 [16] Burrage, K.; Butcher, J. C.; Chipman, F. H., An implementation of singly-implicit Runge-Kutta methods, BIT Numerical Mathematics, 20, 3, 326-340, (1980) · Zbl 0456.65040 · doi:10.1007/BF01932774 [17] Claus, H., Singly-implicit Runge-Kutta methods for retarded and ordinary differential equations, Computing, 43, 3, 209-222, (1990) · Zbl 0695.65047 · doi:10.1007/BF02242918 [18] Liniger, W.; Willoughby, R. A., Efficient integration methods for stiff systems of ordinary differential equations, SIAM Journal on Numerical Analysis, 7, 47-66, (1970) · Zbl 0187.11003 · doi:10.1137/0707002 [19] Verwer, J. G.; Spee, E. J.; Blom, J. G.; Hundsdorfer, W., A second-order rosenbrock method applied to photochemical dispersion problems, SIAM Journal on Scientific Computing, 20, 4, 1456-1480, (1999) · Zbl 0922.65031 · doi:10.1137/S1064827597326651 [20] Lang, J.; Verwer, J., ROS3P–an accurate third-order rosenbrock solver designed for parabolic problems, BIT Numerical Mathematics, 41, 4, 731-738, (2001) · Zbl 0996.65099 · doi:10.1023/A:1021900219772 [21] Hundsdorfer, W. H., Stability and B-convergence of linearly implicit Runge-Kutta methods, Numerische Mathematik, 50, 1, 83-95, (1986) · Zbl 0611.65045 · doi:10.1007/BF01389669 [22] Lubich, C.; Ostermann, A., Linearly implicit time discretization of non-linear parabolic equations, IMA Journal of Numerical Analysis, 15, 4, 555-583, (1995) · Zbl 0834.65092 · doi:10.1093/imanum/15.4.555 [23] Kaps, P.; Rentrop, P., Generalized Runge-Kutta methods of order four with stepsize control for stiff ordinary differential equations, Numerische Mathematik, 33, 1, 55-68, (1979) · Zbl 0436.65047 · doi:10.1007/BF01396495 [24] Shampine, L. F., Implementation of rosenbrock methods, ACM Transactions on Mathematical Software, 8, 2, 93-113, (1982) · Zbl 0483.65041 · doi:10.1145/355993.355994 [25] van Veldhuizen, M., $$D$$-stability and kaps-rentrop-methods, Computing. Archives for Scientific Computing, 32, 3, 229-237, (1984) · Zbl 0528.65041 · doi:10.1007/BF02243574 [26] Bui, T. D., On an $$L$$-stable method for stiff differential equations, Information Processing Letters, 6, 5, 158-161, (1977) · Zbl 0412.65037
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. It attempts to reflect the references listed in the original paper as accurately as possible without claiming the completeness or perfect precision of the matching.


text:
# Arf-invariant

invariant of Arf

An invariant of a quadratic form modulo 2, given on an integral lattice endowed with a bilinear skew-symmetric form. Let $L$ be an integral lattice of dimension $k=2m$ and let $\psi$ be a form for which $\psi(x,y) = -\psi(y,x)$. There exists bases $(e_1,f_1,\ldots,e_m,f_m)$, called symplectic bases, in which the matrix of $\psi$ reduces to block-diagonal form: The diagonal contains the blocks $$\left({\begin{array}{cc} 0 & 1 \\ -1 & 0 \end{array}}\right)$$ i.e. $$\psi(e_i,f_i) = -\psi(f_i,e_i) = 1$$ while the other entries are zero.

Suppose that a mapping $$\psi_0 : L \rightarrow \mathbf{Z}/2\mathbf{Z}$$ is given on $L$ such that $$\psi_0(x+y) = \psi_0(x) + \psi_0(y) + \psi(x,y)\ \pmod2$$ (a "quadratic form modulo 2" ). The expression $$\sum_{i=1}^m \psi_0(e_i)\psi_0(f_i)$$ is then called an Arf-invariant [1]. If this expression equals zero, then there is a symplectic basis on all elements of which $\psi_0$ vanishes; if this expression equals one, then there is a symplectic basis on all elements of which, except $e_1$ and $f_1$, the form $\psi_0$ vanishes, while $$\psi_0(e_1) = \psi_0(f_1) = 1 \ .$$

#### References

 [1] C. Arf, "Untersuchungen über quadratischen Formen in Körpern der Charakteristik 2, I" J. Reine Angew. Math. , 183 (1941) pp. 148–167

See [a1], Appendix 1, for material concerning the Arf-invariant for inner product spaces over a field $F$ of characteristic 2 in relation to the Witt algebra of quadratic inner product spaces over $F$.


text:
# Defining long words succinctly in FO and MSO

We consider the length of the longest word definable in FO and MSO via a formula of size n. For both logics we obtain as an upper bound for this number an exponential tower of height linear in n. We prove this by counting types with respect to a fixed quantifier rank. As lower bounds we obtain for both FO and MSO an exponential tower of height in the order of a rational power of n. We show these lower bounds by giving concrete formulas defining word representations of levels of the cumulative hierarchy of sets. In addition, we consider the Löwenheim-Skolem and Hanf numbers of these logics on words and obtain similar bounds for these as well.

• 5 publications
• 4 publications
03/30/2019

### On the longest common subsequence of Thue-Morse words

The length a(n) of the longest common subsequence of the n'th Thue-Morse...
09/11/2018

### A Fixed-Depth Size-Hierarchy Theorem for AC^0[⊕] via the Coin Problem

We prove the first Fixed-depth Size-hierarchy Theorem for uniform AC^0[⊕...
12/17/2019

### New Bounds on Antipowers in Binary Words

Fici et al. defined a word to be a k-power if it is the concatenation of...
07/23/2019

### Upper Hessenberg and Toeplitz Bohemians

We look at Bohemians, specifically those with population {-1, 0, +1} and...
08/15/2019

### Homotopy height, grid-major height and graph-drawing height

It is well-known that both the pathwidth and the outer-planarity of a gr...
06/28/2022

### Asymptotic bounds for the number of closed and privileged words

A word w has a border u if u is a non-empty proper prefix and suffix of ...
11/05/2021

### Learning Formulas in Finite Variable Logics

We consider grammar-restricted exact learning of formulas and terms in f...


text:
## anonymous 4 years ago Solve each equation symbolically. With explanation please. sqrt (x)+1=sqrt (x+2)

1. anonymous

hint... $\LARGE \sqrt x+1=\sqrt{x+2}$ square both sides..

2. anonymous

Im not sure but I think I should foil left side of problem

3. anonymous

$(\sqrt{x}+1)(\sqrt{x}+1)-x+2$

4. anonymous

thats an = in front of x

5. anonymous

$\LARGE (\sqrt x+1)^2=(\sqrt{x+2})^2$ $\LARGE (\sqrt x)^2+2\cdot \sqrt{x}\cdot 1+1^2=x+2$ $\LARGE x+2\cdot \sqrt{x}=x+2-1$ $\LARGE 2\cdot \sqrt{x}=x-x +2-1$ $\LARGE 2\cdot \sqrt{x}=1$ $\LARGE \sqrt{x}=\frac12$ square both sides and there you go :)

6. anonymous

can you do it ?

7. anonymous

solution manuel says x = 1/4

8. anonymous

that's correct. Well done ! ;)

9. anonymous

Thank you once again :)

10. anonymous


text:
# GUPPIStreamReader¶

class baseband.guppi.base.GUPPIStreamReader(fh_raw, squeeze=True, subset=(), verify=True)[source] [edit on github]

GUPPI format reader.

Allows access to GUPPI files as a continuous series of samples.

Parameters
fh_rawfilehandle

Filehandle of the raw GUPPI stream.

squeezebool, optional

If True (default), remove any dimensions of length unity from decoded data.

subsetindexing object or tuple of objects, optional

Specific components of the complete sample to decode (after possibly squeezing). If a single indexing object is passed, it selects polarizations. With a tuple, the first selects polarizations and the second selects channels. If the tuple is empty (default), all components are read.

verifybool, optional

Whether to do basic checks of frame integrity when reading. The first frame of the stream is always checked, so verify is effective only when reading sequences of files. Default: True.

Attributes Summary

 bps Bits per elementary sample. complex_data Whether the data are complex. dtype fill_value Value to use for invalid or missing data. header0 First header of the file. info Standardized information on stream readers. ndim Number of dimensions of the (squeezed/subset) stream data. sample_rate Number of complete samples per second. sample_shape Shape of a complete sample (possibly subset or squeezed). samples_per_frame “Number of complete samples per frame, excluding overlap. shape Shape of the (squeezed/subset) stream data. size Total number of component samples in the (squeezed/subset) stream data. squeeze Whether data arrays have dimensions with length unity removed. start_time Start time of the file. stop_time Time at the end of the file, just after the last sample. subset Specific components of the complete sample to decode. time Time of the sample pointer’s current offset in file. verify Whether to do consistency checks on frames being read.

Methods Summary

 read([count, out]) Read a number of complete samples. Whether the file can be read and decoded. seek(offset[, whence]) Change the sample pointer position. tell([unit]) Current offset in the file.

Attributes Documentation

bps

Bits per elementary sample.

complex_data

Whether the data are complex.

dtype
fill_value

Value to use for invalid or missing data. Default: 0.

header0

First header of the file.

info

Standardized information on stream readers.

The info descriptor provides a few standard attributes, most of which can also be accessed directly on the stream filehandle, and tests basic readability of the stream. More detailed information on the underlying file is stored in its info, accessible via info.file_info (and shown by __repr__).

ndim

Number of dimensions of the (squeezed/subset) stream data.

sample_rate
sample_shape

Shape of a complete sample (possibly subset or squeezed).

samples_per_frame

“Number of complete samples per frame, excluding overlap.

shape

Shape of the (squeezed/subset) stream data.

size

Total number of component samples in the (squeezed/subset) stream data.

squeeze

Whether data arrays have dimensions with length unity removed.

If True, data read out has such dimensions removed, and data passed in for writing has them inserted.

start_time

Start time of the file.

See also time for the time of the sample pointer’s current offset, and (if available) stop_time for the time at the end of the file.

stop_time

Time at the end of the file, just after the last sample.

This includes any overlap in the last frame.

See also start_time for the start time of the file, and time for the time of the sample pointer’s current offset.

subset

Specific components of the complete sample to decode.

The order of dimensions is the same as for sample_shape. Set by the class initializer.

time

Time of the sample pointer’s current offset in file.

See also start_time for the start time, and (if available) stop_time for the end time, of the file.

verify

Whether to do consistency checks on frames being read.

Methods Documentation

close() [edit on github]
read(count=None, out=None) [edit on github]

Read a number of complete samples.

Parameters
countint or None, optional

Number of complete samples to read. If None (default) or negative, the number of samples left. Ignored if out is given.

outNone or array, optional

Array to store the samples in. If given, count will be inferred from the first dimension; the remaining dimensions should equal sample_shape.

Returns
outndarray of float or complex

The first dimension is sample-time, and the remaining ones are as given by sample_shape.

readable() [edit on github]

Whether the file can be read and decoded.

seek(offset, whence=0) [edit on github]

Change the sample pointer position.

This works like a normal filehandle seek, but the offset is in samples (or a relative or absolute time).

Parameters
offsetint, Quantity, or Time

Offset to move to. Can be an (integer) number of samples, an offset in time units, or an absolute time. For the latter two, the pointer will be moved to the nearest integer sample.

whence{0, 1, 2, ‘start’, ‘current’, or ‘end’}, optional

Like regular seek, the offset is taken to be from the start if whence=0 (default), from the current position if 1, and from the end if 2. One can alternativey use ‘start’, ‘current’, or ‘end’ for 0, 1, or 2, respectively. Ignored if offset is a time.

tell(unit=None) [edit on github]

Current offset in the file.

Parameters
unitUnit or str, optional

Time unit the offset should be returned in. By default, no unit is used, i.e., an integer enumerating samples is returned. For the special string ‘time’, the absolute time is calculated.

Returns
offsetint, Quantity, or Time

Offset in current file (or time at current position).


text:
How to work alignment(text alignment) in LaTeX?

LaTeX give you the ability to align your paragraph(text). LaTeX contains an algorithm in the TeX program which by default renders paragraphs to be justified. In other words, LaTeX stretches or shorten spaces between words to produce lines of text of equal lengths.

This article explains in detail how to change(modify) the alignments of portions of a text(paragraphs) or the entire body of text using LaTeX built-in commands and the ragged2e package.

Writing can be single-column and also can be multi-column. Those columns can be aligned in different ways. Such as left side, right side, along the middle and equally on both sides. The types are given below
Basic alignment: There Are two types of basic Alignment.

1. Single Column
2. Multi-Column

There is 4 type of each alignment basically exit.

1. Left
2. Right
3. Center
4. Fully Justified

Standard LATEX Environments and Commands

There are basically 3 environments that work by changing the declaration that control how TeX typesets your paragraphs. These declarations are also available as LaTeX commands.

Environment LaTeX command
center \centering
flushleft \raggedleft
flushright \raggedright
justify \justifying

The same environment and command for left, right, and center alignment is present in the ragged2e package. However, there is no default command or environment for justify. In this case, you have to use this package.

Single Column Alignment

1. Left Align

If you want to single column left align text or figure or equation then you must have to use flushleft environment. For left alignment text should be inserted into \begin{flushleft} & \end{flushleft}. When you are going to write then you must have to follow the format order. Given below is the complete formula with an example.

\documentclass{article}
\usepackage[document]{ragged2e}
\begin{document}
\begin{flushleft}
\section{What is Lorem Ipsum?}
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever     since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
\subsection{Why do we use it?}
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution.
\end{flushleft}
\end{document}

Output :

2. Right Align

Same as the procedure you can align the right side for a single column. The difference between left and right just changes it flushleft to the flashright. A complete format is given below for your proper instruction.

\documentclass{article}
\usepackage[document]{ragged2e}
\begin{document}
\begin{flushright}
\section{What is Lorem Ipsum?}
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever     since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
\subsection{Why do we use it?}
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution.
\end{flushright}
\end{document}

Output :

3. Center Align

If you want to align a paragraph to the center. Then you can also follow the usual rules of left alignment which are already discussed in the 1st rule. Just change the center instead of flushleft. Already given the decorated format for example. Look at the below:

\documentclass{article}
\usepackage[document]{ragged2e}
\begin{document}
\begin{center}
\section{What is Lorem Ipsum?}
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever     since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
\subsection{Why do we use it?}
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution. Proin et massa et nisl porttitor tempor. Vestibulum volutpat enim nec orci egestas, sed iaculis lorem dignissim. Mauris nec lorem varius, malesuada nulla sit amet, posuere leo. Integer id risus et ligula tempus sagittis eu sit amet leo. Vestibulum maximus turpis aliquam neque ultrices imperdiet.
\end{center}
\end{document}

Output :

4. Justify Align

The ragged2e also provide us with the justified environment and command(\justifying) which produces a justified text with a moderate amount of raggedness.

\documentclass{article}
\usepackage[document]{ragged2e}
\begin{document}
\begin{justify}
\section{What is Lorem Ipsum?}
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever     since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
\subsection{Why do we use it?}
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution. Proin et massa et nisl porttitor tempor. Vestibulum volutpat enim nec orci egestas, sed iaculis lorem dignissim. Mauris nec lorem varius, malesuada nulla sit amet, posuere leo. Integer id risus et ligula tempus sagittis eu sit amet leo. Vestibulum maximus turpis aliquam neque ultrices imperdiet.
\end{justify}
\end{document}

Output :

Multi-Column(two) Alignment

1. Left Align

As per our writing requirement, we can write text/equation/set image in double columns. If we want to write something in a double column then we need an extra packet of \usepackage{multicol} than a single column. In the wiring part, we have to set the paragraph between \begin{multicols}{2} & \end{multicols}{2}. Others part will as usual previous rules. For better understanding please look at the given format.

If you look at the code above, you will see that manual lorem text has been used. However, you can generate new ones instead of manually importing random text. There is a latex lipsum package for this.

\documentclass{article}
\usepackage{multicol,lipsum}
\begin{document}
\begin{flushleft}
\begin{multicols}{2}
\section{What is Lorem Ipsum?}
\lipsum[1][1-7]
\subsection{Why do we use it?}
\lipsum[2][1-4]
\end{multicols}{2}
\end{flushleft}
\end{document}

Output :

2. Right Align

As like a single column, we can align a double-column right alignment. Just follow the left alignment rules which are already used in the double-column alignment but with major changes in the flushleft to flushright. Already shown below furnished structure and example, please look at this for your practice.

\documentclass{article}
\usepackage{multicol,lipsum}
\begin{document}
\begin{flushright}
\begin{multicols}{2}
\section{What is Lorem Ipsum?}
\lipsum[1][1-7]
\subsection{Why do we use it?}
\lipsum[2][1-4]
\end{multicols}{2}
\end{flushright}
\end{document}

Output :

3. Center Align

Maximum times this structure is used for images or equation align. In the double-column center alignment used package is \usepackage{multicol} and variation from others alignment is \begin{center} & \end{center} instant of \begin{flushright} & \end{flushright}. Proper format and example already discussed below

\documentclass{article}
\usepackage{multicol,lipsum}
\begin{document}
\begin{center}
\begin{multicols}{2}
\section{What is Lorem Ipsum?}
\lipsum[1][1-7]
\subsection{Why do we use it?}
\lipsum[2][1-4]
\end{multicols}{2}
\end{center}
\end{document}

Output :

4. Fully justified Align

Single column fully justified alignment & double column fully justified alignment same procedure just added an extra package \usepackage{multicol} and used \begin{multicols}{2} & \end{multicols}{2} Front and back in the text. Please follow the format and example which will give you clear understanding of it.

\documentclass{article}
\usepackage[document]{ragged2e}
\usepackage{multicol,lipsum}
\begin{document}
\begin{justify}
\begin{multicols}{2}
\section{What is Lorem Ipsum?}
\lipsum[1][1-7]
\subsection{Why do we use it?}
\lipsum[2][1-4]
\end{multicols}{2}
\end{justify}
\end{document}

Output :

Environment has been used in the above case. You can do the same thing by putting commands before paragraphs instead of environment. But, you need a ragged2e package to justify it.

\documentclass{article}
\usepackage[document]{ragged2e}
\usepaxkage{xcolor}
\begin{document}
\RaggedRight {\color{red} \verb|\RaggedRight| }\\ It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages.\\

\Centering {\color{red}\verb|\Centering| }\\ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.\\

\RaggedLeft {\color{red}\verb|\RaggedLeft|} \\It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages.\\

\justifying {\color{red}\verb|\justifying| }\\ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
}
\end{document}

Output :

One request!

Don't forget to share if I have added any value to your education life. See you again in another tutorial. thank you!


text:
InTechOpen uses cookies to offer you the best online experience. By continuing to use our site, you agree to our Privacy Policy.

Engineering » Electrical and Electronic Engineering » "Development and Integration of Microgrids", book edited by Wen-Ping Cao and Jin Yang, ISBN 978-953-51-3400-8, Print ISBN 978-953-51-3399-5, Published: August 16, 2017 under CC BY 3.0 license. © The Author(s).

# FutureGrid: Use of Microgrids in Underserved Communities

By Andrew Hubble and Taha Selim Ustun
DOI: 10.5772/intechopen.68622

Article top

## Overview

Figure 1. Brazil’s, Sudan’s, and South Sudan’s existing electrical networks.

Figure 2. Selected countries.

Figure 3. Nyakabanda (left) and Rwamiko (right) load profiles.

Figure 4. HOMER microgrid diagram.

Figure 5. Breakeven distances for different load profiles.

Figure 6. A 40‐km wide corridor around existing transmission lines in Brazil (left) and Ghana (right).

Figure 7. Average and three standard deviations breakeven distance.

Figure 9. Torre de Lua community load profile.

Figure 10. Torre de Lua HOMER microgrid schematic.

Figure 11. Torre de Lua solar radiance.

Figure 12. Torre de Lua river flow rates.

Figure 13. Relationship between Nyakabanda community and closest grid access point.

Figure 14. Nyakabanda community HOMER microgrid setup.

Figure 15. Unused energy in storage‐less systems.

Figure 16. Rearrangement of loads to match SEMHC scheduling.

Figure 17. Probability of sufficient power for multiple clipping tiers.

Figure 18. Power consumed based on an amount of home clipped.

# FutureGrid: Use of Microgrids in Underserved Communities

Andrew Hubble and Taha Selim Ustun
Show details

## Abstract

Rural electrification in developing countries—especially Sub‐Saharan Africa—has trailed urban development drastically. The extreme costs associated with expanding traditional grid networks, and the relatively few people they serve, have proved to be a serious economic barrier. Being able to generate and distribute electricity at an affordable rate is crucial in order to effectively power homes, schools, health clinics, and private business. Through this continued cycle and lack of access to electricity, poverty only continues. If given access, quality of life increases through more educated, longer, and healthier lives as well as through developed entrepreneurship and business growth. Unfortunately, because of the remoteness of many communities they are often dismissed as unreachable. Furthermore, microgrids help address another global need: increased renewable energy penetration. Small‐scale energy production lends itself to solar installations, but depending on the location and available resources, wind and hydropower can also play an important role.

Keywords: microgrids, distributed generation, energy storage, grid extension, rural communities

## 1. Introduction

Often when we look at how technology has changed since its inception, it is difficult to imagine how the creators would react to the relentless progress and improvements on their original idea. Over a hundred years after Alexander Graham Bell invented the telephone, today’s smartphones are infinitely more complex, contain thousands of features, and possess processing power, Bell could never have imagined. Once luxury, cell phones are now found in every corner of the globe including the most remote villages in the developing world. If Thomas Edison and Nikola Tesla could see the state of electrification today, it is safe to assume they would be sorely disappointed. While electrification has certainly improved, it has severely lagged behind the growth of other technology. The generation and transmission of electricity looks much the same as it did over 130 years ago when the Vulcan Street Hydroelectric Plant in Appleton, Wisconsin began producing 12.5 kW of DC power. Over the next few years, more plants were constructed in both AC and DC, mostly powered by water or coal. While access to this electricity increased—as did the quality and economic viability—electricity never experienced the gigantic expansion in both availability and technology that other sectors did. Since its creation and original spurt of distribution, electricity has been slow to advance to a significant portion of the global population.

Unlike cell phones, electricity cannot be manufactured and shipped in discrete units. Because it is not a physical device, the infrastructure required to produce and distribute it is entirely unique. Due to the immense capital costs associated with electrification, individual business (and thus competition and natural advancement) have not developed in the same manner. As a result, electric utilities are slow to develop or expand, leaving no need for innovation.

Nowadays, power production finds its way into the public view as we battle the negative effects of climate change. Instead of the natural pressure in the industry to improve and out‐compete other companies, utilities are now being pressured externally via the government and general public. While a shift to renewable energy is undoubtedly important, it does not represent the only problem in this area. Access to any form of electricity in developing and rural areas is severely limited. At face value, it may seem that this is not an immediate problem, but there are innumerable secondary effects all stemming from a chronic lack of access.

Imagine a rural town in a developing country. There are 300 homes, a few grocery stores, a pharmacy, a general store, a school, a carpentry workshop, and a coffee milling station. What they do not have is electricity. While the government and utility are aware that the town exists, plans to offer electrification have never gone further than a Master Plan written years ago and shelved. Extending transmission lines are expensive, and if the utility thinks that there is not sufficient demand, they will not invest the money. The utility may also be unaware of the current size of the town, and thus the potential customers. Even if they did extend the grid, there are production shortages. Blackouts lasting hours or even days. This is not an unreasonable scenario, and is an accurate descriptor of a large portion of the unelectrified developing world. This lack of electricity means that at night families burn candles or kerosene lanterns which have harmful effects on the respiratory system when used in enclosed spaces; refrigeration is impossible, and food cannot be saved for long; water is pumped manually from boreholes, or carried from the nearest stream. All these activities which have to be done manually take an immense amount of time. Frequently, children are required to help their families in these tasks, and their studies suffer. By expending all this energy on the day‐to‐day tasks, it is difficult to develop and remove oneself from this cycle. Lacking access to electricity keeps people impoverished and uneducated.

## 2. Rural electrification and national grid distribution

Often microgrids are seen as solutions creating a more stable and reliable interconnected grid in urban settings [13], however, they need not be limited to these uses. Electrification in developing countries has trailed industrialized nations drastically and even more so in rural settings [4]. The vast majority of those without an electrical connection live in rural developing settings, where their access to resources in general is scarce. The eradication of poverty is on nearly every government agenda around the globe, and while on the surface, the undertaking is targeted and defined, in reality it is not. Access to reliable electricity is one large step in the correct direction and can no longer be considered a luxury. Lack of electrification contributes to the continued cycle of poverty, child mortality, chronic but otherwise treatable health issues, as well as suppressing education. Electricity is necessary for providing lighting without risking unnecessary smoke inhalation, for pumping water on anything other than an individual scale, and for refrigeration—which allows families to reduce food waste. Providing reliable and affordable electricity should be the top priority in tackling poverty eradication.

Unfortunately, the extreme costs associated with electrifying rural developing areas, as well as the relatively few people served, have caused come countries to exclude entire regions from their electrification schemes. With transmission lines costing up to $20,000 per km [5] in rough and rural terrain, shortening the transmission distances through the use of distributed generation and microgrids brings down the cost of rural electrification significantly. To understand the scope of the problem, transmission line coverage can best be depicted through utility maps. In Figure 1, large portions of Brazil, Sudan, and South Sudan are not currently serviced by existing transmission lines. In order to electrify these regions, millions of dollars would be required in infrastructure development. Fortunately, distributed generation microgrids can be utilized instead. #### Figure 1. Brazil’s, Sudan’s, and South Sudan’s existing electrical networks. Immediately, it becomes apparent that a more economical solution skips the long transmission lines and produces power closer to the users. The lower capital investment and varying sizes of communities present a wide array of customizable solutions, and as a result, there exists no uniform microgrid design which is applicable to all or even most potential microgrid sites. Despite this microgrids still hold a place in the global electrification scheme. This chapter aims to demonstrate that not only are microgrids closer to wide scale deployment in rural developing areas than may be commonly believed, but that there exist methods and technology making microgrids uniquely suitable for rural electrification. ## 3. Economic feasibility of microgrid breakeven distances Traditionally, there has been a singular approach to electrification: extend the national grid. When the utility considers this option for remote areas, little or no math goes into the determination. They are simply too far from the grid, and their demand is too low to justify the immense cost. With extension costs as high as$15,000 per km [6, 7] in rough terrain, the cost per kilowatt‐hour to achieve any kind of payback would have to be prohibitively expensive. As an alternative, residents of these rural areas can sometimes afford a few solar panels and batteries—especially if the cost is shared. This simple setup can sustain a little lighting and offer a place to charge cell phones, but stops well short of an acceptable solution. Instead, there exists a medium between these two solutions. Something, larger and more robust than a few panels linked together, but less expensive than grid extension: the microgrid. The microgrid can be sized and built according to demand and expanded with usage. The costs can be kept in check because the electricity is produced and consumed in the same area—no need for the expensive transmission lines. As a solution to rural electrification, the microgrid is new on the scene, and being largely untested requires some analysis to determine its feasibility.

The first step in determining if a microgrid is suited to a particular rural site is to compare the cost of the stand‐alone microgrid to the cost of extending the existing grid structure. The cost of a stand‐alone system is dependent on the load generated from the community, but is also dependent on the available resources. Wind and solar are obvious options because of their availability in remote areas, but diesel for generators should also be considered due to its widespread availability and capacity for consistent energy generation. These three options, plus battery storage, are at the heart of the microgrid solutions examined here. While options like geothermal and hydroelectric are completely viable, they have been intentionally omitted due to their geographical restrictions.

A study of 200 fictitious communities was performed in 50 unique locations with varying load profiles. For simplicity, and to ensure a variety of locations, one location was chosen over each of the 50 countries. The countries are shown in Figure 2. The countries were furthermore subdivided into five categories based on their economic standing. The countries presented in Table 1 rank the selected countries based on estimates of annual income generated by the poorest 10% of the population. This is calculated by taking the GDP produced by the poorest 10% [8] and dividing it by a tenth of the population.Class 1 countries generate less than $100 of income per year, whereas class 5 earns more than$10,000 per year. Figure 2 highlights the countries chosen.

#### Figure 2.

Selected countries.

CountryPoorest 10%ClassCountryPoorest 10%Class
Central African Republic43.02Class 1Brazil*1138.44Class 3
Haiti49.45Indonesia*1187.26
Malawi56.11Argentina*2001.52
The Gambia84.37Chile2469.82Class 4
Guinea‐Bissau90.85Gabon2477.57
Dem. Rep. Congo*92.89Russia2975.52
Lesotho*93.08Mauritius3004.99
Liberia109.89Class 2Uruguay*3193.29
Mozambique111.27Belarus3296.42
Burundi114.40Croatia3368.81
Togo120.66Greece3654.73
Comoros121.51Romania3698.77
Rwanda*146.09Seychelles3730.37
Fed. Sts. Micronesia152.85Singapore*12,945.45Class 5
Guinea161.88Germany16,259.45
Niger162.40Ireland16,856.05
Uganda171.50Denmark16,998.03
Afghanistan*240.76Class 3The Netherlands17,738.54
Nepal*245.59Sweden18,860.41
Ghana*273.91Iceland19,241.66
Tanzania*287.47Finland19,431.24
India*553.53Switzerland28,246.13
Paraguay*706.92Luxembourg31,499.45

#### Table 1.

Rural GDP distribution.

*Countries were part of a previous study and not selected based on the same criteria discussed in the text.

#### Figure 14.

Nyakabanda community HOMER microgrid setup.

Both the Rwandan and Brazilian case studies have shown that isolated microgrids are economically feasible. These are rough snapshots of what is required for electrification, but they highlight the major aspects. Thus far we have seen the viability of microgrids compared to grid extension, and the actual “per kWh” costs of implementing the microgrid. But these solutions represent an out‐of‐the‐box electrification scheme not tailored to rural life. Because the way electricity is consumed in the West and in rural developing locations differs drastically, new technology, process improvements, and innovative uses can drastically reduce wasted energy and thus further bring down the costs. The next section in this chapter delves into these changes and analyzes how much of an impact they can have on a microgrid.

## 6. Innovative enhancements for microgrid optimization

So far the microgrid has been treated as a response to a static load profile. Generally, this is acceptable because the electrical loads receive no feedback from the supply as to the amount of over/under production. If a new load is added to an already saturated system, voltage drops or blackouts may occur. Since these microgrids are designed and built from scratch, extra measures can be taken to reduce peak loads and distribute power consumption—easing the burden on the microgrid.

Batteries are often used in microgrids as a means of load shifting. When renewable energy generation is producing power in excess, the batteries can be charged and when the load outweighs the supply, the power stored in the batteries is used. Unfortunately, traditional batteries can be expensive and have limited cycle use before they need to be replaced. Alternative power storage methods are available—such as pumped hydro or flywheels—but a more grassroots solution reshapes the problem. Rather than store energy to match supply to meet demand change the nonessential demand to match supply.

### 6.1. Smart energy management for health Centers

Examples of how loads can be rearranged are readily available. One system, known as “smart energy management for health centers” (SEMHCs) clearly analyzes how this process works [32]. Rural health centers in particular are more prone to suffer from chronic power outages because of the nature of their loading. Clinics often have high‐power equipment that is only run for a short period of time. If many of these devices are powered simultaneously, it can overload the individual PV systems the run off. Since sufficient battery banks can be cost prohibitive at this scale, the clinics are at the mercy of whatever their arrays can produce. Alternatively, when the system is not being overloaded, energy that is not being used is lost. Instead, low‐tech scheduling systems can organize and shift loads to use the electricity more wisely.

Figure 15 illustrates this point further. The dotted line represents the power curve generated by a PV array throughout the course of a day, and the gray shaded blocks represent the loads. From t0 to t1 and between t4 and t5 the demand exceeds the generation, while the white space between them represents energy generated by the array that is lost.

### Figure 15.

Unused energy in storage‐less systems.

Scheduling patients’ services without the knowledge of power available ultimately hinder the services provided. Traditionally, clinics operate on a first‐come, first‐served basis, and if overloaded, the power will cut out with waiting patients. With the already low density of health centers in rural developing areas, patients sometimes have to travel large distances in order to arrive at the clinic. When the clinic then does not operate due to power issues, access to health services is essentially nonexistent.

SEMHC addresses this issue by scheduling services based on available energy and the priority of the service. The program starts by assessing the solar power production available, defined in Eq. (4) where s is the surface of the PV array, k is a constant for in‐line energy loss due to increased temperature, incident angle of radiation on the array, shading, and panel degradation, and R(t) is the average solar radiation on the PV panels over a specific period of time t. The values for R(t) can be pulled from satellite data from organizations such as NASA.

 E(Δt)=s·k·R(T)·Δt (4)

Next, the algorithm assigns a value Ci to the service required, where C represents the power rating and i is the device ranking or priority. The device is expected to operate for a closed time interval di. The process is optimized mathematically with Eq. (5).

 maxnϵℕ(∫tdtd+min(di)s·k·R(t)·Δt−∑i−1nCidi−A) (5)

The constant A represents the base load of the clinic—devices that are always on and consuming power. td represents the lowest time for which the generation power exceeds the nominal power of the devices. The final assurance is to guarantee that the demand does not exceed the power produced Pn by the panels, eliminating the possibility of overloading the system. Condition Eq. (6) then must be true at all times.

 ∑i=1nCidi≤Pn (6)

Since this is a priority‐driven system, any excess power not used by critical loads can be used low low‐priority low‐power demands. The system is shown in Figure 16 graphically. At the onset of the program, tmin, there are five loads already scheduled and running. Since the power available exceeds the demand, a new load NL3 is moved from standby to operating. NL3 is used because the higher priority loads would render condition (6) false.

### Figure 16.

Rearrangement of loads to match SEMHC scheduling.

After the completion of any load, the system reevaluates which waiting loads can be fit into the unused capacity. With this low‐cost, low‐tech solution to power management, unnecessary outages can be avoided and wasted energy can be minimized. This is only one specific case of a computer‐based microgrid improvement. With the advent of smart meters, control at a household level can be more than binary (on/off) as seen with the health clinic example. With built‐in wireless communication hardware, individual loads inside a household can be monitored and controlled.

### 6.2. The load attenuating stochastic simulator

The load attenuating stochastic simulator (LASS) utilizes the abilities of networked smart meters to control loads at a fine granularity, delivering or cutting power at the appliance level depending on the customer’s desires or requirements. This creates a tiered electrification scheme in which customers can pay a reduced rate under the condition that their power may be throttled first in the event, the demand exceeds generation [33]. While the results in this field suggest that the most economical solution is to provide sufficient capacity to meet all demand, once there is a limitation in supply, customers are best served by having their loads clipped versus having the entire system overload and experience blackouts. This works in much the same way as SEMHC, except it is applied over an entire microgrid, not an individual consumer.

To prove that load clipping increases overall electricity distribution, a simulation is used whereby LASS uses a Probability Mass Function (PMF) as an input over each time step for the possible loads and generation over a microgrid system for a traditional weekday and Saturday [33]. The simulator generates demand and loads for each time step based on a fictional microgrid setup. Inside this simulation, there exist two tiers of customers: customers whose power can be clipped and customers whose power cannot be clipped. The goal is to reduce the probability of power outages by determining what percentage of customers must be in the clipped category.

The base case (where no customers are clipped) and four other scenarios where 70, 75, 80, and 100% of homes can be clipped are examined. In the control case with no clipping, there are instances where power will have to be cut for multiple hours per day for both weekday and weekend profiles. The severity of this can be seen in Figure 17. The reverse is obviously true as well. If you cut power to 100% of homes, then the probability that there will be an outage is essentially nonexistent, since instead of overloading the microgrid, it has just been shut down completely.

### Figure 17.

Probability of sufficient power for multiple clipping tiers.

Whether or not power has been clipped, a power outage that has been avoided is only part of the problem. For any form of electricity distribution system to be viable, the maximum amount of electricity needs to be sold without shutting down the entire system. Protecting the grid by turning power off to everyone means that the utility (or distribution owner) loses income. Instead, there exists a balance between providing electricity to the maximum amount of people without increasing the risk of an outage. Figure 18 highlights the amount of power consumed (or sold) respective to each clipping scheme. No clipping is still the worst performing, since without clipping an outage is nearly guaranteed, and therefore no power is consumed by anyone. Again, the inverse is not ideal. If you cut power to everyone, then again, no power is sold or consumed. When 75% of customers’ power is clipped, the probability of an outage is less than 1%—nearly the same as any of the higher schemes. However, clipping only 75% of homes compared to 80% generates more revenue through more distributed power.

### Figure 18.

Power consumed based on an amount of home clipped.

The figures provide excellent visuals for hour‐by‐hour outage probability, but the root of the issue focuses on the total time, or overall percent chance of an outage. Table 9 shows the solutions for the weekday and weekend times.

Percentage of homes clippedExpected total power cut duration (hours/day)Expected energy sold (kWh/day)
Weekday0 (No Clipping)11.2303197.17
70%1.9474360.59
75%0.0137392.31
80%0.0005385.33
100%0.0005356.29
Saturday0 (No Clipping)9.4835240.20
70%0.0005396.87
75%0.0005392.89
80%0.0005388.92
100%0.0005373.13

### Table 9.

Optimum clipping rates.

Clipping to 75% on weekdays and 70% on Saturdays results in the highest amount of energy sold. While the power outages required for weekdays is higher than if more homes were clipped and the overzealous clipping actually leads to less power sold. This does not increase the robustness of the system, but instead takes an overly cautious approach and shuts down power unnecessarily.

Choosing the correct percentage of homes to clip is critical in the cost effectiveness and reliability of microgrids. While this study has provided an excellent starting point or generalization, each microgrid will have to be fine‐tuned to its particular power generation and loading curves. The goal of this section was to demonstrate that demand‐side changes can have a meaningful impact on both the reliability and affordability of microgrid setups.

The final section of this chapter explores a rural‐specific energy source not often considered in microgrids: agriculture. About 78% of the world’s poor lives in rural areas and relies on agriculture for both food security as well as household income [34]. Biomass is a large and often untapped rural resource that can provide a significant portion of on‐demand power.

Burning agricultural waste in small steam furnaces allows for localized generation utilizing an abundant and proximal resource. Generation units 10 and 50 kW are already in production for exactly this kind of use [35]. Village industrial power (VIP) operates in East Africa and offers an off‐the‐shelf 10 kW unit, which can be transported in the back of a small pickup truck. Agricultural waste is burned directly and the self‐contained unit can generate electricity. Used in tandem with solar or wind generation, a biomass unit can act in the same way that a diesel generator traditionally assists microgrids. Biomass can be stored and the unit brought online when demand is high.

The viability of biomass as a generation source primarily hinges on its availability, which is what makes this option suitable for rural and not urban use. Case studies have been carried out which are generally geographically limited. Specifically, the Punjab region of India was analyzed and it was determined to house vast untapped biomass resources. If the Punjab example is followed, the first step is determining what types of biomass are available. The six major biomass options from crops grown in the region are outlined in Table 10, and are categorized into four sections [36].

CategoryType of biomassName of crop
A1StrawWheat
Barley
Seasum
Pulses
A2StalkCotton
Maize
Arhar
Rapeseed and Mustard
A3Bagasse*Sugar Cane
Tops and LeavesSugar Cane
A4Cobs*Maize
Shells*Groundnuts

#### Table 10.

Identification of available biomass [36].

*Indicates processing residue.

The A1–A4 category ratings simply separate the styles of biomass, where A1 represents generic unused dry biomass and A2 represents woody biomass. It is important to note that the energy reserves of biomass do not come directly from the sum of biomass itself, rather, the actual unused biomass represented here accounts for the subtraction of biomass used for domestic purposes, animal fodder, heating, etc. These values here represent biomass burned by farmers in the field. This biomass is truly unused and serves no other purposes.

The amount of energy available comes from the product of the present supply and the lower heating value (LHV). This is taken through the amount of cultivated land with each of the above‐described crops, as well as the reduction due to moisture. The final available amounts are shown in Table 11.

CategoryType of biomassName of cropCultivated area (km2)Moisture content (%)Total biomass (dry basis) (kt)Used (%)Unused biomass (dry basis) (kt)
A1StrawWheat34,7659.214,317.30802863.45
Barley7045.282036.22
Seasum20619.352015.48
Pulses27431.92806.88
Total23,187.9910,339.73
A2StalkCotton604312707.4731.3486.03
Maize164911.5800.4424.2598.70
Arhar9139.007011.70
Rapeseed and Mustard498142.497042.75
Total1689.431139.18
A3Bagasse*Sugar Cane1441151154.1440‐50577.07
Tops and LeavesSugar Cane59.2940.9960376.40
Total2095.13953.47
A4Cobs*Maize16498.6207.7824.2154.70
Shells*Groundnuts379.870.92360.49
Total2625.881307.95

#### Table 11.

Available energy stores derived from unused biomass [36].

*Indicates processing residue.

With tens of millions of tonnes of unused biomass going to waste, the potential for on‐demand electricity generation is immense. In total, there exists over 200 TJ of unused energy from all the biomass over the entire Punjab region. Obviously, this is only one specific instance, and many other areas may come in well below this, but even at a fraction of the potential, the remaining energy is immense. From this point, the major hurdles become collection and storage. Fortunately, at the microgrid scale, the volumes required are not overwhelming.

The capital costs and operation can be handled in a similar way to renewables or diesel generation, but with a few caveats. Whereas diesel would be purchased, stored, and used by the microgrid operator, the biomass is locally sourced. Two prominent incentives exist for engaging the community and collecting the biomass required to operate the generation unit. Either cash can be directly paid out per kilogram of biomass collected by farmers, or discounts/vouchers for electricity can be distributed.

## 8. Conclusions

It is often said that no single renewable energy source will be able to entirely replace our dependence on fossil fuels, but instead it will take a combination of solar, wind, hydro, biomass, and others to wean our dependence on pollution‐heavy and unsustainable fuels. The idea of a multipart solution is not a new one, and it is certainly not limited to power production. Much in the same way that our energy needs must come from multiple sources, there are multiple levers to pull in order to reduce the cost of rural electrification and bring it within the reach of developing countries.

Just like solar, wind, hydro, and biomass come together to offer a solution to our power production needs, microgrids equally rely not only on multiple generation sources, but also on multiple consumption strategies to increase viability. The microgrid by itself is expensive and clunky and does not utilize new technological developments or advancements to improve on itself. At its core, it is a scaled‐down technology that has not changed in over 100 years.

However, when combined with the techniques and technologies discussed in this chapter, the microgrid takes on a new form. It is no longer wasteful—carrying extra capacity which cannot be used—or allowing itself to be stretched and overloaded leading to total failure. This smart microgrid recognizes its own capacity, stores as much excess energy as possible, and recommends the shifting or clipping of noncritical loads for the benefit of the entire community. Tightening down and preventing electrical waste directly translates to a less expensive, more efficient distribution of energy. Cheaper electricity opens the door to rural electrification where it was once too costly to distribute power, and direct access to inexpensive power provides a boost in quality of life unimaginable to those who have been fortunate enough to have access to a near unlimited supply of inexpensive power.

## References

1 - Kanchev H, Colas F, Lazarov V, Francois B. Emission reduction and economical optimization of an urban microgrid operation including dispatched PV‐based active generators. IEEE Transactions on Sustainable Energy. 2014;5:1397‐1405. DOI: 10.1109/TSTE.2014.2331712
2 - Schmitt L, Kumar J, Sun D, Kayal S, Venkata S. Ecocity upon a hill: Microgrids and the future of the European City. IEEE Power and Energy Magazine. 2013;11:59‐70. DOI: 10.1109/MPE.2013.2258286
3 - Manfren M, Caputo P, Costa G. Paradigm shift in urban energy systems through distributed generation: Methods and models. Applied Energy. 2011;88:1032‐1048. DOI: 10.1016/j.apenergy.2010.10.018
4 - World Energy Outlook Electricity Access Database. World Energy Outlook [Internet]. 2015. Available from: http://www.worldenergyoutlook.org/resources/energydevelopment/energyaccessdatabase [Accessed: October 16, 2016]
5 - Hubble AH, Ustun TS. Scaling renewable energy based microgrids in underserved communities: Latin America, South Asia, and Sub‐Saharan Africa. In: IEEE PES Power Africa Conference; 28 June‐03 July 2016. Livingstone: IEEE; 2016. pp. 134‐138
6 - CORE International Inc. Zambia Rural Electrification Master Plan. Phase 1: Rapid Resource Assessment. Final Report. Technical Report, Core International, 2005
7 - Holland CW, Derbyshire W. Electrifying 20 million households an Indonesian rural electrification strategy. In: EEA Conference and Exhibition; 19‐20 June 2009. Christchurch: EEA; 2009. pp. 19‐20
8 - Income Share Held by Lowest 10%. World Bank [Internet]. 2014. Available from: http://http//data.worldbank.org/indicator/SI.DST.FRST.10 [Accessed: October 01, 2016]
9 - Cruz M, Foster J, Quillin B, Schellekens P. Ending Extreme Poverty and Sharing Prosperity: Progress and Policies. World Bank Group: Policy Research Note [Internet]. 2015. Available from: http://documents.worldbank.org/curated/en/801561468198533428/pdf/101740‐NWP‐PRN03‐Oct2015‐TwinGoals‐Box393265B‐PUBLIC.pdf [Accessed: November 13, 2016]
10 - Murenzi J, Ustun TS. The case for microgrids in electrifying sub‐Saharan Africa. In: IEEE Renewable Energy Congress (IREC); 24‐26 March 2015. Tunisia: IEEE; 2015. pp. 1‐6
11 - Buchana P, Ustun TS. The role of microgrids & renewable energy in addressing sub‐Saharan Africa’s current and future energy needs. In: IEEE Renewable Energy Congress (IREC); 24‐26 March 2015. Tunisia: IEEE; 2015. pp. 1‐6
12 - Solar and Wind Energy Resource Assessment. UNEP [Internet]. 2015. Available from: http://en.openei.org/apps/SWERA/ [Accessed: November 03, 2016]
13 - Pump Price for Diesel Fuel (USD per Litre). World Bank [Internet]. 2015. Available from: http://data.worldbank.org/indicator/EP.PMP.DESL.CD [Accessed: September 20, 2016]
14 - Kagimu V, Ustun TS. Novel business models and policy directions based on SE4ALL global framework for minigrids. In: IEEE International Conference on Technological Innovations in ICT for Agriculture and Rural Development (TIAR); 10‐12 July 2016. Chennai: IEEE; 2016. pp. 1‐6
15 - Bhatia M, Angelou N. Beyond Connections Energy Access Redefined. Energy Sector Management Assistance Program. World Bank; 2015
16 - Modi V, McDade S, Lallement D, Saghir J, editors. Energy Services for the Millennium Development Goals. Washington, DC: World Bank; 2005. p. 116
17 - Barnes DF, Khandker SR, Samad HA. Energy poverty in rural Bangladesh. Energy Policy. 2011;39:894‐904. DOI: 10.1016/j.enpol.2010.11.014
18 - Nussbaumer P, Nerini FF, Onyeji I, Howells M. Global insights based on the multidimensinal energy poverty index (MEPI). Sustainability. 2013;5:2060‐2076. DOI: 10.3390/su5052060
19 - Energy for Community Services. Poor People’s Energy Outlook. Warwickshire: Practical Action Publishing; 2013. p. 71. ISBN: 978 1 85339 789 9
20 - Tenenbaum B, Greacen C, Siyambalapitiya T, Knuckles J. From the Bottom Up: How Small Producers and Minigrids can Deliver Electrification and Renewable Energy in Africa. World Bank [Internet]. 2104. Available from: http://www.esmap.org/sites/esmap.org/files/ESMAP_From%20the%20Bottom%20Up_Optimizedpdf.pdf [Accessed: October 16, 2016]
21 - Franz M, Peterschmidt N, Rohrer M, Kondev B. Mini‐grid Policy Toolkit. Africa‐EU Renewable Energy Cooperation Programme [Internet]. 2014. Available from: http://www.ren21.net/Portals/0/documents/Resources/MGT/MinigridPolicyToolkit_Sep2014_EN.pdf [Accessed: September 30, 2016]
22 - Groh S, Taylor H. The role of microfinance in energy access: Changing roles, changing paradigms, and future potential. Enterprise Development and Microfinance. 2015;26:307‐324. DOI: 10.3362/1755‐1986.2015.026
23 - Ustun TS. The Importance of Microgrids & Renewable Energy in Meeting Energy Needs of the Brazilian Amazon. Unpublished Manuscript. 2015
24 - G. Roberta, T. Esteves. Energy supply on Amazon Remote Communities in Brazil: A case study for the Communities of Terra Nova, Mourao and Sao Sebastiao Methods, Calculatio Formulae. In: International Conference on Microperspectives for Decentralized Energy Supply; 28 February‐01 March 2013. Berlin. 2013. pp. 100‐103
25 - SIN Maps. Operador Nacional do Sistema Eletrico [Internet]. 2011. Available from: http://www.ons.org.br/conheca{\_}sistema/mapas{\_}sin.aspx [Accessed: November 17, 2016]


text:
# Tim Sullivan

### Preprint: Weak and strong modes

Han Cheng Lie and I have just uploaded a revised preprint of our paper, “Equivalence of weak and strong modes of measures on topological vector spaces”, to the arXiv. This addresses a natural question in the theory of modes (or maximum a posteriori estimators, in the case of posterior measure for a Bayesian inverse problem) in an infinite-dimensional space $$X$$. Such modes can be defined either strongly (a la Dashti et al. (2013), via a global maximisation) or weakly (a la Helin & Burger (2015), via a dense subspace $$E \subset X$$). The question is, when are strong and weak modes equivalent? The answer turns out to be rather subtle: under reasonable uniformity conditions, the two kinds of modes are indeed equivalent, but finite-dimensional counterexamples exist when the uniformity conditions fail.

Abstract. A strong mode of a probability measure on a normed space $$X$$ can be defined as a point $$u \in X$$ such that the mass of the ball centred at $$u$$ uniformly dominates the mass of all other balls in the small-radius limit. Helin and Burger weakened this definition by considering only pairwise comparisons with balls whose centres differ by vectors in a dense, proper linear subspace $$E$$ of $$X$$, and posed the question of when these two types of modes coincide. We show that, in a more general setting of metrisable vector spaces equipped with non-atomic measures that are finite on bounded sets, the density of $$E$$ and a uniformity condition suffice for the equivalence of these two types of modes. We accomplish this by introducing a new, intermediate type of mode. We also show that these modes can be inequivalent if the uniformity condition fails. Our results shed light on the relationships between among various notions of maximum a posteriori estimator in non-parametric Bayesian inference.

Published on Monday 9 July 2018 at 08:00 UTC #publication #preprint #inverse-problems #modes #map-estimator

### Dilations of Cauchy measures in Electron. Commun. Prob.

“Quasi-invariance of countable products of Cauchy measures under non-unitary dilations”, by Han Cheng Lie and myself, has just appeared online in Electronic Communications in Probability. This main result of this article can be understood as an analogue of the celebrated Cameron–Martin theorem, which characterises the directions in which an infinite-dimensional Gaussian measure can be translated while preserving equivalence of the original and translated measure; our result is a similar characterisation of equivalence of measures, but for infinite-dimensional Cauchy measures under dilations instead of translations.

H. C. Lie & T. J. Sullivan. “Quasi-invariance of countable products of Cauchy measures under non-unitary dilations.” Electronic Communications in Probability 23(8):1–6, 2018. doi:10.1214/18-ECP113

Abstract. Consider an infinite sequence $$(U_{n})_{n \in \mathbb{N}}$$ of independent Cauchy random variables, defined by a sequence $$(\delta_{n})_{n \in \mathbb{N}}$$ of location parameters and a sequence $$(\gamma_{n})_{n \in \mathbb{N}}$$ of scale parameters. Let $$(W_{n})_{n \in \mathbb{N}}$$ be another infinite sequence of independent Cauchy random variables defined by the same sequence of location parameters and the sequence $$(\sigma_{n} \gamma_{n})_{n \in \mathbb{N}}$$ of scale parameters, with $$\sigma_{n} \neq 0$$ for all $$n \in \mathbb{N}$$. Using a result of Kakutani on equivalence of countably infinite product measures, we show that the laws of $$(U_{n})_{n \in \mathbb{N}}$$ and $$(W_{n})_{n \in \mathbb{N}}$$ are equivalent if and only if the sequence $$(| \sigma_{n}| - 1 )_{n \in \mathbb{N}}$$ is square-summable.

Published on Wednesday 21 February 2018 at 09:30 UTC #publication #electron-commun-prob #cauchy-distribution

### Preprint: Random Bayesian inverse problems

Han Cheng Lie, Aretha Teckentrup, and I have just uploaded a preprint of our latest article, “Random forward models and log-likelihoods in Bayesian inverse problems”, to the arXiv. This paper considers the effect of approximating the likelihood in a Bayesian inverse problem by a random surrogate, as frequently happens in applications, with the aim of showing that the perturbed posterior distribution is close to the exact one in a suitable sense. This article considers general randomisation models, and thereby expands upon the previous investigations of Stuart and Teckentrup (2017) in the Gaussian setting.

Abstract. We consider the use of randomised forward models and log-likelihoods within the Bayesian approach to inverse problems. Such random approximations to the exact forward model or log-likelihood arise naturally when a computationally expensive model is approximated using a cheaper stochastic surrogate, as in Gaussian process emulation (kriging), or in the field of probabilistic numerical methods. We show that the Hellinger distance between the exact and approximate Bayesian posteriors is bounded by moments of the difference between the true and approximate log-likelihoods. Example applications of these stability results are given for randomised misfit models in large data applications and the probabilistic solution of ordinary differential equations.

Published on Tuesday 19 December 2017 at 08:30 UTC #publication #preprint #inverse-problems

### Preprint: Active subspace Metropolis-Hastings

Ingmar Schuster, Paul Constantine and I have just uploaded a preprint of our latest article, “Exact active subspace Metropolis–Hastings, with applications to the Lorenz-96 system”, to the arXiv. This paper reports on our first investigations into the acceleration of Markov chain Monte Carlo methods using active subspaces as compared to other adaptivity techniques, and is supported by the DFG through SFB 1114 Scaling Cascades in Complex Systems.

Abstract. We consider the application of active subspaces to inform a Metropolis–Hastings algorithm, thereby aggressively reducing the computational dimension of the sampling problem. We show that the original formulation, as proposed by Constantine, Kent, and Bui-Thanh (SIAM J. Sci. Comput., 38(5):A2779–A2805, 2016), possesses asymptotic bias. Using pseudo-marginal arguments, we develop an asymptotically unbiased variant. Our algorithm is applied to a synthetic multimodal target distribution as well as a Bayesian formulation of a parameter inference problem for a Lorenz-96 system.

Published on Friday 8 December 2017 at 08:00 UTC #publication #preprint #mcmc #sfb1114

### Heavy-tailed stable priors in Inverse Problems and Imaging

The final version of “Well-posed Bayesian inverse problems and heavy-tailed stable quasi-Banach space priors” has now been published online in Inverse Problems and Imaging; the print version will be available in October.

Published on Wednesday 19 July 2017 at 15:30 UTC #publication #inverse-problems #cauchy-distribution