Question

In: Advanced Math

Implement the Lorenz-63 model in MATLAB, and solve numerically (using MATLAB’s ode45 or other built-in solver)...

Implement the Lorenz-63 model in MATLAB, and solve numerically (using MATLAB’s ode45 or other built-in solver) for any random, non-zero initial conditions to reproduce, qualitatively, Figures 3 and 4. Note that, as usual, you should label your axes and make the plots as “pretty” as possible.

The model equations are

dx/ dt = σ(y − x),

dy /dt= x(ρ−z)−y,

dz/dt = xy − βz.
Use parameter values σ = 10, ρ = 28, and β = 8/3.

Solutions

Expert Solution

Define function in Matlab as below:

function lorenz

%clear all the pre defined variables and parameters

clear all

%clear screen

clc

%define the time scale

[0 1000];

%define the initial conditions for the lorenz system

x0 = [0.1, 0.1, 0.1];

%call the function as using ode45 method

[T,X] = ode45(@system,[0 100],x0);

%Plot the variables with respect to time

plot(X(:,1),'r','LineWidth',1.5)

hold on

plot(X(:,2),'g','LineWidth',1.5)

hold on

plot(X(:,3),'b','LineWidth',1.5)

%define title and labels of plot

xlabel('Time (t)','FontWeight','bold','fontsize',14) %x-axis label

ylabel('System','FontWeight','bold','fontsize',14) %y-axis label

title('Dynamic Behavior')%title

legend('x','y','z')

%Phase plot

figure

plot(X(:,1),X(:,2),'r','LineWidth',1.5)

%define title and labels of plot

xlabel('x','FontWeight','bold','fontsize',14) %x-axis label

ylabel('y','FontWeight','bold','fontsize',14) %y-axis label

title('x-y Phase Plane')%title

figure

plot(X(:,1),X(:,3),'g','LineWidth',1.5)

%define title and labels of plot

xlabel('x','FontWeight','bold','fontsize',14) %x-axis label

ylabel('z','FontWeight','bold','fontsize',14) %y-axis label

title('x-z Phase Plane')%title

figure

plot(X(:,2),X(:,3),'b','LineWidth',1.5)

%define title and labels of plot

xlabel('y','FontWeight','bold','fontsize',14) %x-axis label

ylabel('z','FontWeight','bold','fontsize',14) %y-axis label

title('y-z Phase Plane')%title

%Plot 3D

figure

plot3(X(:,1),X(:,2),X(:,3),'LineWidth',1.5)

xlabel('x','FontWeight','bold','fontsize',14) %x-axis label

ylabel('y','FontWeight','bold','fontsize',14) %y-axis label

zlabel('z','FontWeight','bold','fontsize',14) %z-axis label

title('3D Lorenz Attractor')%title

%define the model function

%assume x = x1, y = x2 and z = x3

function dx = system(t,x)

dx = zeros(3,1);

%define parametes values for the system

sigma = 10; rho = 28; beta = 8/3;

%ODE system

dx(1) = sigma * x(2) - sigma * x(1);

dx(2) = rho * x(1) - x(1) * x(3) -x(2);

dx(3) = x(1) * x(2) - beta * x(3);

return



Related Solutions

Show to use ode45 built-in function in MATLAB to solve the following ODE problem: dydx=x^2 /...
Show to use ode45 built-in function in MATLAB to solve the following ODE problem: dydx=x^2 / y y(0)=2   Calculate y(x) for 0 ? x ? 20 and compare the results to analytical solution y = sqrt((2x^3 / 3) + 4)
solve an ODE of whatever expression using ode45 in matlab obtaining the result [t,y]. Evaluate the...
solve an ODE of whatever expression using ode45 in matlab obtaining the result [t,y]. Evaluate the solved ODE in a point. Everything should be done in matlab.
Matlab Implement Fading Channel Simulation: Jakes Model with using Matlab
Matlab Implement Fading Channel Simulation: Jakes Model with using Matlab
Write a MATLAB script file to numerically solve any first order initial value problem using Rulers...
Write a MATLAB script file to numerically solve any first order initial value problem using Rulers method. Once code is working use it to solve the mixing tank problem below. Use a step size of 1 minute, and simulate the solution until the tank contains no more salt. Plot both the Euler approximation and the exact solution on the same set of axes. A tank contains 100 gallons of fresh water. At t=0 minutes, a solution containing 1 lb/gal of...
1. Solve the following integer optimization model by using Excel Solver: Maximize Z = 5x1 +...
1. Solve the following integer optimization model by using Excel Solver: Maximize Z = 5x1 + 6x2 Subject to 3x1 + 4x2 < 10 4x1 + 2x2 < 15      x1, x2 > 0 and integer Please show how to use the excel solver as well as steps. :)
solve using both methods (Dsolve and ODE45 on matlab) please provide steps 1) y'+y=e^x 2) y'+2y=...
solve using both methods (Dsolve and ODE45 on matlab) please provide steps 1) y'+y=e^x 2) y'+2y= 2 sin(x)
use a matlab built-in function to numerically solve: dy/dx= -x^2+((x^3*e^-y)/4) for 1<=x<=5 with y(1)=1 plot the...
use a matlab built-in function to numerically solve: dy/dx= -x^2+((x^3*e^-y)/4) for 1<=x<=5 with y(1)=1 plot the solution
2. Use MATLAB (ode45) to solve the second-order Euler-Cauchy ODE given in the thick-walled tube elasticity...
2. Use MATLAB (ode45) to solve the second-order Euler-Cauchy ODE given in the thick-walled tube elasticity problem handout for the case: ?r(1) = 0.1, dur(1)/dr = −0.02 Have your MATLAB code print out the values for the constants you determined in the general solution; i.e. “C1 = ... , C2 = ...” make a comparison plot showing your exact solution and the numerical MATLAB result on the same axes.
Create a Linear Program solver using Matlab or Python. Prompt variable and constraint entry.
Create a Linear Program solver using Matlab or Python. Prompt variable and constraint entry.
4.B Construct an Excel model with solver to solve for the profit maximizing levels of price...
4.B Construct an Excel model with solver to solve for the profit maximizing levels of price and quantity for the profit function, Z = qp - cf - qcv, where cf = 8000, cv = 6, and the demand function for the product is q = 2400 - 24p. Illustrate the solution with a graph of the profit function, showing the profit maximizing price level. For an oligopoly as described in the chapter, construct an Excel model to solve for...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT