Solve the following problems by writing a piece of code in a programming languag
ID: 673683 • Letter: S
Question
Solve the following problems by writing a piece of code in a programming language of your choice. Lorenz derived a simple system of ordinary differential equations describing buoyant convection in a fluid as a crude model for atmospheric circulation. At steady state, the convective velocity x, temperature gradient y, and beat flow z satify the system of nonlinear equations sigma(y - x) = 0 rx - y - xz =0 xy - bz = 0 where sigma (the Prandtl number), r (the Rayleigh number), and b are positive constants that depend on the properties of the fluid, the applied temprature gradient, and the geometry of the problem. Typical values Lorenz used are sigma = 10, r = 28 and b = 8/3. Write a program using Newton's method to solve this system of equations for x, y and z. Take as the starting values (1, 1, 1), (6, 6, 27) and (-6, -6, 27) to obtain the three solutions respectively of the above system.Explanation / Answer
Here is the matlab function to solve above equations....
%matlab code
function xprime= lorenz(t,v)
%initializing parametres
alpha = 10;
r = 28;
b = 8/3;
% we are passing intital vectors as [1 1 1]..as per in the question given
x=v(1); %1
y=v(2); %1
z=v(3); %1
%here is our linear equation
xprime=[alpha*(y-x); r*x - y - x*z; x*y - b*z; ];
-----------------------------------------------------------------------------------------------
I initalised vector manually as (1,1,1) ..as it is first set given in question itself ...you can modify to calculate values for different sets of vectors.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.