text:
# Does every positive-definite integral lattice admit an angle-preserving homomorphism into $\Bbb Z^n$ for some $n$?

Some initial clarifications

By lattice I mean an additive subgroup of $$\mathbb R^n$$ which is isomorphic to $$\mathbb Z^n$$ and has full rank (i.e. spans $$\Bbb R^n$$ when considered as set of vectors). A lattice $$\mathcal L$$ is integral if $$\langle v,w\rangle\in\mathbb Z$$ for all $$v,w\in\mathcal L$$, where $$\langle\cdot,\cdot\rangle$$ denotes the standard inner product.

Above terms are standard, but some of the terms I will use in the following, like "sublattice" and "lattice isomorphism", are probably not standard. Feel free to correct my terminology, as I simply do not know enough of that subject.

The actual question

I wonder whether every integral lattice $$\mathcal L$$ is isomorphic to a sublattice of $$\mathbb Z^n$$ in the following sense:

Consider some vectors $$v_1,..., v_k\in\mathbb Z^n$$. Then $$\mathcal L(v_1,...,v_k):=\mathrm{span}\{v_1,...,v_k\}\cap \mathbb Z^n$$ is an integral lattice in $$\mathrm{span}\{v_1,...,v_k\}\subseteq\mathbb R^n$$ (with the inner product inherited from $$\mathbb Z^n$$), and will be called a sublattice of $$\mathbb Z^n$$.

I care about whether I can find $$\mathcal L$$ in $$\Bbb Z^n$$ with the right angles, not necessarily the right scale. So I need the following kind of "isomorphism": two lattices $$\mathcal L_1$$ and $$\mathcal L_2$$ are isomorphic, if there is a group isomorphism $$\phi:\mathcal L_1\to\mathcal L_2$$ and a constant $$\alpha\in\mathbb R$$ with

$$\langle \phi(v),\phi(w)\rangle=\alpha \langle v,w\rangle,\quad\text{for all v,w\in\mathcal L_1}.$$

• "Is a lattice" makes no sense, you should specify: a lattice in some subspace? in some given subspace? Do you consider $\mathbf{Z}\times\{0\}$ as sublattice of $\mathbf{Z}^2$? – YCor Aug 5 '19 at 13:17
• @Qfwfq Do my edits address your questions? What I mean by isomorphic is explained immediately after I use the term "isomorphic": $\mathcal L_1$ and $\mathcal L_2$ are isomorphic if they are isomorphic as groups (via some group isomorphism $\phi:\mathcal L_1\to\mathcal L_2$), and there exists a constant $\alpha\in\Bbb R$, so that $$\langle \phi(v),\phi(w)\rangle=\alpha \langle v,w\rangle,\quad\text{for all v,w\in\mathcal L_1}.$$ – M. Winter Aug 5 '19 at 14:09
• @YCor My edit should address your question. Also, $\Bbb Z\times \{0\}$ does not fit my definition of a sublattice of $\Bbb Z^2$. – M. Winter Aug 5 '19 at 14:15
• By the way, googling a bit I found a criterion for embeddability in the standard lattice of the same rank with your $\alpha=1$ (arxiv.org/pdf/1807.05098.pdf) and something related with embeddability in higher rank standard lattice but -if I have understood well the abstract- with your constant $\alpha$ fixed (jstor.org/stable/2398341?seq=1#page_scan_tab_contents). – Qfwfq Aug 5 '19 at 15:17
• I suspect that what caused most of the confusion was omitting the word "Euclidean", as in "integral Euclidean lattice". This has been ameliorated somewhat by adding routine definitions, at the expense of readability. However, the notions of isomorphism and sublattice in the current version of the question are non-standard: it is more common to define isomorphism to be an isometry, so that, in particular, a bijective isomorphism satisfies the definition of an embedding and the image of an isomorphism ${\mathcal L}\to {\Bbb Z}^n$ is a sublattice according to the chosen definitions. – Victor Protsak Aug 5 '19 at 21:41

Yes, this is true. There's some fancy number theory that one can apply (the Hasse-Minkowski invariant and embedding of quadratic forms), but one can see this directly without number-theoretic machinery.

First, notice that one can choose a basis for the lattice which is orthogonal. Just start with any basis and apply Gram-Schmidt orthogonalization. The new orthogonal basis for the lattice may no longer be integral, but we may multiply the inner product by an integer to clear denominators make it integral (and so that the original lattice is a sublattice up to scaling).

Now one is left with the problem of embedding the 1-dimensional quadratic form/lattice $$\mathcal{L}_m$$ given by $$\mathbb{Z}v_1, \langle v_1,v_1\rangle = m$$ into an integral lattice. This may be done using Lagrange's 4-square theorem. Let $$m=w^2+x^2+y^2+z^2$$. Then we may embed $$\mathcal{L}_m$$ into the lattice $$\mathbb{Z}^4$$ via $$v_1 \mapsto (w,x,y,z).$$ Do this for each basis vector individually, and take the orthogonal direct sum of these $$n$$ 4-dimensional lattices (so this embeds into the lattice $$\mathbb{Z}^{4n}$$ up to scaling, which is likely far from optimal in general).

Addendum: The answer above shows how to embed as a sublattice up to scaling, whereas the question asks for a saturated sublattice (intersection of $$\mathbb{Z}^n$$ with a subspace). I don't know how to obtain this in general, but in dimensions $$1$$ and $$2$$ one can make a construction by hand without scaling.

In dimension $$1$$, send the basis vector $$v_1$$ in the lattice $$\mathcal{L}_m$$ with $$\langle v_1, v_1 \rangle = m$$ to the vector $$(1,\ldots,1)\in\mathbb{Z}^m$$. This vector is primitive, and hence the image is a saturated sublattice.

In dimension $$2$$, one may do a variation on this embedding. Suppose that one has a 2-dimensional lattice with $$\langle v_1,v_1\rangle =a >0, \langle v_1,v_2\rangle =b\geq 0, \langle v_2,v_2\rangle = d >0$$, with $$ad-b^2>0$$. By reduction theory, we may in fact assume that $$a \leq d$$ and $$ad \geq 2b^2$$ (by taking $$v_1$$ to have minimal norm, and the acute angle between $$v_1$$ and $$v_2$$ to be $$\geq \pi/3$$).

Let $$b=(a-1)q+r$$, $$0\leq r < a-1$$. Then send $$v_1\mapsto (1,\ldots,1,0,\dots,0)$$ and $$v_2\mapsto (q,\ldots, q, r, 1, \ldots, 1) \in \mathbb{Z}^n$$, where $$n=a+d- (a-1)q^2 -r^2$$ (so the second vector has $$(a-1)$$ $$q$$s) . For this to work, one has to check that $$d > (a-1)q^2+r^2$$ which can be deduced from the inequalities $$ad \geq 2b^2$$ and $$d\geq a$$. Moreover, one may see that this is a saturated sublattice of $$\mathbb{Z}^n$$: if any of the last $$d-(a-1)q^2-r^2$$ coordinates is non-zero, then we may subtract off the corresponding multiple of $$v_2$$ to make these coordinates $$=0$$. What's left must be a multiple of $$v_1$$.

• Am I correct that this embedding gives a sublattice of $\Bbb Z^n$ which is not necessarily saturated? That would be okay, as I explained in a comment to my question, but I should (and want to) edit the question to make this more clear. – M. Winter Aug 6 '19 at 6:46
• @M.Winter: right, I don't think these lattices will be saturated. I guess I misunderstood your definition of sublattice (as you say, your terminology is nonstandard). – Ian Agol Aug 6 '19 at 7:12


text:
# zbMATH — the first resource for mathematics

Choosing a spanning tree for the integer lattice uniformly. (English) Zbl 0758.60010
Consider the nearest neighbour graph for the integer lattice $$\mathbb{Z}^ d$$ in $$d$$ dimensions. For a large finite piece of it, consider choosing a spanning tree for that piece uniformly amongst all possible such subgraphs. It is shown that as the piece gets larger, this approaches a limiting measure on the spanning subgraphs of $$\mathbb{Z}^ d$$, that this measure concentrates on spanning forests, which are trees if and only if $$d\leq 4$$. In this case, the tree has only one topological end, that is, there are no doubly infinite paths. When $$d\geq 5$$ the spanning forest has infinitely many components almost surely, with each component having one or two topological ends. Extensive use is made of the connections between uniform spanning trees, random walks and electrical networks, and also with loop-erased random walks.

##### MSC:
 60C05 Combinatorial probability 60K35 Interacting random processes; statistical mechanics type models; percolation theory
Full Text:

format: plain


text:
# How to find the axis of rotation or location given the angular velocity?

Say I have the angular velocity vector of a body as a function of time. How can I determine the axis of rotation/location of the body?

we have the equation:

$\frac{d\vec{r}}{dt}=\vec{\omega}(t)\times \vec{r}$

can we have somthing like:

$\frac{d\vec{\omega}}{dt}=\vec{r'}(t)\times \vec{\omega}$

where $\vec{r'}$ points towards $\vec{r}$ or equals to it?

EDIT: I now ask about axis of rotatiob ot about the location of the body. If im not mistaken there are sitations where the angular velocity does not point in the direction of the axis of rotation.

• The angular velocity vector itself points along the axis of rotation... – lemon Jun 19 '16 at 7:41
• @lemon i've edited my question – proton Jun 19 '16 at 7:58
• To your last sentence: that's only if the centre of mass of the rotating object is not at the origin of your coordinate system. – lemon Jun 19 '16 at 8:03
• @proton your forumla is wrong. – Yashas Jun 19 '16 at 8:32

$$\frac{d\vec{r}}{dt} = \vec{v} = \omega \times \vec{r}$$

Angular Velocity ($\omega$) is an axial vector whereas velocity is a polar vector.

Axial vectors are vectors whose directions oriented in a non-intuitive way. For example, when you rotate a disc by a certain angle ($d\phi$), the $d\phi$ vector lies along the axis of rotation.

A polar vector is a vector whose direction makes sense to a layman. For example, the direction of the velocity vector is in the direction of motion of the body.

Lets begin with rotation in a plane. You have the intuition for polar vectors, so if you know the direction of the velocity vector and the radius vector, you can use the right-hand rule to find the direction of the angular velocity vector.

$$\vec{v} = \omega \times \vec{r}$$

If you do it correctly, you will find the angular velocity vector to be oriented along the axis of rotation.

For cases where you have the rotation in more than one dimension. You can split the angular velocity vector into two mutually perpendicular components. These components are not along the axis of rotation.

• first, i thank you for the answer. second, given $\vec{r}$ and its derivative i can find $\vec{\omega}$. is there a way to find $\vec{r}$ givven $\vec{\omega}$? – proton Jun 19 '16 at 8:39
• For uniform circular motion, you will have to integrate $\vec{\omega}$ to obtain $\theta$ as a function of time using which you can obtain the position vector. In non-uniform cases, you will almost never come across such situations. – Yashas Jun 19 '16 at 8:44

You need two things. The angular velocity vector $$\vec{\omega}$$ at some time frame, and the linear velocity vector at some reference point $$\vec{v}$$.

The axis of rotation is located at a point relative to the reference point

$$\vec{r} = \frac{\vec{\omega} \times \vec{v}}{ \| \vec{\omega} \|^2} \tag{1}$$

You can apply this at every instance.

See related post1 post2 and post3.

The proof is easy but it requires the use of the vector triple product identity $$a \times (b \times c) = b (ac) - c (ab)$$. Substitude above $$\vec{v} = \vec{r} \times \vec{\omega}$$ and carry out simplifications.

Simple example

The center of mass of an object is moving with $$\vec{v} = \pmatrix{5 & -1 &0}$$ and the rotational vector is $$\vec{\omega} = \pmatrix{0 & 0 & 2}$$ at some instant.

The point on the axis of rotation closest to the center of mass is located at $$\vec{r} = \frac{\pmatrix{0&0&2} \times \pmatrix{5&-1&0}}{ \| \pmatrix{0&0&2} \|^2 } = \frac{ \pmatrix{2 & 10 & 1} }{2^2} = \pmatrix{0.5 & 2.5 & 5}$$

To verify find the velocity at the center of mass with

$$\vec{v} = \vec{\omega} \times (-\vec{r} ) = \vec{r} \times \vec{\omega} = \pmatrix{0.5 & 2.5 & 0} \times \pmatrix{0&0&2} = \pmatrix{5&-1&0} \;\checkmark$$

NOTE: That the axis of rotation is any point along the line, which includes $$\vec{r}$$ and all points parallel to $$\vec{\omega}$$.

• I added an example to show that my answer gives the correct answer. – ja72 Aug 10 at 16:45


text:
# Difference between revisions of "User talk:Nathaniel"

Jump to: navigation, search

## Math formulae

So, it was my impression that something like

$\sqrt{1-e^2}$

should look like a math formula and those tags should do stuff. But that appears to not be the case. How come? Elithrion 03:40, 6 February 2009 (UTC)

Stuff like that works on Wikipedia because of an extension they manually coded in. I'll see if I can find a way to install it, but it doesn't come with MediaWiki by default. Nathaniel 03:45, 6 February 2009 (UTC)
Upon looking into this deeper, it doesn't look like it's going to be possible on the current server setup, since we're on a shared Windows host. If the wiki becomes more popular then it may become worth it to move to a Linux and/or dedicated host, but until then this won't happen. Nathaniel 19:13, 1 March 2009 (UTC)

Thanks for correcting mistakes I made when editing the spaceship page (I'm a bit new to this whole wiki business). I was wondering If there were a page on conventions and standards used in this wiki.

Sokwe 17:54, 18 April 2009 (UTC)

You may want to be alerted to the spam added to talk:Main Page by 211.240.14.91

Sokwe 23:17, 21 April 2009 (UTC)

Yep, it happens frequently enough, sadly. Thanks for deleting it -- I've banned that IP address. Nathaniel 23:22, 21 April 2009 (UTC)

## Error in wickstretcher template

The wickstretcher template puts anything you write inside the infobox. This is because the table in the template has no concluding "|}". Please add a line containing "|}" directly above the <noinclude> tag.

~Sokwe 00:33, 25 April 2009 (UTC)

Whoops. Thanks for letting me know, it's fixed now. Nathaniel 03:02, 25 April 2009 (UTC)

## Problems with forms

I somehow seem to have caused some problems with forms such as the oscillator search form. I was testing their functionality for other purposes, and somehow caused an error: %DPL-1.7.4-WARNING: Wrong '$0' parameter: 'uses'! Using default: 'Template:{#request:cat}'. Help:$0=

Note: "Template{#request:cat}" was part of the stuff I was doing. I never saved any pages, I was just viewing previews for testing.

Sorry about the mess!

~Sokwe 21:31, 25 April 2009 (UTC)

I'm hoping it's a caching issue... DynamicPageList loves giving cryptic error messages as a result of an invalid search that was performed hours earlier, so hopefully it clears up by itself soon. In the meantime, I'll look for a way to disable the caching so that this stuff doesn't happen. Nathaniel 21:46, 25 April 2009 (UTC)

## Parameter search

I created a simple template to be used to look up which pattern pages are missing specific parameters in their templates (there may be some bugs, I haven't tested it much). This can be used to look up such things as which patterns do not have defined glider syntheses or bounding boxes. I was wondering if this template should be included on another page as a resource for other contributers if they feel they have the time to add information like this (for example, I recently added bounding box sizes to all of the still life pages).
~Sokwe 17:44, 26 April 2009 (UTC)

That's pretty excellent, thanks. I think that the most natural place for it is probably LifeWiki:Helping out in a new subsection. Nathaniel 17:51, 26 April 2009 (UTC)
I added it under Adding pattern information, but it requires Template:( to work; this template should probably be protected. I also created a new page for it: Template:PatternInfoSearch
~Sokwe 18:50, 26 April 2009 (UTC)

## Error in GrowingSpaceship template

It's the exact same problem that the wickstretcher template had: Template:GrowingSpaceship puts information from the page inside the infobox. Please add the necessary "|}" above the <noinclude> tag.
~Sokwe 20:19, 26 April 2009 (UTC)

Thanks, fixed now. It's a result of the new glider synthesis boxes -- I made the necessary change on most of the other templates (such as Template:Oscillator), but I apparently missed Wickstretcher and GrowingSpaceship. Fixed now. Nathaniel 20:26, 26 April 2009 (UTC)

## Some suggested updates

I've created a template for reflectors because they currently all use the pattern template. Eaters also use the pattern template even though they are exclusively still lifes. I suggest adding support for type=eater to the still life template. I also suggest that you delete Template:People as it has been effectively replaced by Template:Person.
~Sokwe 13:58, 28 April 2009 (UTC)

Those changes have now been made. Nathaniel 14:31, 28 April 2009 (UTC)

### Some more ideas for updates

First of all, I suggest that you replace the number of glider syntheses on the main page (currently "over 200") with the following:

{{#dpl:categorymatch=Patterns_that_can_be_constructed_with%|resultsheader=%TOTALPAGES%|format={{#if,:,,:|}}}}

Also, I have the basic design for a navigation box for oscillator periods. This would go on oscillator period category pages and would link to the nearest oscillator period categories (it does not link to pages that do not exist). What I haven't come up with is a good format for displaying this information, and I was wondering what you thought about it.

The basic idea:

~Sokwe 20:41, 7 June 2009 (UTC)

Very nice, made the glider synthesis change and inserted your template into the appropriate oscillator category pages. Thanks, and great work! Nathaniel 12:37, 8 June 2009 (UTC)

## ?

Why did you undo my edit?--71.80.49.38 14:09, 9 August 2009 (UTC)

## The new agar

I found the agar in Serviettes (B234/S) rule!
please visit my user page.--David 13:53, 13 December 2009 (UTC)

And, would you change this agar to oscillator or spacefiller? --David 06:19, 15 December 2009 (UTC)

## Upload request

Please upload the file Diuresis.rle from http://www.conwaylife.com to the extant Diuresis pattern page. You were devising a method to let people upload .rles, weren't you ?

Thanks a lot. --Methodood 21:31, 16 December 2009 (UTC)

It is possible to add patterns to the online database via the save/online database feature in Nathaniel's Game of Life player. This will save the pattern to the online database in RLE format, however, it can be overwritten. The pattern can be added to the official database (including other formats) by any of the conwaylife.com moderators. Patterns in the official database can not be overwritten via the the Game of Life player, so if you find that a pattern in the official database needs to be replaced, you should contact one of us. (Note: I have also uploaded the requested pattern files)
~Sokwe 22:48, 16 December 2009 (UTC)

## Suggestions

I have a few suggestions:

• Make a simplified version that can be embedded into pages (this would require a MediaWiki extension) so that users can view pattern evolution without having to go to a separate page.
• Add a "clear" button to make erasing patterns easier. Also allow editing after pressing the back button, which would become especially important in case users accidentally press the aforementioned button.

I think that these would both be helpful additions.

Also, why are you unable to add MediaWiki extensions on a shared Windows host? Can't you just copy the PHP files into the proper directory? Or do you not have access to the MediaWiki directories? The last username left 02:35, 29 December 2009 (UTC)

Hi there, and welcome to the wiki. What do you mean about a "simplified version"? Do you mean a simplified version of the applet to be embedded in wiki pages? That would indeed be quite cool, though I'm not sure I have the time at the moment for that undertaking. I'll add it to the to-do list though. As for the clear button -- there should already be a clear button at the lower-right corner of the applet. Does it not appear for you?
As for editing after pressing the back button -- I'm not sure this will happen. It would require re-writing a *lot* of the applet, and I'm not sure how to even go about doing it while maintaining the functionality of the applet.
I am quite capable of adding MediaWiki extensions to the wiki (and in fact there are a handful of them running on this wiki right now, mostly to do things like fight spam). What I wrote above about being on a Windows host is only a problem for the specific extension that enables the [itex] tag. Nathaniel 06:39, 29 December 2009 (UTC)
Oops, sorry about that. I had originally said "a few suggestions about the applet", but reworded it. I forgot to mention it in the suggestion. Yes, I meant a simplified version of the applet.
No, the clear button does not appear for me - at least not on the computer I was using at the time (Vista with IE8). Over on a Windows 7 machine, it appears just fine. I think it was because of the font size settings on that computer. The menu is still not working properly, though; see the screenshot. The last username left 23:21, 29 December 2009 (UTC)

## I want to...

Please active my account in conwaylife.com forums.--David 08:36, 23 January 2010 (UTC)

I assume that your forums account has the username "David"? If so, then this is done now. Nathaniel 14:38, 23 January 2010 (UTC)

## Sawtooth 262

You'll need to update the sawtooth snippet for sawtooth 260 because it's protected (due to currently being included on the main page).

Edit: Never mind, it is no longer the featured article, so I did it myself.
~Sokwe 09:53, 31 May 2010 (UTC)

## Citation extension not working

The reference tags (<ref>) don't seem to be working.
~Sokwe 01:45, 29 May 2010 (UTC)

Thanks Sokwe. My server folks moved the site to a new machine that doesn't like the citations extension (or one of the spam-fighting extensions, hence the increase in spam over the last few days). Hopefully I'll be able to figure it out soon. Nathaniel 15:23, 31 May 2010 (UTC)
OK, looks like the citations extension is (finally) functional again. Nathaniel 13:01, 8 July 2010 (UTC)

## Refs are not doing their job properly

(And I don't mean football referees! :)

The <ref> </ref> tags are no longer being recognised by the software on LifeWiki, thus making a complete mess of every page. An example is the page entitled Switch engine.

-- Calcyman 19:57, 4 June 2010 (UTC)

Thanks Calcyman -- see one section up on my talk page for an explanation. Should hopefully have it figured out soon. Nathaniel 23:42, 4 June 2010 (UTC)

## Lake discussion page

To circumvent the continual spam, I have attempted to protect this page from editing by using the 'protected' template. Unfortunately, it doesn't seem to be working. Calcyman 10:51, 14 June 2010 (UTC)

Placing {{Protected}} on a page doesn't protect the page. A sysop/administrator/bureaucrat/etc needs to use the protect feature which does not appear for normal users who cannot use this feature. Keiji 15:51, 15 June 2010 (UTC)
Yes, I know that, but it might trick the spam-bots. They might be programmed to ignore pages with the 'protected' template, since pages on Wikipedia with this template are protected, so there is no point attempting to edit them.
I've gone ahead and actually protected the page from unregistered users. Nathaniel 20:06, 15 June 2010 (UTC)

## Merging and deleting users

Since you are the only one capable of using the merge and delete user extension, you will need to delete/merge any of the spam accounts that I block.
~Sokwe 01:31, 15 May 2011 (UTC)

## Spam issues

Much of the spam that we currently get is from new accounts. Would it be possible to prevent accounts that are less than a couple of days old from posting external links or uploading files? (or does that seem too restrictive to new, legitimate users?)
~Sokwe 17:07, 29 May 2011 (CDT)

I'll look at another spam-fighting extension or two tomorrow to see what can be done before doing that. I'd like people to be able to sign up and start editing right away... maybe e-mail address verification should be required? Nathaniel 21:25, 29 May 2011 (CDT)
Looks like a change I made yesterday afternoon is working for now at least. If (when?) the current system starts to fail, I will implement reCAPTCHA for suspicious edits and see how that works. Nathaniel 10:46, 31 May 2011 (CDT)

## Animated Gif

How do I get the animated gif working at Karel's p15? --Scot Ellison 14:06, 21 July 2011 (CDT)

There was a memory problem with MediaWiki that made it not want to play nice with newly-uploaded animated GIFs. Fixed now! Nathaniel 00:20, 22 July 2011 (CDT)
Thanks! :) S.E.

## Wrong page title

I somehow got the wrong title on the P11_signal_injector page. I intended it to be P11 double-length signal injector, but I can't seem to change it now. Is there way for me to fix this without creating a new page and setting a redirect?--Scot Ellison 10:58, 3 August 2011 (CDT)

I've moved the page for you. Only administrators (i.e., me and Sokwe) can move pages, so just ask and it'll be done! Nathaniel 00:24, 5 August 2011 (CDT)

## External links bug

Hi,
I seem to be getting loads of "Your edit includes new external links" prompts, even when I'm not. (Such as this very query.) I think this is triggered whenever I try to edit a page that contains external links - including those to pattern files - for the first time?

ETA: Nope, not quite. Just got the same with the Task List which I have edited before. Pages not edited before this bug turn'd up, then?

Besides… Doesn't MediaWiki allow limiting these kind of checks to some editors? Eg. accounts with less than X edits, or younger than Y days?--Tropylium 07:53, 8 September 2011 (CDT)

Thanks for letting me know, I'll look into it. Unfortunately the MediaWiki spam fighting tools leave a bit to be desired -- they're actually implemented via extensions (i.e., they aren't built into MediaWiki itself at all). The extension I'm using has fairly limited categories for who is subject to spam verification and who isn't -- basically it boils down to the question of "are you an admin or not?" But still, it shouldn't be asking you to verify if the links aren't new... will get back to you. Nathaniel 09:45, 8 September 2011 (CDT)
I've created a "trusted" user group that is exempt from the SPAM filter, and placed you and a few other people into it. You shouldn't get those anti-SPAM messages at all anymore (let me know if you experience otherwise). Nathaniel 09:58, 8 September 2011 (CDT)

## Day & Night Link Broken

This link is broken: Day & Night

Can you move it to somewhere else so that we can access it?

Zhuyifei1999 09:13, 20 February 2013 (CST)

Fixed. I made a redirect that works. But I'm waiting for you to update the system so that it can support "&" marks.
Zhuyifei1999 13:41, 14 March 2013 (UTC)
Hi Zhuyifei1999. Unfortunately, this is a result of the wiki using short URLs, and it seems that the only fix is to install a patch to apache that alters how it deals with ampersands. I don't have access to install patches on the server myself (it's a shared host), so the best that I can do it contact my host about it and hope they're willing to install it for me. Given this, I would recommend either continuing to use the work-around you have right now, or re-naming the page to something like Day and Night.
Nathaniel 12:30, 22 March 2013 (UTC)
Wikipedia uses short URLs too, but it works. So I think the bug is not caused by short URLs, instead, I think it is caused by version problems.
Zhuyifei1999 22:53, 22 March 2013 (UTC)
Wikipedia has root access and has installed the apache patch that alters how it deals with ampersands. Unfortunately, I can't do the same, since I don't have root access. You can see a brief discussion about this issue here. - Nathaniel 01:24, 23 March 2013 (UTC)

## Move request

Zhuyifei1999 03:54, 26 February 2013 (CST)

Moved. Nathaniel 12:30, 22 March 2013 (UTC)

## Upload pattern request

Moon:

 x = 2, y = 4, rule = B2/S o$bo$bo$o!   .......O.................O....... ......OOO...............OOO...... .....OO....OOO.....OOO....OO..... ...OO.O..OOO..O...O..OOO..O.OO... ....O.O..O.O...O.O...O.O..O.O.... .OO.O.O.O.O....O.O....O.O.O.O.OO. .OO...O.O....O.....O....O.O...OO. .OOO.O...O....O.O.O....O...O.OOO. OO.........OO.O.O.O.OO.........OO ............O.......O............ .........OO.O.......O.OO......... ..........O...........O.......... .......OO.O...........O.OO....... .......OO...............OO....... .......O.O.O.OOO.OOO.O.O.O....... ......OO...O...O.O...O...OO...... ......O..O...O.O.O.O...O..O...... .........OO....O.O....OO......... .....OO....O...O.O...O....OO..... .........O.OO.O...O.OO.O......... ..........O.O.O.O.O.O.O.......... ............O..O.O..O............ ...........O.O.....O.O...........   #C Jagged lines #C Jagged lines of gliders, formed by a drifting collision of two LWSS #C streams, crash to form an approximately vertical jagged line of pairs #C of blocks. I don't know if the line stays within a bounded distance #C of the center line, or extends infinitely far to the left, or to the #C right, or both. #C Dean Hickerson, 5/3/2005 x = 125, y = 67, rule = B3/S23 42bo13bo11bo13bo$41b3o11b3o9b3o11b3o$40b2obo5bo4b2obo9bob2o4bo5bob2o$ 40b3o5b3o3b3o11b3o3b3o5b3o$41b2o4bo2b2o3b2o11b2o3b2o2bo4b2o$47bo3bo21b o3bo$48b2obo21bob2o$50b2o21b2o2$55b3o9b3o$33b3o5b3o11bo2bo7bo2bo11b3o 5b3o$32b5o3bo2bo11bo13bo11bo2bo3b5o$31b2ob3o6bo11bo13bo11bo6b3ob2o$4o 5b2o21b2o9bo12bo11bo12bo9b2o21b2o5b4o$o3bo3b2ob2o30bo6bo23bo6bo30b2ob 2o3bo3bo$o8b4o29bo5b2obo21bob2o5bo29b4o8bo$bo8b2o36bo2bo21bo2bo36b2o8b o2$13bo30b2o5bo21bo37bo$3b2o8b2o12bo17bo4bobo19bobo22bo12b2o8b2o$2bo2b o9bo12b2o19bo25bo19b2o12bo9bo2bo$2bo2bo4b5o12b2o67b2o12b5o4bo2bo$2b2ob 2o3b4o97b4o3b2ob2o$4b2o4bo103bo4b2o3$11b3o97b3o$4o6b5o95b5o6b4o$o3bo4b 2ob3o95b3ob2o4bo3bo$o9b2o25b2o47b2o25b2o9bo$bo34b4o45b4o34bo$19b2o14b 2ob2o45b2ob2o14b2o$18b4o14b2o19b3o5b3o19b2o14b4o$17b2ob2o34bo2bo5bo2bo 34b2ob2o$18b2o39bo5bo39b2o$59bo5bo$59bo5bo$23bo34bo7bo34bo$21b4o75b4o$ 20bob5o71b5obo$19b2o6bo27b2o11b2o27bo6b2o$20b3obo3bo25b2ob3o5b3ob2o25b o3bob3o$21b3o3bo27b5o5b5o27bo3b3o$26bo29b3o7b3o29bo2$19b2o20b3o37b3o 20b2o$18b4o4b4o11bo41bo11b4o4b4o$17b2ob2o4bo3bo11bo39bo11bo3bo4b2ob2o$ 2b4o5b2o5b2o6bo71bo6b2o5b2o5b4o$2bo3bo3b2ob2o12bo69bo12b2ob2o3bo3bo$2b o8b4o21b3o47b3o21b4o8bo$3bo8b2o22bo51bo22b2o8bo$37bo49bo2$5bo6bo99bo6b o$4bo7b2o17b3o57b3o17b2o7bo$4bo6b2o18bo61bo18b2o6bo$4b2o4b2o20bo59bo 20b2o4b2o$6bo111bo$8b2o105b2o$26b3o67b3o$26bo71bo$2b4o21bo69bo21b4o$2b o3bo13bo83bo13bo3bo$2bo16bo85bo16bo$3bo15bo3bo77bo3bo15bo$19b4o79b4o!   x = 2, y = 2, rule = B2/S bo$o!

 x = 9, y = 9, rule = B3/S23 boobboboo$obbobboo$bobo$bbo$8bo$6b3o$5bo$6bo$7boo!

loafer glider synthesis:

 x = 40, y = 37, rule = B3/S23 38bo$37bo$37b3o2$8bobo$obo6b2o$b2o6bo$bo3$4bobo$5b2o$5bo20bo$24bobo$25b2o2$33bo$33bobo$33b2o6$38bo$37b2o$37bobo8$5b3o$7bo$6bo!

 x = 113, y = 11, rule = B3/S23 107bo3bo$107b2ob2o$108bobo$29bo76bobobobo$16bo11b2o8bo19bo8b2o8bo19bo 8b2o3b2o$o14b4o9bo8b4o15b4o7b2o7b4o15b4o8bo3bo$obo7bo3bo3b2ob2o9bo3bo 3b2ob2o7b2ob2o3bo3bo6bo3bo3b2ob2o7b2ob2o3bo3bo$3o6b4o5bo2b2o8b4o5bo2b 2o7b2o2bo5b4o4b4o5bo2b2o7b2o2bo5b4o$2bo5bo3bo7bo2bo6bo3bo7bo2bo5bo2bo 7bo3bo2bo3bo7bo2bo5bo2bo7bo3bo$9bobo2bo16bobo2bo23bo2bobo4bobo2bo23bo 2bobo$13bo21bo25bo12bo25bo!

 x = 159, y = 90, rule = B3/S23 13b3o11b3o99b3o11b3o$12bo3bo9bo3bo97bo3bo9bo3bo$11b2o4bo7bo4b2o95b2o4b o7bo4b2o$10bobob2ob2o5b2ob2obobo93bobob2ob2o5b2ob2obobo$9b2obo4bob2ob 2obo4bob2o35b3o15b3o35b2obo4bob2ob2obo4bob2o$8bo4bo3bo2bobo2bo3bo4bo4b o28bo3bo13bo3bo28bo4bo4bo3bo2bobo2bo3bo4bo$20bobo15b3ob2o23b2o4bo11bo 4b2o23b2ob3o15bobo$8b2o7b2obobob2o7b2o2b2o3bob2o20bobob2ob2o3b3o3b2ob 2obobo20b2obo3b2o2b2o7b2obobob2o7b2o$20bobo13b2o2bo4b5o15b2obo4bob2ob 3ob2obo4bob2o15b5o4bo2b2o13bobo$14b3o9b3o5bo2bo5bobobob2ob2o5bo4bo4bo 3bo4bobo4bo3bo4bo4bo5b2ob2obobobo5bo2bo5b3o9b3o$14bo3bo9bo6bo8bo3bo3bo b2o2b3o15bo5bo15b3o2b2obo3bo3bo8bo6bo9bo3bo$14bobo4b3o26bo4b3ob3o2b2o 7b2o9b2o7b2o2b3ob3o4bo26b3o4bobo$20bo2bo4b2o19bo3bobo5b2o33b2o5bobo3bo 19b2o4bo2bo$23bo30bo6bo2bo29bo2bo6bo30bo$19bo3bo39bo31bo39bo3bo$19bo3b o111bo3bo$14bo8bo111bo8bo$14bobo3bobo113bobo3bobo$14b2o127b2o4$12bo23b 3o11b3o53b3o11b3o23bo$12bobo20bo3bo9bo3bo51bo3bo9bo3bo20bobo$12b2o20b 2o4bo7bo4b2o49b2o4bo7bo4b2o20b2o$33bobob2ob2o5b2ob2obobo47bobob2ob2o5b 2ob2obobo$32b2obo4bob2ob2obo4bob2o45b2obo4bob2ob2obo4bob2o$31bo4bo3bo 2bobo2bo3bo4bo43bo4bo3bo2bobo2bo3bo4bo$10bo32bobo67bobo32bo$10bobo18b 2o7b2obobob2o7b2o43b2o7b2obobob2o7b2o18bobo$10b2o31bobo67bobo31b2o$37b 3o9b3o55b3o9b3o$37bo3bo9bo55bo9bo3bo$37bobo4b3o65b3o4bobo$8bo34bo2bo4b 2o53b2o4bo2bo34bo$8bobo35bo65bo35bobo$8b2o32bo3bo65bo3bo32b2o$42bo3bo 65bo3bo$37bo8bo65bo8bo$37bobo3bobo67bobo3bobo$6bo30b2o81b2o30bo$6bobo 141bobo$6b2o143b2o2$35bo87bo$35bobo83bobo$4bo30b2o85b2o30bo$4bobo145bo bo$4b2o147b2o2$33bo91bo$33bobo87bobo$2bo30b2o89b2o30bo$2bobo149bobo$2b 2o151b2o2$31bo95bo$31bobo91bobo$o30b2o93b2o30bo$obo153bobo$2o155b2o2$29bo99bo$29bobo95bobo$29b2o97b2o$3o153b3o$obo153bobo$3o153b3o$27bo103b o$6b2o19bobo99bobo19b2o$8bo18b2o101b2o18bo$6b3o141b3o$5bob2o141b2obo$ 4bobo145bobo$4bobo18bo107bo18bobo$25bobo103bobo$9b2o14b2o105b2o14b2o$ 8bo2bo135bo2bo$9b2o137b2o2$23bo111bo$12b2o9bobo107bobo9b2o$11bo2bo8b2o 109b2o8bo2bo$12b2o131b2o3$21bo115bo$21bobo111bobo$17b2o2b2o113b2o2b2o$17b2o121b2o!  Zhuyifei1999 04:24, 26 February 2013 (CST) Sorry for the delay -- I'll get to these shortly. Will let you know once they're online. Nathaniel 12:31, 22 March 2013 (UTC) ## Snark reflector Hello, Here's the missing RLE data for the Snark reflector:  x = 23, y = 19, rule = B3/S23 18b2o$18bo$20bo$2o14b5o$bo13bo$bobo12b3o$2b2o15bo$16b4o$11b2o3bo3b2o$ 11b2o4b3o2bo$19bob2o$3b2o14bo$2bobo13b2o$4bo2$10b2o$10bo$11b3o$13bo!

MikeP 16:00, 30 May 2013 (UTC)

Actually, for a reflector it would make sense to set as default a version with a smaller bounding box rather than the original version. Of course, the original version is also worth mentioning.

x = 23, y = 17, rule = B3/S23 18bo$2o14b5o$bo13bo5bo$bobo12b3o2bo$2b2o15bob2o$16b4o2bo$11b2o3bo3b2o$11b2o4b3o$19bo$19bob2o$18b2ob2o$b2o$obo$2bo7b2o$10bo$11b3o$13bo!

Codeholic 19:42, 31 May 2013 (UTC)

Here is glider synthesis of the Snark. Please add it to the article.

#N Snark_synth
#O Ivan Fomichev
#C Continuous synthesis of the snark, with improvements by Mark Niemiec.
#C http://www.conwaylife.com/wiki/Snark
x = 216, y = 212, rule = B3/S23
194bo8bo$194bobo4b2o12bo$194b2o6b2o9b2o$214b2o11$191bo$189b2o$190b2o2$13bobo$14b2o$14bo2$178bo$177bo$2bo174b3o$obo$b2o7$4bobo8bo149bo$5b2o9b
2o145b2o$5bo9b2o147b2o4$158bo$157bo$157b3o5$29bo$30b2o118bobo$29b2o 119b2o$151bo$35bo125bo5bo$33bobo120bo3bo5bo$34b2o118b2o4b3o3b3o$155b2o
2$37bo$35bobo$36b2o9$151bo$150bo$150b3o12$140bobo$140b2o$141bo14$126bo
$124b2o$125b2o4$93bo$94b2o$93b2o2$106bo$105bo$105b3o$117bobo$86bobo28b
2o$87b2o29bo$87bo7$91b3o$93bo$92bo$110b2o$109b2o$111bo7$118b2o9b2o$86b
2o30bobo8bobo$85bobo30bo10bo$87bo2$118b2o$117b2o$119bo$125b2o$83b2o39b 2o$82bobo41bo$84bo5$144bo$143b2o$143bobo4$151b3o$151bo$152bo3$148b2o$147b2o$149bo6$164bo$163b2o$163bobo$147bo$146b2o$146bobo$27bo$27b2o$26b obo6$19bo9b3o$19b2o10bo$18bobo9bo125b2o$156bobo$23b2o131bo$22bobo$24bo
7$22b2o$23b2o$22bo174bo$196b2o$196bobo5$206b2o$206bobo$206bo3$181b3o$
181bo$4b2o176bo$3bobo$5bo!  Codeholic 19:47, 6 July 2013 (UTC) ## Fore and back synthesis Please add this to the article. #N Fore and back_synth #O Mark D. Niemiec #C Glider synthesis of Fore and back. #C http://www.conwaylife.com/wiki/Fore_and_back x = 103, y = 37, rule=B3/S23 71bo$71bobo$71boo$66bo$59bo4bobo$60bo4boo$58b3o$71bo$69boo$70boo$$5bo 26bo29bo4bo26bobo27boboboob3o23bobbo21bo4bobboobo28boo20bobo5boobb o51boo11bo3bobo6bo15booboo66bo4boo5boo16boobobo66b3o3bo6boo18bobbo 96boo3boo58boo6bo3b3o23bobbo59boo5boo4bo24boboboo16bo41bo6bobo3bo 11boo13booboo16bobo27boo28boo5bobo12b3oboo27bobbo26bobbo4bo14bo30bo bo27bobo13bo32bo29bo$$67boo$68boo$67bo$78b3o$72boo4bo$72bobo4bo$72bo$66boo$65bobo\$67bo!

Codeholic 19:43, 10 September 2013 (UTC)

Thanks, Codeholic. I've (finally) added these last two glider syntheses. Nathaniel 15:54, 3 October 2013 (UTC)

## 60P312?!

i have NO IDEA how to make a new section so i'll put it here. Nathaniel, whydid you delete 60P312? i was looking forward to building it as it only has 60 cells.

Unfortunately, as the page was deleted almost 3 years ago (May 2011), I don't remember anymore why it was deleted (and the wiki doesn't seem to have a copy of the old page anymore, so I can't see what was on it). However, it looks like it may have been accidentally deleted when I deleted a bunch of spam pages -- if that's the case, I apologize. Nathaniel 17:28, 28 January 2014 (UTC)

## Spam pages to delete

BTW, there's a bunch (~35, and I'm going to add more now) of spam pages in Category:Speedy_deletion waiting to be deleted. JWatCCI 16:53, 13 March 2014 (UTC)

And this user has reverted the removal of their spam, and should be blocked. JWatCCI 17:03, 13 March 2014 (UTC)

## Toplevel category

I'd like to make Category:Everything else (and the other protected categories) into subcategories of new category I just created Category:Toplevel category, for simplicity of categorization (so there is only one un-categorized category), but I can't do so because they are protected. Assuming you agree, please do so (or remove the protection and I'll do it). Thanks! JWatCCI 18:01, 13 March 2014 (UTC)

## Add Category:Disambiguation pages to Template:Disambig

In order to automatically categorize disambiguation pages, please consider adding (the newly created, by me) Category:Disambiguation pages to Template:Disambig. JWatCCI 20:13, 13 March 2014 (UTC)


text:
• Create Account

## How to nicely handle lots of "define"-related commands

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

4 replies to this topic

### #1floatingwoods  Members

Posted 18 November 2012 - 02:19 PM

Hello,

I have a rather large application that can be compiled for Windows with MFC, for Windows with Qt, for Mac with Qt or for Linux with Qt. For historical reasons I need to keep those 4 configurations in parallel.

I define sections of code for one platform, or for one compiler with "#ifdef BLABLA #else #endif" preprocessor commands. I also have many other defines that are related to the application functionality (e.g. EVALUATION, FULL, LICENSE_CHECK, etc.).

Until now, I had all those important definitions (and new definitions based on those initial definitions) in a precompiled header. But I feel that it is not really elegant. I don't care about compilation speed anyway.

Other people are using "config.h" files, that include all the major defines. But I feel that that 2. method is prone to errors (e.g. what if I forget to include that config header in one file? The file might still be compiled, but not in the desired way and that could cause errors difficult to track.)

Is there a 3rd way? Or any good suggestions?

Thanks!

### #2MJP  Moderators

Posted 18 November 2012 - 02:53 PM

POPULAR

I suppose the third option would be to pass the macro definitions to the compiler through the command line, which you could set up in your build system.

### #3floatingwoods  Members

Posted 18 November 2012 - 03:02 PM

Thanks for the quick reply MJP!

That 3rd option is a bit tricky, since I have several compilers, and on top of that, I wouldn't be able to pass-in conditional definitions, like:

#define COMPILING_FULL VERSION
//#define COMPILING_EVALUATION_VERSION

#ifdef COMPILING_FULL_VERSION
#endif

#ifdef COMPILING_EVALUATION_VERSION
#define DISPLAY_EVALUATION_BANNER
#define FORBID_SAVING
#endif

above is a very simple example, but it shows what I need to be doing.

So, between method 1 & 2, which one would be the most appropriate, or the more conventional?

### #4ApochPiQ  Moderators

Posted 18 November 2012 - 04:17 PM

There's another option which is usually employed in large software codebases: create a config.h and then #include that at the top of your (mandatory) PCH.
Wielder of the Sacred Wands

### #5floatingwoods  Members

Posted 18 November 2012 - 05:07 PM

Thanks ApochPiQ!!

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


text:
# Binomial coefficient modulo a prime

1. Jun 11, 2006

### erszega

A question:

Let bin(a,b) denote the binomial coefficient a! / ( b! (a - b)! ).

Is it true that

bin( 2p, p ) = 2 (mod p) if p is prime and p>=3 ?

2. Jun 11, 2006

### matt grime

Yes, it's fermat's little theorem: x^p=x mod p, for p a prime, hence

(1+x)^2p = (1+x^p)^2 = 1+2x^p+x^{2p} mod p

note your requirement on p>=3 is not necessary. 4 choose 2 =6 whcih is congruent to 2 mod 2 as well.


text:
Free Version
Difficult

# 3-Peak Compound Action Potential

NEURO-PJXV45

When you electrically stimulate a peripheral, sensory nerve and record the compound action potential at the dorsal root ganglion of the spinal cord (the summation of all action potentials occurring across all axons in the nerve), there appear to be three different peaks as shown in the figure below.

Which of the following are potential reasons why this might occur? Select ALL that apply.

A

Myelination – Not all axons in the dorsal root are myelinated. Because myelin acts as an insulator, action potentials in myelinated axons arrive at the dorsal root ganglion earlier than the action potentials in unmyelinated axons.

B

Axon length – Not all axons in the dorsal root are the same length. Because action potentials must travel from nerve endings to the dorsal root, action potentials in longer axons that have more distant nerve endings arrive later than action potentials in shorter axons with closer nerve endings.

C

Axon diameter – Not all axons in the dorsal root are the same diameter. Because the diameter of the axon affects how quickly current can flow down the axon, action potentials in large diameter axons arrive earlier than action potentials in small diameter axons.

D

Neurotransmitter – Not all axons in the dorsal root carry the same neurotransmitters. Because some neurotransmitters have faster kinetics than others, action potentials from axons with fast synaptic transmission arrive earlier than action potentials from axons with slow synaptic transmission.


text:
# pingouin.plot_blandaltman

pingouin.plot_blandaltman(x, y, agreement=1.96, confidence=0.95, figsize=5, 4, dpi=100, ax=None)[source]

Generate a Bland-Altman plot to compare two sets of measurements.

Parameters
x, ynp.array or list

First and second measurements.

agreementfloat

Multiple of the standard deviation to plot limit of agreement bounds. The defaults is 1.96.

confidencefloat

If not None, plot the specified percentage confidence interval on the mean and limits of agreement.

figsizetuple

Figsize in inches

dpiint

Resolution of the figure in dots per inches.

axmatplotlib axes

Axis on which to draw the plot

Returns
axMatplotlib Axes instance

Returns the Axes object with the plot for further tweaking.

Notes

Bland-Altman plots [1] are extensively used to evaluate the agreement among two different instruments or two measurements techniques. They allow identification of any systematic difference between the measurements (i.e., fixed bias) or possible outliers.

The mean difference is the estimated bias, and the SD of the differences measures the random fluctuations around this mean. If the mean value of the difference differs significantly from 0 on the basis of a 1-sample t-test, this indicates the presence of fixed bias. If there is a consistent bias, it can be adjusted for by subtracting the mean difference from the new method.

It is common to compute 95% limits of agreement for each comparison (average difference ± 1.96 standard deviation of the difference), which tells us how far apart measurements by 2 methods were more likely to be for most individuals. If the differences within mean ± 1.96 SD are not clinically important, the two methods may be used interchangeably. The 95% limits of agreement can be unreliable estimates of the population parameters especially for small sample sizes so, when comparing methods or assessing repeatability, it is important to calculate confidence intervals for 95% limits of agreement.

The code is an adaptation of the PyCompare package. The present implementation is a simplified version; please refer to the original package for more advanced functionalities.

References

1

Bland, J. M., & Altman, D. (1986). Statistical methods for assessing agreement between two methods of clinical measurement. The lancet, 327(8476), 307-310.

Examples

Bland-Altman plot

>>> import numpy as np
>>> import pingouin as pg
>>> np.random.seed(123)
>>> mean, cov = [10, 11], [[1, 0.8], [0.8, 1]]
>>> x, y = np.random.multivariate_normal(mean, cov, 30).T
>>> ax = pg.plot_blandaltman(x, y)


text:
# Math Help - Differentiation problem

1. ## Differentiation problem

Deriviate:

arctan(1/x)

I use the chain rule and get:

(1/(1 + ((1/x)^2))) * ln(x)

= ln(x) / (1 + (x^2))

Is this solution correct? The book does not provide the answer, and I just want to make sure I understand the procedure.

2. That ln(x) should be -1/x^2 ..
You should differentiate 1/x not integrate it ..

3. NEVER MIND! I just realized I used intergration on (1/x). (Stupid, stupid!)

(1 / (1 + (x^2))) * (-1/(x^2))

If I'm not mistaken

4. Originally Posted by krje1980
NEVER MIND! I just realized I used intergration on (1/x). (Stupid, stupid!)


text:
Points and Vectors

I occasionaly write scripts for geometry optimization, therefore I have to wrestle with geometry. Graphically very easy problems become Ye Royale Paine In Ye Buttocks to solve analytically. At first I wrestle with piles of points, lines, determinants, trigonometric functions and whatchamacallits. Then replace all of that with a few points and vectors. Here are a few simple functions I either found online or wrote myself to help me with geometric calculations.

Angle Between Vectors

I found this on Stackoverflow. Since it works, I had no reason to fix it.

import numpy as np
import scipy as sp

def vector(x, y, z):
return np.array([x, y, z])

def norm(v):
return np.linalg.norm(v)

def unit_vector(vector):
return vector / norm(vector)

def angle_between(v1, v2):
""" Kudos: https://stackoverflow.com/questions/2827393/
Returns the angle in radians between vectors 'v1' and 'v2':

>>> angle_between((1, 0, 0), (0, 1, 0))
1.5707963267948966
>>> angle_between((1, 0, 0), (1, 0, 0))
0.0
>>> angle_between((1, 0, 0), (-1, 0, 0))
3.141592653589793
"""

v1_u = unit_vector(v1)
v2_u = unit_vector(v2)

return np.arccos(np.clip(np.dot(v1_u, v2_u), -1.0, 1.0))

Point Rotation

It’s a generic problem but I can still share the code that worked so far.

def rotate(point, angle, axis='x'):
""" rotates a point around an axis by specified angle """
if axis == 'y':
rot_matrix = np.array([
[np.cos(angle),  0, np.sin(angle)],
[0,              1, 0            ],
[-np.sin(angle), 0, np.cos(angle)],
])
elif axis == 'z':
rot_matrix = np.array([
[np.cos(angle), -np.sin(angle), 0],
[np.sin(angle), np.cos(angle),  0],
[0,             0,              1],
])
else: # == 'x':
rot_matrix = np.array([
[1, 0, 0],
[0, np.cos(angle), -np.sin(angle)],
[0, np.sin(angle), np.cos(angle)],
])

return point.dot(rot_matrix)

De-rotate a Point Back to XY-Plane

This is not a projection of the point to XY plane but a rotation around x-axis to that plane. There are two options: calculate the angle and rotate the point by that angle or transform cartesian coordinates to cylindrical and set angle to zero. The latter is the more elegant but the first works just as well (depending on your precision requirements).

def de_rotate(p):
""" rotate the point p around x-axis so that z-axis=0 """
# measure angle between normal and point
normal = np.array([0, 1, 0])
point = np.array([0, p[1], p[2]])
phi = angle_between(point, normal)

# rotate the oritinal point around x-axis by measured angle
rotated = rotate(p, phi)
return rotated, phi

def de_rotate(p):
# alternative solution:
# calculate r in cylindrical coordinate system;
# also return the angle in cylindrical system
return np.array([p[0], (p[1]**2 + p[2]**2)**0.5, 0]), np.arctan2(p[2], p[1])

Intersection of Two Lines

This is a 2D-only problem. We have two lines, each is given by two points. The objective is to calculate the intersection between these two lines.

This code is just a transcription of dictation of a recipe from Wikipedia.

def xy_line_intersection(p_1, p_2, p_3, p_4):
""" p_1 and p_2 define the first line, p_3 and p_4 define the second;
return a point of intersection between these two lines in x-y plane

Kudos: https://en.wikipedia.org/wiki/Line%E2%80%93line_intersection#Given_two_points_on_each_line
"""
# only take x and y coordinates
x1 = p_1[0]
y1 = p_1[1]

x2 = p_2[0]
y2 = p_2[1]

x3 = p_3[0]
y3 = p_3[1]

x4 = p_4[0]
y4 = p_4[1]

def det(p1, p2, p3, p4):
return np.linalg.det(np.array([[p1, p2], [p3, p4]]))

Dx1 = det(x1, y1, x2, y2)
Dx2 = det(x1,  1, x2,  1)
Dx3 = det(x3, y3, x4, y4)
Dx4 = det(x3,  1, x4,  1)
Dx5 = Dx2
Dx6 = det(y1,  1, y2,  1)
Dx7 = Dx4
Dx8 = det(y3,  1, y4,  1)

# x-coordinate
Px = det(Dx1, Dx2, Dx3, Dx4)/det(Dx5, Dx6, Dx7, Dx8)

# y-coordinate
Dy1 = Dx1
Dy2 = Dx6
Dy3 = Dx3
Dy4 = Dx8
Dy5 = Dx2
Dy6 = Dx6
Dy7 = Dx7
Dy8 = Dx8

Py = det(Dy1, Dy2, Dy3, Dy4)/det(Dy5, Dy6, Dy7, Dy8)
return vector(Px, Py, 0)

This can also be done with vectors. Instead of line a vector between two points is created. Then each is scaled so that the new vectors produce the same point. Here’s some ASCII math for clarification (vectors are in bold):

P1(P1x, P1y), P2(P2x, P2y) - points that define first lineP3(P3x, P3y), P4(P4x, P4y) - points that define the second lineP1 + k1*(P2 - P1) = P3 + k2*(P4 - P3)

Now the above equation  contains vectors so it is in fact two equations, one for x-component and one for y.

P1x + k1*(P2x - P1x) = P3x + k2*(P4x - P3x)P1y + k1*(P2y - P1y) = P3y + k2*(P4y - P3y)

Above is a linear system of two equations and two unknowns. By solving it we get k1 and k2 and in theory, the intersecting point can be calculated with either the left or the right side of the first equation. In practice (my specific case) the left side works (within 1e-16 of the previous method) but right doesn’t (more like within 1e-5 to 1e-3). I am not sure why but it might be due to positions of the points P3 and P4. Any comment would be most welcome.

def xy_line_intersection(p_1, p_2, p_3, p_4):
# alternative solution with vectors
A = np.array([
[p_2[0] - p_1[0], p_4[0] - p_3[0]],
[p_2[1] - p_1[1], p_4[1] - p_3[1]],
])

b = np.array([p_3[0] - p_1[0], p_3[1] - p_1[1]])

k1k2 = np.linalg.solve(A, b)
k1 = k1k2[0]
k2 = k1k2[1]

va = vector(
p_1[0] + k1*(p_2[0] - p_1[0]),
p_1[1] + k1*(p_2[1] - p_1[1]),
0
)

vb = vector(
p_3[0] + k2*(p_4[0] - p_3[0]),
p_3[1] + k2*(p_4[1] - p_3[1]),
0
)

# print(P-va, P-vb)
return va

Extend a Vector to Specified y

In this problem we look for the point where the line given by two points meets given y-value. This is a quick hack and doesn’t work with y=constant lines. But works in all other cases.

def extend_to_y(p_1, p_2, y):
""" return a point that lies on a line defined by p_1 and p_2 and on y=y """
fk_3 = lambda k: p_1[1] + k*(p_2 - p_1)[1] - y
k_3 = sp.optimize.newton(fk_3, 0)

return p_1 + k_3*(p_2 - p_1)

Check If a Point is on a Line

We have three points, A, B, and C. Points A and B define a line and we would like to check if point C lies on that line within certain tolerances.

This problem was the most Paineful in me Buttocks until I switched to vector notation. The recipe is now quite simple (again, mind the bold vectors):

AB = B - A
AC = C - A
k = |AC| / |AB|
C' = A + k*AB

Now C‘ is a new point that we got to using another route. If it is on the same line it should be the same as point C. Within certain tolerance:

|C - C'| < tol ---> the point is on line AB.

And the code:

def is_between(A, B, C, tol):
# returns True if point C lies on a line between A and B;

# take an alternative path to point C:
AB = B - A
AC = C - A
k = np.linalg.norm(AC) / np.linalg.norm(AB)
C__ = A + k*AB

# it's the same point if the two are close enough
return np.linalg.norm(C - C__) < tol

If this is of any use to anyone, I will very pleased and even more surprised. If this is the case, I wish you all the best and good luck with your points and vectors.


text:
# How to find θ by knoving sin/cos

1. Dec 9, 2008

### hostergaard

1. The problem statement, all variables and given/known data

Given that sin θ =1/2, cos θ =–((√3)/2) and 0° < θ < 360°,
(a) find the value of θ;
(b) write down the exact value of tan θ.

2. Relevant equations

A; sin(180-θ)=sin(θ) and cos(180-θ)=-cos(θ)

3. The attempt at a solution
Using an calculator left me with that θ=30° but i asked a friend of mine wich got it to be 150. Now she has b-level math while i have a-level math so she siad she used some short of tabel to find the answer and that high level where supposed some furmula to find it... now i suspect that furmula A (wich i found in my course book)has something to do with this but i'm unnable (tired maybe) to wrap my head around it.

as to proplem b i think the sullution is
cos(θ)/sin(θ)=tan(θ) or opposit but i dont remember wich way it is...

Youre my heroes

Edit:just uploaded the original homework document just to be sure :-)

#### Attached Files:

• ###### Assignment 8 2i HL (trig).doc
File size:
47.5 KB
Views:
96
Last edited: Dec 9, 2008
2. Dec 9, 2008

### PingPong

I think you've got issues with your math (at least, they're not showing up on Firefox for me). Can you retype your sine and cosine values?

3. Dec 9, 2008

### tiny-tim

Hi hostergaard!

I'm not sure what you're doing (not all the question is visible),

but that equation should be cos(180-θ) = -cos(θ)

(from the formula cos(180-θ) = cos180cosθ + sin180sinθ )

4. Dec 9, 2008

### hostergaard

ups... sorry all done! :-) (with editing that is, not my homework)
if you can help me with some of the other questions in my assigment that would be apreciatet, but i will post those wich i dont understand, So it's not to neccesary

Last edited: Dec 9, 2008
5. Dec 9, 2008

### PingPong

Okay, so let's consider your problem now. First, look at the sine values. This gives a few possibilities for theta, namely pi/6 and 5pi/6. Which of these values of theta give the appropriate cosine value?

EDIT: Whoops! Sorry, forgot you were dealing with degrees. pi/6 radians is 30 degrees, and 5pi/6 radians is 150 degrees.

6. Dec 9, 2008

### hostergaard

pingpong, i'm not really sure if i understod that (english is not my main language, sorry) arent there a formula i can use?

7. Dec 9, 2008

### hostergaard

To reformulate that; exactly what should i write as the answer?
i think i can understand it then

thanks for the help!
apreciate it!

8. Dec 9, 2008

### tiny-tim

Hi hostergaard!

(btw, i never open .doc files )

ah, i can see it now … sin θ =1/2, cos θ =–((√3)/2)

ok, this is a quadrants thing … you'd better learn which quadrants sin and cos are positive or negative in …

sin is +ve in the 1st and 2nd quadrants; cos is +ve in the 1st and 4th quadrants …

does that help?

9. Dec 9, 2008

### PingPong

Okay, let's try to go slow. If you don't understand what I'm saying, let me know what doesn't make sense. There's not really just one formula you can use, it just takes some reasoning out.

If $\sin(\theta)=1/2$, then what does $\theta$ have to be? Either $\theta=30$ or $\theta=150$ (remember, $\sin(150)=\sin(180-30)=\sin(30)$.

Which of these values gives $\cos(\theta)=-\sqrt{3}/2$? Well, we know that $\cos(30)=\sqrt{3}/2$, so it's not going to be 30 degrees. On the other hand, $\cos(150)=\cos(180-30)=-\cos(30)=-\sqrt{3}/2$, which is what we want.

Hopefully that makes sense.

10. Dec 9, 2008

### hostergaard

oohh, now i understand the logic! (i can be so dense when i'm tired )
ok, so i find that θ is either 30 or 150 by saying sin^-1(1/2)
Ohh, i just rember when i use calculator i only get one answer theres suposed to two.

11. Dec 9, 2008

### hostergaard

And;
Really many thanks for the help! you guys really saved my skin :-)


text:
# Understanding Adiabatic Processes in a practical sense

We all know the basic understanding of the adiabatic phenomenon: ideal gas expands and cools, compresses and heats up. Now by expand, let take a quick look at a scenario: let assume there is a tank filled with nitrogen gas at 300°C pressurized to 4500 psi, 468 g of the gas is vented through a tube into a large balloon and the tank pressure drops to 120 psi in 10 seconds. The balloon reaches a pressure of 20 psi through the process. Based on adiabatics, to what temperature does the gas cools by expanding through the tube and into the balloon or does it even cools at all?

• Comments are not for extended discussion; this conversation has been moved to chat. – ACuriousMind Feb 23 '19 at 15:16

## 1 Answer

$$T=(300+273)\left(\frac{134.7}{4514.7}\right)^{0.286}=210\ K=-63 C$$

ADDENDUM

Here are some calculations and analysis for your consideration based on ideal gas:

Initial pressure = 4500 psig = 307.1 atm.

Final pressure = 120 psig = 9.16 atm.

$$T_f=T_i\left(\frac{P_f}{P_i}\right)^{2/7}=210\ K=-63\ C$$ Calculation of initial moles $$n_i$$ in tank: $$n_i=\frac{500}{28}=17.857$$ Calculation of tank volume:$$V_T=\frac{n_iRT_i}{P_i}=\frac{(17.857)(0.08205)(573)}{307.1}=2.735\ liters$$ Calculation of final number of moles in tank: $$n_f=\frac{P_fV_T}{RT_f}=\frac{(2.735)(9.1633)}{(0.08205)(210)}=1.454\ moles=40.7\ grams$$ Application of the first law of thermodynamics to get the final temperature in the balloon:

Treating the mass of gas in the tank and the balloon as our closed system, and applying the first law of thermodynamics, we have: $$\Delta U=-\int_0^{V_f}{P_{ext}dV}$$where V is the volume of the balloon, and the change in internal energy of the gas is given by: $$\Delta U=n_fC_v(T_f-T_i)+(n_f-n_i)C_v(T-T_i)=(1.454)(2.5R)(210-573)+16.4(2.5R)(T-573)$$

We don't know the external pressure applied by the balloon rubber membrane to the gas because we don't know how the rubber behaves in terms of its stress strain behavior. But, we do know that the final pressure in the balloon is 20 psig. So, we rewrite the work term in our energy balance equation in a little different way:$$\int_0^{V_f}{P_{ext}dV}=\overline{P_{ext}}V_f=\frac{\overline{P_{ext}}}{P_{ext,f}}P_{ext,f}V_f$$where $$\overline{P_{ext}}=\frac{1}{V_f}\int_0^{V_f}{P_{ext}dV}$$We know that the ratio of the average external pressure to the final external pressure is going to be less than 1 because the pressure in the balloon is going to be increasing monotonically with time. So we can re-express the work as $$\int_0^{V_f}{P_{ext}dV}=kP_{ext,f}V_f$$with (0 < k < 1). From the ideal gas law, we also know that $$P_{ext,f}V_f=(n_i-n_f)RT$$So, combining previous equations, we have: $$n_fC_v(T_f-T_i)+(n_f-n_i)C_v(T-T_i)=-k(n_i-n_f)RT$$or equivalently: $$(1.454)(2.5)(210-573)+16.4(2.5)(T-573)=-k(16.4)T$$ Solving this for values over the allowable range of k, we obtain:

T = 603 K = 325 C for k = 0

T = 432 K = 159 C for k = 1

T = 506 K = 234 C for k = 0.5

Questions?

• Comments are not for extended discussion; this conversation has been moved to chat. – ACuriousMind Feb 23 '19 at 15:16
• @ Chester, I've got questions for you, check out the chat. – TechDroid Feb 24 '19 at 10:00
• I checked out the chat, but I don't see any questions there. Why don't you ask them in comments right below here? – Chet Miller Feb 24 '19 at 12:33
• So in your newly added analysis, the final values for Ts over the k interval (0,1) are the final temperature for what? And what condition does k represent in a practical sense. If they are the final temperature in the balloon, then where goes the adiabatic cooling. – TechDroid Feb 24 '19 at 13:15
• For we have come this far, I think it's time I pour out my thoughts and understanding of the situation so far. Since the adiabatic cooling happens in the tank, I believe as temperature in the tank drops, temperature of gas leaving it also drops. Now let assume we track every 10 g of nitrogen leaving the tank, so definitely every 10 g is cooler than the last, and the last 10 is as cool as roughly ~-50°C. So averaging out the total change in temperature from 300°C to -50°C, we should be at a temperature low enough. – TechDroid Feb 24 '19 at 13:16


text:
## Friday, August 31, 2012

### san serif math fonts

So I switched formatting in my thesis to a san serif font because I prefer it and my figures all had san serif fonts in them already and I wanted them to match so... but I have some equations and lots of in-text symbols, superscripts and subscripts using math mode and when I switched to san serif they stayed serif, unless I used \text{} in math mode.
I stumbled upon this post in stack exchange:
Some (partial) solutions I found:
Like this:
\setmathrm{Arial}
\setmathsf{Arial}
\setmathtt{Arial}
\setboldmathrm[BoldFont={Optima ExtraBlack}]{Optima Bold}

However this does not change the italic math font for some reason (and there does not seem to be an option to do this(?)).
\usepackage[cm]{sfmath}
\usepackage{cmbright}
This works fairly well, but the choice of fonts is limited.
For example:
\usepackage{unicode-math}
%\usepackage[math-style=ISO]{unicode-math}
\setmainfont{XITS}
\setmathfont{XITS Math}
%\setmathfont[range=\mathit/{latin,Latin}]{Adobe Garamond Pro}

Although this has the problem that \setmathfont{} gives a bug when used in combination withamsmath...
fontspec required more effort than the one minute I really wanted to spend on it. sfmath didn't work for me??? and cmbright worked first go with just \usepackage{cmbright}. Font blends well with my current (supposedly Arial) san serif font.


text:
# Tag Info

3

The star acts as an "effective point source" since it is so far away and its angular extent is so small - in other words, the optical signal arriving at earth is "very nearly" a plane wave with the same phase over a large extent. This is what enables us to do interferometry. Think of waves, not photons.

0

According to the diagram you provided, $|a\rangle$ is injected into a beam-splitter, resulting in the out-put state, $$|\psi_{o}\rangle =B|a\rangle= e^{\frac{i\pi}{2}}|b\rangle +|c\rangle.$$ Here the beam-splitter unitary is denoted by $B$. I have expressed $i$ as $e^{\frac{i\pi}{2}}$, to highlight the fact that $|b\rangle$ picks ...

0

In the 2 glasses there are 4 surfaces, i.e interface air/glass, and 8 surface orientations (a..h) and plenty room for interference between reflections and the main beam. LASER (air) a1b (glass) c2d (air) e3f (glass) g4h At each interface the is reflection that will be reflected forward again (self-interference) look for iridiscence in ...

1

At a guess, the effect rises from the fact that your interferometer is not properly aligned. The presence of linear, rather than circular, fringes suggests that there is an angular misalignment. Then moving the wedge causes a lateral shift in the intersection point of the beam and the angled slide, which results in a shift in the apparent position of the ...

1

This answer is based on Floris' insight that the slides might be bent. Let's say the laser hits the slide at an angle of $\theta$ and travels through the panel at an angle of $\theta'=\sin^{-1}({n_a\over n_s}\sin(\theta))$. Let's assume the curvature is light enough that the laser essentially exits parallel to how it entered. I am also going to assume you ...

3

This is speculating - but if your slides are of non-uniform thickness, or they are bent as a result of the pinching, they will present a different path length in one leg of the interferometer (and therefore give rise to a shift in the fringe pattern). This may become clear by looking at this diagram: In the diagram on the left, the total path length is ...

Top 50 recent answers are included


text:
# QM - Eigenfunction / Eigenvalue Problem

1. Aug 31, 2007

### danny271828

1. The problem statement, all variables and given/known data

Find the eigenfunctions and eigenvalues for the operator:

a = x + $$\frac{d}{dx}$$

2. The attempt at a solution

a = x + $$\frac{d}{dx}$$

a$$\Psi$$ = $$\lambda$$$$\Psi$$

x$$\Psi$$ + $$\frac{d\Psi}{dx}$$ = $$\lambda$$$$\Psi$$

x + $$\frac{1}{\Psi}$$$$\frac{d\Psi}{dx}$$ = $$\lambda$$

x + $$\frac{d}{dx}$$ ln($$\Psi$$)= $$\lambda$$

$$\frac{1}{2}$$x$$^{2}$$ + ln($$\Psi$$) = $$\lambda$$x +c

$$\Psi$$ = e^(-$$\frac{1}{2}$$x$$^{2}$$+$$\lambda$$x+c)

$$\Psi$$ = e^(-$$\frac{1}{2}$$x$$^{2}$$+$$\lambda$$)$$\Psi$$(0)

Not sure from here... I think I plug into initial equation?

a$$\Psi$$ = $$\lambda$$$$\Psi$$

substituting and using chain rule I obtain...

x$$\Psi$$ + ($$\lambda$$-x)$$\Psi$$ = $$\lambda$$$$\Psi$$

so x + ($$\lambda$$ - x) = $$\lambda$$

so $$\lambda$$ = $$\lambda$$ nope I guess I don't do that... good check though, so I guess this is the correct way to solve for eigenfunction... Can someone help me with finding $$\lambda$$?

2. Aug 31, 2007

### meopemuk

Normally, the spectrum of allowed eigenvalues $\lambda$ is obtained from the normalization condition. I.e., there should be a non-zero normalization constant (which you denoted by $\Psi(0)$) such that the integral of the square of the modulus of the wavefunction over entire space (the total probability of finding the particle) is equal to 1. In your case, this doesn't matter, because the wavefunction is normalizable for all real $\lambda$. So, all values of $\lambda$ are allowed. However, in more complex cases such as a particle in a potential well - the normalization condition would allow you to find the discrete spectrum of energy eigenvalues.

Eugene.

P.S. Perhaps, it is not a good idea to ask the same question in three different threads.


text:
# Integral calculation

• April 16th 2009, 02:37 PM
maria18
Integral calculation

Evaluate : $\Large \int_{a}^{b}\frac{e^{t}}{t}dt$
• April 16th 2009, 03:01 PM
Jhevon
Quote:

Originally Posted by maria18

Evaluate : $\Large \int_{a}^{b}\frac{e^{t}}{t}dt$

and why would you need to evaluate this? This is not a nice integral, it has no primitive integral in elementary functions.