Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8e3191b
Title name of notebook added
aditya3012 Nov 29, 2016
21975d3
Creative commons copyright added
aditya3012 Nov 29, 2016
0ae101f
Custom style file added
aditya3012 Nov 30, 2016
5a34743
style file
aditya3012 Nov 30, 2016
a744370
Style file tweaked and finalized
aditya3012 Nov 30, 2016
c5619f1
Introduction to PDEs
aditya3012 Dec 3, 2016
4958fe2
Hyperlinks added
aditya3012 Dec 4, 2016
da16e88
Figure 1 added
aditya3012 Dec 6, 2016
ba245a6
End of PDE introduction
aditya3012 Dec 6, 2016
ac0e9f1
Updated:Fields in which KPP is used
aditya3012 Dec 7, 2016
259c553
Equation that will be solved is specified
aditya3012 Dec 7, 2016
9d0b393
Libraries added
aditya3012 Dec 7, 2016
6a394ce
Added parameteres, IC for case one and references
aditya3012 Dec 8, 2016
4c5723f
Started to write a function to solve Fisher equastion
aditya3012 Dec 8, 2016
47a37d9
Function Catchthefisher written, debugging started
aditya3012 Dec 8, 2016
96ba690
Got that first plot. Hurray
aditya3012 Dec 8, 2016
98a5ed6
Animate done - 1 front travelling wave
aditya3012 Dec 8, 2016
f494515
Created a .py file that can animate the plot and save space on the ac…
aditya3012 Dec 9, 2016
2c0a2ec
Found an efficient and space saving way to call the function muhahah
aditya3012 Dec 9, 2016
e6ffe56
subplots added
aditya3012 Dec 11, 2016
189b2ac
Thank you Tingyu for solving my git error. New updates to project inc…
aditya3012 Dec 12, 2016
d6cb77b
Created a .py file for subplots
aditya3012 Dec 12, 2016
3fc88df
Started writing, uploaded .py file and new ipynb notebook from my hom…
aditya3012 Dec 13, 2016
ba9a4b3
Animation worked
aditya3012 Dec 13, 2016
8f67cdf
Final write-up started, with refereces and no plots it is at 5 pages
aditya3012 Dec 13, 2016
eda92c1
Animations work and they take 16 mins to load but worth it
aditya3012 Dec 14, 2016
c2a425b
Finally done with everything
aditya3012 Dec 14, 2016
25eb279
Final push and pdf added which confirms that project without plots is…
aditya3012 Dec 14, 2016
a87131f
Final final push! Both animations take 12-15 mins to load together bu…
aditya3012 Dec 14, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,218 changes: 4,218 additions & 0 deletions aditya3012/.ipynb_checkpoints/TheMagicOfFisherKPP -checkpoint.ipynb

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions aditya3012/Animate_func.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import numpy
from matplotlib import pyplot
import math
from matplotlib import rcParams
rcParams['font.family'] = 'serif'
rcParams['font.size'] =16
from matplotlib import animation
from IPython.display import HTML


nx =201
dx =0.2
nt= 300
x = numpy.linspace(0,10,nx)
D =1
alpha = 1

u= numpy.zeros(nx)
lbound = numpy.where(x <= 1)
ubound = numpy.where(x >= 0)
bounds = numpy.intersect1d(lbound, ubound)
u[bounds]=1

fig = pyplot.figure(figsize=(8,6))
ax = pyplot.axes(xlim=(0,10),ylim=(0,1.5))
ax.set_xlabel('$x$')
ax.set_ylabel('$u$')
#ax.text(0,-0.25,'See how the curve levels off at u =1',color='red')
ax.annotate('See how the curve',color='black',wrap= True, xy=(7,1),xytext=(3,1.3))
ax.annotate('levels off at u =1',color='black',wrap= True,xy=(7,1),xytext=(3,1.2),arrowprops =dict(facecolor='black', shrink =0.04))
line = ax.plot([],[],color='c',ls=':',lw=3)[0]



def CatchtheFisherwaveanimate(n):
dt =0.0003
un= numpy.zeros_like(u)
ax.text(6,0.3,'Absence of gene',color='green')
ax.fill_between(x,un,1.5, color='aqua')
ax.fill_between(x,u,0, color='green')
for n in range (nt):
un= numpy.copy(u)
u[1:-1] = un[1:-1] \
+ D * dt/dx**2 * (un[2:] - 2*un[1:-1] + un[0:-2]) \
+ alpha * un[1:-1] * dt * (1 - un[1:-1])
u[0] = u[1]
u[-1] = u[-2]
line.set_data(x,u)

anim = animation.FuncAnimation(fig,CatchtheFisherwaveanimate,\
frames=nt,interval=60)
45 changes: 45 additions & 0 deletions aditya3012/Animate_mutantgene.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import numpy
from matplotlib import pyplot
import math
from matplotlib import rcParams
rcParams['font.family'] = 'serif'
rcParams['font.size'] =16
from matplotlib import animation
from IPython.display import HTML


nx =200
dx =0.1
nt= 350
x = numpy.linspace(-10,10,nx)
D =1
alpha = 1

