Differences between revisions 19 and 27 (spanning 8 versions)
Revision 19 as of 2010-11-20 06:54:37
Size: 9830
Editor: Eviatar
Comment: Fixed Cellular Automaton to work correctly for rules where background is ones (such as 255) and made matrix display in opposite colours, as is conventional.
Revision 27 as of 2012-04-18 18:28:06
Size: 10307
Editor: bvarberg
Comment:
Deletions are marked like this. Additions are marked like this.
Line 8: Line 8:
by Marshall Hampton. When the two frequencies are well seperated, we hear the right hand side of the identity. When they start getting close, we hear the higher-pitched factor in the left-hand side modulated by the lower-pitched envelope.

{{{
by Marshall Hampton. When the two frequencies are well separated, we hear the right hand side of the identity. When they start getting close, we hear the higher-pitched factor in the left-hand side modulated by the lower-pitched envelope.

{{{#!sagecell
Line 49: Line 49:
{{{ {{{#!sagecell
Line 107: Line 107:
{{{ {{{#!sagecell
Line 163: Line 163:
{{{ {{{#!sagecell
Line 177: Line 177:
{{{ {{{#!sagecell
Line 197: Line 197:
{{{ {{{#!sagecell
Line 208: Line 208:
{{{ {{{#!sagecell
Line 256: Line 256:
{{{ {{{#!sagecell
%python
Line 258: Line 260:

def cellular(rule, N):
from random import randint

def cellular(rule, N, initial='Single-cell'):
Line 264: Line 267:
    initial: starting condition; can be either single-cell or a random binary row
Line 265: Line 269:
    M=zeros( (N,2*N+1), dtype=int)
    M[0,N]=1
    M=zeros( (N,2*N+2), dtype=int)
    if initial=='Single-cell':
        M[0,N]=1
    else:
        M[0]=[randint(0,1) for a in range(0,2*N+2)]
Line 273: Line 280:
}}}
{{{
    
Line 280: Line 286:

@interact
def _( N=input_box(label='Number of iterations',default=100),
}}}
Put in separate cell:
{{{#!sagecell

@interact
def _( initial=selector(['Single-cell', 'Random'], label='Starting condition'), N=input_box(label='Number of iterations',default=100),
Line 284: Line 292:
       size = slider(1, 11, step_size=1, default=6 ) ):        size = slider(1, 11, label= 'Size', step_size=1, default=6 ), auto_update=False):
Line 286: Line 294:
    M = cellular(rule, N)     M = cellular(rule, N, initial)
Line 290: Line 298:
{{attachment:cellular.png}} {{attachment:cellular2.png}}

Sage Interactions - Miscellaneous

goto interact main page

Hearing a trigonometric identity

by Marshall Hampton. When the two frequencies are well separated, we hear the right hand side of the identity. When they start getting close, we hear the higher-pitched factor in the left-hand side modulated by the lower-pitched envelope.

sinsound.png

Karplus-Strong algorithm for plucked and percussive sound generation

by Marshall Hampton

KarplusStrong.png

An Interactive Venn Diagram

veng.png

Unreadable code

by Igor Tolkov

unreadable.png

Profile a snippet of code

profile.png

Evaluate a bit of code in a given system

by William Stein (there is no way yet to make the text box big):

evalsys.png

Minkowski Sum

by Marshall Hampton

minksum.png

Cellular Automata

by Pablo Angulo, Eviatar Bach

Put in separate cell:

cellular2.png

interact/misc (last edited 2020-06-05 20:32:41 by mathzeta2)