Nonlinear equations, Garcia Section 4.3
In nonlinearpractice.m
, find the three roots of this single-variable nonlinear equation.
- Prompt the user for an initial guess.
- Choose a stopping condition (number of iterations, dx smaller than some value)
Can you find all 3 roots?
In nonlinearpractice.m
, find the steady-state solutions to the Lorenz atmospheric model.
- Define the Jacobian matrix
- Set the program to run for 10 iterations.
- Use the following initial guesses: (50,50,50), (2,2,2), (5,5,5), (4,4,15)
- Can you make a 4-subplot figure with the output from each initial guess? (running multiple times with hold on)
A spring with constant k = 500 N/m is attached at the origin and supports a mass m = 5 kg as shown in the image below. The spring has a natural (unstretched) length of L,sub>0 = 1.00 m. The mass experiences three forces:
- Spring force: FS = k(L-L0). The direction of the spring force is nonlinear with respect to the mass position [x y].
- Gravitational force: Wy = mg.
- Horizontal drag force: Dx = 7.5y2, where Dx is in Newtons and y is in meters.
Complete the nlonespring.m program to solve for the equilibrium position of the 5-kg mass. Use the Newton-Raphson method with the following requirements.
- Prompt the user for the initial guess for the equilibrium position [x y] of the mass.
- Update the solution for the equilibrium position using a Newton-Raphson iteration with a while loop.
- End the loop when the update in position is less than 10-6 meters OR after the 10th iteration, whichever comes first.
- Display the equilibrium position and norm(dx) each iteration.
- Demonstrate that the program works, for an initial guess of [x y] = [0.1 -1.1].
Two springs support a mass m = 5 kg as shown in the image below.
- Spring 1 is attached at coordinate (-1,0) and has a spring constant of k1 = 100 N/m.
- Spring 2 is attached at coordinate (1,0) and has a spring constant of k2 = 150 N/m. All coordinate positions are in meters. Both of the springs have a natural (unstretched) length of 1.0 meter.
Complete the nltwospring.m and fspring.m programs to solve for the equilibrium position of the 5-kg mass. Use the Newton-Raphson method with the following requirements:
- Prompt the user for the initial guess for the equilibrium position [x y] of the mass.
- Update the solution for the equilibrium position using a Newton Raphson iteration with a while loop. If preferred, you may find and use the partial derivatives for the forces to create the Jacobian matrix, rather than using numerical derivatives.
- End the loop when the update in position is less than 10-6 meters OR after the 10th iteration, whichever comes first.
- Display the equilibrium position and norm(dx) each iteration.
- Demonstrate that the program works, for an initial guess of [x y] = [1 -1].