<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://nemenmanlab.org/~ilya/index.php?action=history&amp;feed=atom&amp;title=Physics_212%2C_2018%3A_Lectures_6</id>
	<title>Physics 212, 2018: Lectures 6 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://nemenmanlab.org/~ilya/index.php?action=history&amp;feed=atom&amp;title=Physics_212%2C_2018%3A_Lectures_6"/>
	<link rel="alternate" type="text/html" href="https://nemenmanlab.org/~ilya/index.php?title=Physics_212,_2018:_Lectures_6&amp;action=history"/>
	<updated>2026-05-17T17:41:47Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>https://nemenmanlab.org/~ilya/index.php?title=Physics_212,_2018:_Lectures_6&amp;diff=725&amp;oldid=prev</id>
		<title>Ilya: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://nemenmanlab.org/~ilya/index.php?title=Physics_212,_2018:_Lectures_6&amp;diff=725&amp;oldid=prev"/>
		<updated>2018-07-04T16:28:45Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 16:28, 4 July 2018&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Ilya</name></author>
		
	</entry>
	<entry>
		<id>https://nemenmanlab.org/~ilya/index.php?title=Physics_212,_2018:_Lectures_6&amp;diff=724&amp;oldid=prev</id>
		<title>nemenman&gt;Ilya at 14:00, 12 February 2018</title>
		<link rel="alternate" type="text/html" href="https://nemenmanlab.org/~ilya/index.php?title=Physics_212,_2018:_Lectures_6&amp;diff=724&amp;oldid=prev"/>
		<updated>2018-02-12T14:00:27Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{PHYS212-2018}}&lt;br /&gt;
&lt;br /&gt;
Here we start a new module, where we will explore how to model and solve dynamical systems in more detail. In this lecture we discussed a few important concepts in programming, some specific to Python, and some not. &lt;br /&gt;
&lt;br /&gt;
# We will discuss the importance of encapsulating the code that you use repeatedly into either a script or a function.&lt;br /&gt;
# We will discuss the difference between scripts (no inputs and no outputs) and functions (have inputs and outputs). &lt;br /&gt;
# We will focus on book section 6.1 -- Writing your own functions, and we wrote our first functions -- various growth rates for bacterial growth and solvers of the corresponding differential equations.&lt;br /&gt;
# We will start talking about variable types, and importance of type checking, and how Python figures out which type is a variable that has been passed to a function; we will return to this later. &lt;br /&gt;
# We will write our own loadable modules, and will discuss the importance of using the reload function.&lt;br /&gt;
# Finally, we will discuss some common coding mistakes that we all do when working with python, and specifically:&lt;br /&gt;
## Appending list or arrays instead of pre-allocating arrays -- appending arrays causes creation of new arrays, and then copying numbers, which takes time.&lt;br /&gt;
## Doing loops instead of vectorizing your math and operating on arrays -- doing loops causes Python to do type checking of variables at every step of the way, which is costly.&lt;br /&gt;
&lt;br /&gt;
Coding problem for you was: write a function to solve a quadratic equation, and think about how to make it bullet-proof, and give solutions gene if they are complex, or if they are degenerate. [https://docs.google.com/forms/d/e/1FAIpQLSeNvrPddCgvMfHdlSA8uYDddBFqLK81Rrr4l7jfozud6J7iww/viewform submit your work].&lt;br /&gt;
&lt;br /&gt;
:Scripts for this Module:&lt;br /&gt;
::[[media:growthfunctions.py | GrowthFunctions]] -- module defining different growth functions.&lt;br /&gt;
::[[media:Integrators_v2.txt | Integrators]] -- module defining different integrators (Euler and Runge-Kutta second order).&lt;br /&gt;
::[[media:Module2_v2.txt | Module 2]] -- catch-all scripts I used during the class.&lt;/div&gt;</summary>
		<author><name>nemenman&gt;Ilya</name></author>
		
	</entry>
</feed>