Question: Consider the system of first order nonlinear ODEs called the Lorenz equations: x ` _ 1 = o ( x _ 2 - x _

Consider the system of first order nonlinear ODEs called the Lorenz equations:
x`_1= o(x_2- x_1)
x`_2= x_1(p - x_3)- x_2
x`_3=(x_1)(x_2)- B(x_3)
where
x`_1=[dx_1/dt], x`_2=[dx_2/dt], x`_3=[dx_3/dt]
and
o =10
p =28
B =8/3
Solve the system of ODEs using Matlab's built-in function ode45
Interval: 0<= t <=50
Initial condition: x_1(t =0)=1, x_2(t =0)=1, x_3(t =0)=2.
set known variables
define start value of t: t_s
define end value of t: t_e
assign value to sigma
assign value to rho
assign value to beta
define ode function to update solution
define an anonymous function (function handle) with the following properties
name: dxdt
inputs: t (scalar) and x (1d array with 3 entries) and
ouptut: the rate of change of x (1d array with 3 entries)
check dxdt function
to do this carry out the following steps
- assign the value 1 to a variable called t_check
- assign the values 1,2 and 3 to a row vector called x_check
- call the function dxdt, pass in t_check and x_check and store the returned result in dxdt_check
assign t_check
assign x_check
call function dxdt and pass in t_check and x_check, store the returned
value in dxdt_check
set the initial condition
store the initial values for x_1(t =0), x_2(t =0) and x_3(t=0) in a row vector called x0
solve ode using ode45 store the returned solution in t and x
plot results
plot the values of the third column of x over the first column of x as a solid red line with the line width 4
customize the plot as follows:
- switch on grid
- swith font size to 20
- set the x-axis label to 'x_1'
- set the y-axis label to 'x_3'
MATLAB code please

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!