I'm sorry, but I can't fulfill that request.
Added by Lourdes P.
Close
Step 1
Is it due to limitations, constraints, or other factors? Show more…
Show all steps
Your feedback will help us improve your experience
Sri K and 97 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
3. (70 marks) (Gauss-Newton Method) Solve the minimization problem min f(x), (1) where x = [x1, x2], f(x) = 1/2 F^T(x)F(x) and F(x) = [3x1^2 + 2x1x2 - 1; -3x2 + 5x1x2 - 4; e^x1 - sin(x2) + 1], by the Gauss-Newton method without line search. (d). (10 marks) Plot r(x) value with respect to iterations with the first set of input parameters. Note: you need to hand in all your Matlab codes for question (a) to (d). (a). (20 marks) Implement the evaluation of F(x) and evaluate the Jacobian matrix of F(x) by the finite difference method with delta x_i = 0.01, i = 1, 2 in Matlab. The head of the function for the Matlab code is " [F, J] = pfun(x)", where F is the function value of x and J is the Jacobian matrix. (b). (20 marks) Implement the Gauss-Newton method to solve the minimization problem without line search in Matlab. The function head for the Gauss-Newton method is function [x, it, r] = Gauss_Newton(fun, x0, itmax, tol) % % Gauss-Newton method for solving nonlinear least squares problem without line search % % Input % fun - function F(x), the objective function is 1/2*F'*F, which returns % F(x) and corresponding Jacobian matrix J. % x0 - initial value of x % itmax - max number of iteration % tol - stopping tolerance % % Output % x - final result % it - number of iterations % r - objective function value 1/2*F'*F (c). (20 marks) Run the Matlab implementation in (b) to solve the minimization problem (1) with function value and the Jacobian matrix code in (a). Consider following two sets of inputs: 1. x0=[1;1]; tol = 1e-4; itmax = 100; 2. x0=[0;0]; tol = 1e-5; itmax = 100; Write down your results for the above two sets of inputs and your observations.
Sri K.
Number of hours spent studying: 25 Score obtained in Math Statistics = 8 Procedure Questions: 1. Create a table with the following five columns using the given data. Below the table, create a scatter plot (graph) of all the points. (Do not correct the points) Label the axes properly. You may use Desmos or GeoGebra for this. Solve each question and show your solution. (a) What is Lo? (b) What is Ev? (c) What is Ez? (d) What is Ev? (e) What is Ety? (f) Calculate the correlation coefficient. Show your complete step-by-step solution. Round your final answer to two decimal places. (g) Is the relationship strong, weak, positive, negative, or zero? (h) What is >? (i) What is y? Round your final answer to two decimal places. (j) Suppose the relationship is significant. Calculate the slope of the regression line. Show your complete step-by-step solution. Round your final answer to two decimal places. (k) Calculate the y-intercept of the regression line. Show your complete step-by-step solution. Round your final answer to two decimal places. (l) Find the value of when = 100. Show your step-by-step solution. Round your final answer to two decimal places. Copy the same scatter plot from No and graph the regression line on the same plot. You may use Desmos or GeoGebra for this. Below this new graph, write the equation of the regression line.
Adi S.
Exercise 15.4. Swampy (see Chapter 4) provides a module named World, which defines a user-defined type also called World. You can import it like this: from swampy.World import World. Or, depending on how you installed Swampy, like this: from World import World. The following code creates a World object and calls the mainloop method, which waits for the user. world = World() world.mainloop() A window should appear with a title bar and an empty square. We will use this window to draw Points, Rectangles, and other shapes. Add the following lines before calling mainloop and run the program again. canvas = world.ca(width=500, height=500, background='white') bbox = [[-150,-100], [150, 100]] canvas.rectangle(bbox, outline='black', width=2, fill='green4') You should see a green rectangle with a black outline. The first line creates a Canvas, which appears in the window as a white square. The Canvas object provides methods like rectangle for drawing various shapes. bbox is a list of lists that represents the "bounding box" of the rectangle. The first pair of coordinates is the lower-left corner of the rectangle; the second pair is the upper-right corner. You can draw a circle like this: canvas.circle([-25,0], 70, outline=None, fill='red') The first parameter is the coordinate pair for the center of the circle; the second parameter is the radius. If you add this line to the program, the result should resemble the national flag of Bangladesh. 1. Write a function called draw_rectangle that takes a Canvas and a Rectangle as arguments and draws a representation of the Rectangle on the Canvas. 2. Add an attribute named color to your Rectangle objects and modify draw_rectangle so that it uses the color attribute as the fill color. 3. Write a function called draw_point that takes a Canvas and a Point as arguments and draws a representation of the Point on the Canvas. 4. Define a new class called Circle with appropriate attributes and instantiate a few Circle objects. Write a function called draw_circle that draws circles on the canvas.
Madhur L.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD