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 ox x
x xp x x
xxx Bx
where
xdxdt xdxdt xdxdt
and
o
p
B
Solve the system of ODEs using Matlab's builtin function ode
Interval: t
Initial condition: xt xt xt
set known variables
define start value of t: ts
define end value of t: te
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 d array with entries and
ouptut: the rate of change of x d array with entries
check dxdt function
to do this carry out the following steps
assign the value to a variable called tcheck
assign the values and to a row vector called xcheck
call the function dxdt pass in tcheck and xcheck and store the returned result in dxdtcheck
assign tcheck
assign xcheck
call function dxdt and pass in tcheck and xcheck, store the returned
value in dxdtcheck
set the initial condition
store the initial values for xt xt and xt in a row vector called x
solve ode using ode 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
customize the plot as follows:
switch on grid
swith font size to
set the xaxis label to x
set the yaxis label to x
MATLAB code please
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
