Explore BrainMass
Share

MATLAB (Must be scripted in MATLAB)

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

I need a detailed script in order to show this works in MATLAB.

On this page the only problem I need it #26 (the circled problem with the Taylor expansion).

Thank-you for your excellent help.

© BrainMass Inc. brainmass.com October 24, 2018, 8:59 pm ad1c9bdddf
https://brainmass.com/computer-science/matlab/matlab-scripted-matlab-113448

Attachments

Solution Summary

The expert provides MATLAB scripts for functions.

$2.19
See Also This Related BrainMass Solution

Matlab for Lorenz equations with Gauss Seidel iteration

Hello

I am taking a numerical methods class and I have limited Matlab skills to be able to complete this problem by myself.

The problem is to linearize the Lorenz equations and then to write a Matlab program without using any built in Matlab solvers such as ODE45, etc. to create the Lorenz butterfly using linearized Lorenz equations with Gauss-Seidel iteration.

I have the linearized Lorenz equations, constants, stopping criteria and initial conditions here:

stopping criteria: 1.e-6
initial conditions: x = 2, y = 2, z = 4
sigma = 10, rho = 28, beta = 8/3
delta_t = 1.e-4

linearized lorenz equations:

x^n+1 - x^n = delta_t * sigma*(y^n+1 - x^n+1)
[please rewrite so equation begins x^n+1 = ...]

y^n+1 = (1 + delta_t*x^n+1*(rho - z^n+1)/(1 + delta_t)

z^n+1 = (1 + delta_t * x^n+1 * y^n+1)/(1 + beta * delta_t)

The code MUST only use Gauss-Seidel iteration to run the iterations (no RK2 or other methods). The code may not use any built in Matlab functions or solvers or matrices to store answers. It needs to tell how much CPU time was used (incorporate tic toc?) What was also suggested was to use a file to dump all results to while the iterations run, making the program run faster. With the results of the iterations a 3D plot needs to be plotted to show the Lorenz butterfly (attractor) using delta_t = 1.e-4. Then a second plot needs to be created that shows the x on the vertical axis and t on the horizontal axis plotting both delta_t = 1.e-4 and delta_t = 1.e-5 so you can see how a slight variation in delta_t causes the two lines to depart after a short while

View Full Posting Details