Question: in python 1. Root finding: Consider the equation x = 1 -e C, where c is a known parameter and x is unknown. This equation
in python
1. Root finding: Consider the equation x = 1 -e C, where c is a known parameter and x is unknown. This equation arises in a variety of situations, including the physics of contact processes, mathematical models of epidemics, and the theory of random graphs. (a) Write a program to solve this equation for x using sci.optimize. fsolve method for the case c = 2. How many solutions exist? Calculate all (non-zero) solutions to an accuracy of at least 10 6. (b) Modify your program to calculate the solution for values of c from 0 to 3 in steps of 0.01 and make a plot of x as a function of c. You should see a clear transition from a regime in which x = 0 to a regime of nonzero x. Briefly discuss the results. This is an example of a phase transition. In physics this transition is known as the percolation transition; in epidemiology it is the epidemic threshold. [10] [10]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
