subject

Golden Section Search Complete the code doing Golden Section Search for function minimization below. Stop the iteration when your bracket is less than 10-8 wide. You must be sure that you evaluate the objective function only as many times as necessary, and the autograder will check for this. The supplied plotting code shows the evolution of your brackets. Observe how one of the bracket midpoints stays the same from one iteration to the next. The setup code gives the following variables: Name Type f func(float) Description A unimodal function to minimize left end of starting bracket right end of starting bracket a float b float Your code snippet should define the following variables: Name Type a float Description left end of final bracket right end of final bracket b float * 1 import numpy as np 2 import matplotlib. pyplot as plt 3 4 brackets = [] 5 gs = (np. sqrt(5) - 1) / 2 6 m1 = a + (1 - gs) * (b - a) 7 m2 = a + gs (b - a) 8 9 # Begin your modifications below here 10 11. while False: 12 brackets. append([a, mi, m2, b]) 13 14 # End your modifications above here 15 16 # Plotting code below, no need to modify 17 x = np. linspace(-10, 10) 18 plt. plot(x, f(x)) 19 20 brackets = np. array(brackets) 21 names=['a', 'ml', 'm2', 'b'] 22, for i in range(4): 23 plt. plot(brackets[:, i], 3*np. arange(len(brackets)), '.-', label=names[i]) 24 plt. legend)

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:20
The open systems interconnection (osi) reference model: defines standards for many aspects of computing and communications within a network. is a generic description for how computers use multiple layers of protocol rules to communicate across a network. defines standards for wireless local area network (wlan) communication protocols. details the advantages and disadvantages of various basic network cabling options.
Answers: 1
question
Computers and Technology, 23.06.2019 04:40
The narrative structure of the popular movies can be broken down into
Answers: 3
question
Computers and Technology, 23.06.2019 12:10
2. fabulously fit offers memberships for$35 per month plus a $50 enrollmentfee. the fitness studio offersmemberships for $40 per month plus a$35 enrollment fee. in how many monthswill the fitness clubs cost the same? what will the cost be?
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
You know the right answer?
Golden Section Search Complete the code doing Golden Section Search for function minimization below....
Questions
question
Mathematics, 20.09.2020 01:01
question
Social Studies, 20.09.2020 01:01
question
Mathematics, 20.09.2020 01:01
Questions on the website: 13722363