Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Oscillations are common in biological systems. A simple chemical system that

ID: 3747188 • Letter: 1

Question

1. Oscillations are common in biological systems. A simple chemical system that leads to oscillations is given by the following chemical reactions: If the concentrations of A and B are held fixed by external processes, the Law of Mass Action leads to the following form for the dynamics of x and y: dx dt dt where a and b are constants. Write code that uses a semi-implicit Backward Euler to solve this system of equations and find values for a and b such that x and y oscillate in time. Hint: The initial concentrations of x and y need to be close to but not equal to the equilibrium concentrations. Make a plot of x and y as functions of time showing a situation where you get oscillations, and one where the concentrations go to their equilibrium values by the end of the simulation.

Explanation / Answer

mport matplotlib.pyplot as plt v=0.0 #initial velocity h=0.01 #time step x=5.0 #initial position t=0.0 ta,xa=[],[] while t