u = numpy.zeros(nx)
lbound = numpy.where(x >= -2)
ubound = numpy.where(x <= 2)
bounds = numpy.intersect1d(lbound, ubound)
u[bounds]=0.01

fig = pyplot.figure(figsize=(8,6))
ax = pyplot.axes(xlim=(-10,10),ylim=(0,1.5))
ax.set_xlabel('$x$')
ax.set_ylabel('$u$')
#ax.text(0,-0.25,'See how the curve levels off at u =1',color='red')
line = ax.plot([],[],color='c',ls=':',lw=3)[0]

def CatchtheFisherwaveanimate(n):
dt =0.0001
un= numpy.zeros_like(u)
ax.fill_between(x,u,0,interpolate=True, color='blue')
ax.text(-2.5,.8,'Sickle cell gene',color='white')
for n in range (nt):
un= numpy.copy(u)
u[1:-1] = un[1:-1] \
+ D * dt/dx**2 * (un[2:] - 2*un[1:-1] + un[0:-2]) \
+ alpha * un[1:-1] * dt * (1 - un[1:-1])
u[0] = u[1]
u[-1] = u[-2]
line.set_data(x,u)
anim = animation.FuncAnimation(fig,CatchtheFisherwaveanimate,\
frames=nt,interval=50)
Binary file added aditya3012/PDF_5pageconfirmation.pdf
Binary file not shown.
4,218 changes: 4,218 additions & 0 deletions aditya3012/TheMagicOfFisherKPP .ipynb

Large diffs are not rendered by default.

Binary file not shown.
152 changes: 152 additions & 0 deletions aditya3012/numericalmoocstyle.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
<link href='http://fonts.googleapis.com/css?family=Alegreya+Sans:100,300,400,500,700,800,900,100italic,300italic,400italic,500italic,700italic,800italic,900italic' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Arvo:400,700,400italic' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=PT+Mono' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Shadows+Into+Light' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Nixie+One' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro' rel='stylesheet' type='text/css'>
<style>

@font-face {
font-family: "Computer Modern";
src: url('http://mirrors.ctan.org/fonts/cm-unicode/fonts/otf/cmunss.otf');
}

#notebook_panel { /* main background */
background: rgb(245,245,245);
}

div.cell { /* set cell width */
width: 750px;
}

div #notebook { /* centre the content */
background: #fff; /* white background for content */
width: 1000px;
margin: auto;
padding-left: 0em;
}

#notebook li { /* More space between bullet points */
margin-top:0.8em;
}

/* draw border around running cells */
div.cell.border-box-sizing.code_cell.running {
border: 1px solid #111;
}

/* Put a solid color box around each cell and its output, visually linking them*/
div.cell.code_cell {
background-color: rgb(256,256,256);
border-radius: 0px;
padding: 0.5em;
margin-left:1em;
margin-top: 1em;
}

div.text_cell_render{
font-family: 'Alegreya Sans' sans-serif;
line-height: 140%;
font-size: 125%;
font-weight: 400;
width:600px;
margin-left:auto;
margin-right:auto;
}


/* Formatting for header cells */
.text_cell_render h1 {
font-family: 'Nixie One', serif;
font-style:regular;
font-weight: 400;
font-size: 45pt;
line-height: 100%;
color: rgb(0,51,102);
margin-bottom: 0.5em;
margin-top: 0.5em;
display: block;
}

.text_cell_render h2 {
font-family: 'Nixie One', serif;
font-weight: 400;
font-size: 30pt;
line-height: 100%;
color: rgb(0,51,102);
margin-bottom: 0.1em;
margin-top: 0.3em;
display: block;
}

.text_cell_render h3 {
font-family: 'Nixie One', serif;
margin-top:16px;
font-size: 22pt;
font-weight: 600;
margin-bottom: 3px;
font-style: regular;
color: rgb(102,102,0);
}

.text_cell_render h4 { /*Use this for captions*/
font-family: 'Nixie One', serif;
font-size: 14pt;
text-align: center;
margin-top: 0em;
margin-bottom: 2em;
font-style: regular;
}

.text_cell_render h5 { /*Use this for small titles*/
font-family: 'Nixie One', sans-serif;
font-weight: 400;
font-size: 16pt;
color: rgb(163,0,0);
font-style: italic;
margin-bottom: .1em;
margin-top: 0.8em;
display: block;
}

.text_cell_render h6 { /*use this for copyright note*/
font-family: 'PT Mono', sans-serif;
font-weight: 300;
font-size: 9pt;
line-height: 100%;
color: grey;
margin-bottom: 1px;
margin-top: 1px;
}

.CodeMirror{
font-family: "Source Code Pro";
font-size: 90%;
}

.alert-box {
padding:10px 10px 10px 36px;
margin:5px;
}

.success {
color:#666600;
background:rgb(240,242,229);
}
</style>
<script>
MathJax.Hub.Config({
TeX: {
extensions: ["AMSmath.js"],
equationNumbers: { autoNumber: "AMS", useLabelIds: true}
},
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
},
displayAlign: 'center', // Change this to 'center' to center equations.
"HTML-CSS": {
styles: {'.MathJax_Display': {"margin": 4}}
}
});
</script>
Loading