Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help with Part c of the python HW. Already have found a way to rearrange them by hand but I need to find a way

Help with Part c of the python HW.

Already have found a way to rearrange them by hand but I need to find a way to rearrange them through python:

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed
Different way to reamange them i's As we have - ntay thy = o 2 be ay - My = o subtracting ay term both side of 1 we get - n taythy- aly = - ay - ntly = - ay Substitute this value of - ay = - rethy in eq ? we get b - x + wy - by = o n = b CS Putting this value of nab in CD we get - b + ay + by = o b = autby = yExercise 6.12 The biochemical process of glycolysis, the breakdown of glucose in the body to release energy, can be modeled by the equations dx = -xtay+xy. " = b- ay - xy. Here x and y represent concentrations of two chemicals, ADP and F6P, and a and b are positive constants. One of the important features of nonlinear linear equations like these is their stationary points, meaning values of x and y at which the derivatives of both variables become zero simultaneously, so that the variables stop changing and become constant in time. Setting the derivatives to zero above, the stationary points of our glycolysis equations are solutions of -xtay+xy=0, b-ay-xy=0. a) Demonstrate analytically that the solution of these equations is x =b. a+ 62 Ex 6.12 ) 6 (given equations are : J. = bay - xly () For Stufaning points , 0 - otay + * yco be ay- my ca ayt xy =* b = al + aly y ( atx 2 ) = * b=y (at * * ) (2) to Sub MT. D bzy (atz z ) y = bb) Show that the equations can be rearranged to read x = ya+x), b y = atx- and write a program to solve these for the stationary point using the relaxation method with a = 1 and b = 2. You should find that the method fails to converge to a solution in this case. b) Show that can berearranged as or = y ( at x 2 ) y= b Atz bay - myED 1 = y ( atx ' ) b = y ( at x 2 ) yz b ( h TX ' )In [4]: import numpy as np #Define the 2 functions here: # note to self: a=1, b=2 #this function is the 2nd equation in the handwritten eqs above: def f(x) : return 2/1+(x*x) #this function is the Ist equation but with y isolated to solve interms of y: def f2 (x) : return x/1+(x*x) #Define the initial conditions for the relaxation method for function 1: *=100 i=1 target=0 #While Loop that tries to find the stationary point for the first function: while (abs(f (x) -x)>target) : print (i, x, f(x), abs(f(x)-x)) x=f(x) i+=1 #Define the initial conditions for the relaxation method for function 2: x=100 i=1 target=0 #While Loop that tries to find the stationary point: while (abs(f2(x) -x)>target) : print (i, x, f2(x), abs(f2(x)-x)) *=f2(x) i+=1 print ('Hence Equations Fails to converge' ) 1 100 10002.0 9902.0 2 10002.6 100040006.0 100030004.0 3 109040006. 0 1. 0008002800480038e+16 1.0008002760440032e+16 4 1. 0608002800480038e+16 1.0016012005441628e+32 1. 0016012005441626e+32 5 1. 0016012005441628e+32 1. 0032049649315081e+64 1.0032049649315081e+64 6 1. 0032049649315081e+64 1. 0064202016632285e+128 1.0064202016632285e+128 7 1. 0064202016632285e+128 1. 0128816223158535e+256 1.0128816223158535e+256 8 1. 0128816223158535e+256 inf inf 1 100 10100.0 10090.0 2 10160.0 102020160.0 102010060.0 3 102020100.0 1. 04081009060301e+16 1.040810080401e+16 4 1. 04081009060301e+16 1.083285644701046e+32 1. 0832856447010458e+32 5 1. 083285644701046e+32 1. 1735077880153609e+64 1.1735077880153609e+64 6 1. 1735077880153609e+64 1.3771205285327051e+128 1.3771205285327051e+128 7 1.3771205285327051e+128 1. 896460950106197e+256 1.896460950106197e+256 8 1. 896460950106197e+256 inf inf Hence Equations Fails to convergec} Find a different way to rearrange the equations such that when you apply the relaxation method again it new converges to a xed point and gives a solution. Verify that the solution you get agrees with part {a}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Electrodynamics

Authors: David J. Griffiths

3rd Edition

978-0138053260, 013805326X, 8120316010, 978-8120316010

More Books

Students also viewed these Physics questions

Question

Write a Python program to check an input number is prime or not.

Answered: 1 week ago

Question

Write a program to check an input year is leap or not.

Answered: 1 week ago

Question

Write short notes on departmentation.

Answered: 1 week ago

Question

What are the factors affecting organisation structure?

Answered: 1 week ago