Search
- Filter Results
- Location
- Classification
- Include attachments
- https://eng.libretexts.org/Bookshelves/Computer_Science/Applied_Programming/Think_Complexity%3A_Exploring_Complexity_Science_with_Python_(Downey)/06%3A_Game_of_Life/6.06%3A_Implementing_LifeEach time through the loop, state is the condition of the center cell and neighbors is the 3x3 neighborhood. What we called a “window” in the context of 1-D correlation is called a “kernel” in the con...Each time through the loop, state is the condition of the center cell and neighbors is the 3x3 neighborhood. What we called a “window” in the context of 1-D correlation is called a “kernel” in the context of 2-D correlation, but the idea is the same: correlate2d multiplies the kernel and the array to select a neighborhood, then adds up the result. If the center cell is 0, the result is between 0 and 8; if the center cell is 1, the result is between 10 and 18.
- https://eng.libretexts.org/Bookshelves/Computer_Science/Applied_Programming/Think_Complexity%3A_Exploring_Complexity_Science_with_Python_(Downey)/05%3A_Cellular_Automatons/5.13%3A_ExercisesNote that the Cell1D class provides start_string, which allows you to initialize the state of the array using a string of 1s and 0s. Write a class named TuringViewer that generates an image that repre...Note that the Cell1D class provides start_string, which allows you to initialize the state of the array using a string of 1s and 0s. Write a class named TuringViewer that generates an image that represents the state of the tape and the position and state of the head. Implement a Rule 30 CA with a few hundred cells, run it for as many time steps as you can in a reasonable amount of time, and output the center column as a sequence of bits.
- https://eng.libretexts.org/Bookshelves/Computer_Science/Applied_Programming/Think_Complexity%3A_Exploring_Complexity_Science_with_Python_(Downey)/09%3A_Agent-based_models/9.03%3A_SegregationFigure \(\PageIndex{1}\) shows the initial configuration (left), the state of the simulation after 2 steps (middle), and the state after 10 steps (right). As the simulation runs, we can compute the de...Figure \(\PageIndex{1}\) shows the initial configuration (left), the state of the simulation after 2 steps (middle), and the state after 10 steps (right). As the simulation runs, we can compute the degree of segregation, which is the average, across agents, of the fraction of neighbors who are the same color as the agent: In Figure \(\PageIndex{1}\), the average fraction of similar neighbors is 50% in the initial configuration, 65% after two steps, and 76% after 10 steps!
- https://eng.libretexts.org/Bookshelves/Computer_Science/Applied_Programming/Think_Complexity%3A_Exploring_Complexity_Science_with_Python_(Downey)/00%3A_Front_Matter/04%3A_0%3A_Preface/1.01%3A_Who_is_this_book_forThe examples and supporting code for this book are in Python. If you are not already familiar with Python, you might want to start with Think Python, which is appropriate for people who have never pro...The examples and supporting code for this book are in Python. If you are not already familiar with Python, you might want to start with Think Python, which is appropriate for people who have never programmed before. If you have programming experience in another language, there are many good Python books to choose from, as well as online resources. If you are familiar with these libraries already, that’s great, but I will also explain them when they appear.
- https://eng.libretexts.org/Courses/Arkansas_Tech_University/Engineering_Modeling_and_Analysis_with_Python/11%3A_Libraries/11.01%3A_NumPy_-_Numerical_PythonThis page discusses NumPy, a vital Python library for scientific computing that supports multi-dimensional arrays and offers various mathematical functions. It highlights features like broadcasting, i...This page discusses NumPy, a vital Python library for scientific computing that supports multi-dimensional arrays and offers various mathematical functions. It highlights features like broadcasting, interactions with other libraries, and performance owed to its C/C++ core.
- https://eng.libretexts.org/Courses/Arkansas_Tech_University/Engineering_Modeling_and_Analysis_with_Python/14%3A_Linear_Algebra_Equations/14.02%3A_Well-Determined_Fully_Specified_SystemThis page covers solving well-determined N-th order linear systems using Python's NumPy library, emphasizing the use of the numpy.linalg.solve() function for both non-singular and singular systems. It...This page covers solving well-determined N-th order linear systems using Python's NumPy library, emphasizing the use of the numpy.linalg.solve() function for both non-singular and singular systems. It explains well-determined systems (with equal equations and variables) and how to handle situations with singular matrices (determinant of zero) that result in no unique solutions.
- https://eng.libretexts.org/Bookshelves/Introductory_Engineering/EGR_1010%3A_Introduction_to_Engineering_for_Engineers_and_Scientists/19%3A_Using_Computers_for_Engineering_and_Science/19.01%3A_Engineering_and_Science_LanguagesThis is a review of some of the basic analysis techniques. It is not intended to be complete for all engineering, it is just a start.
- https://eng.libretexts.org/Bookshelves/Computer_Science/Applied_Programming/Think_Complexity%3A_Exploring_Complexity_Science_with_Python_(Downey)/03%3A_Small_World_Graphs/3.05%3A_ClusteringThe next step is to compute the clustering coefficient, which quantifies the tendency for the nodes to form cliques. If a node has fewer than 2 neighbors, the clustering coefficient is undefined, so w...The next step is to compute the clustering coefficient, which quantifies the tendency for the nodes to form cliques. If a node has fewer than 2 neighbors, the clustering coefficient is undefined, so we return np.nan, which is a special value that indicates “Not a Number”. Otherwise we compute the number of possible edges among the neighbors, count the number of those edges that actually exist, and return the fraction that exist.
- https://eng.libretexts.org/Bookshelves/Computer_Science/Applied_Programming/Think_Complexity%3A_Exploring_Complexity_Science_with_Python_(Downey)/07%3A_Physical_modeling/7.02%3A_Reaction-diffusionThe arrays cA and cB are the result of applying a diffusion kernel to A and B. The term A * B**2 represents the rate that A and B react with each other. Assuming that the reaction consumes A and produ...The arrays cA and cB are the result of applying a diffusion kernel to A and B. The term A * B**2 represents the rate that A and B react with each other. Assuming that the reaction consumes A and produces B, we subtract this term in the first equation and add it in the second. As long as the rate parameters are not too high, the values of A and B usually stay between 0 and 1. With these parameters, the system evolves toward a stable configuration with light spots of A on a dark background of B.
- https://eng.libretexts.org/Bookshelves/Computer_Science/Applied_Programming/Think_Complexity%3A_Exploring_Complexity_Science_with_Python_(Downey)/12%3A_Evolution_of_cooperation/12.07%3A_ResultsThe rest of the simulation is highly variable, but with the exception of one big drop, mean fitness is usually between 2 and 3, with the long-term mean close to 2.5. Retaliating compares the number of...The rest of the simulation is highly variable, but with the exception of one big drop, mean fitness is usually between 2 and 3, with the long-term mean close to 2.5. Retaliating compares the number of elements in all genomes where an agent defects after the opponent defects (elements 2, 4, and 6) with the number of places where an agents defects after the opponent cooperates.
- https://eng.libretexts.org/Bookshelves/Computer_Science/Applied_Programming/Think_Complexity%3A_Exploring_Complexity_Science_with_Python_(Downey)/10%3A_Herds_Flocks_and_Traffic_Jams/10.04%3A_The_Boid_algorithmBoids7.py defines two classes: Boid, which implements the Boid behaviors, and World, which contains a list of Boids and a “carrot” the Boids are attracted to. The parameters radius and angle are the r...Boids7.py defines two classes: Boid, which implements the Boid behaviors, and World, which contains a list of Boids and a “carrot” the Boids are attracted to. The parameters radius and angle are the radius and angle of the field of view, which determines which other Boids are taken into consideration. diff_angle computes the angle between the velocity of self, which points in the direction the Boid is heading, and the position of boid.

