Consider the following nonlinear second order ODESolutionThe

Consider the following non-linear second order ODE:

Solution

The question asked implicitly require programming a code to solve for RK1 and RK2 with a variable h. once the student has completed above ( assuming that student has done so already as the question does not ask that) following to be followed :

1. student is required to write a program which takes values of RK1 and RK2 at t=70 for different values h as input and gives an approximate curve such that it provides an function stated above ( giving values of C and p as an output). following is such a code to provide with a way to solve this problem .

-------------------------------------------------------------------------------------------------------------------------------------------------------

clc;
close all;
clear all;

x = [ 1/5.0 1/10.0 1/20.0 1/30.0 1/40.0] ; % independent variable quantities
y = [ 1.519/1000 1.311/1000 1.02/1000 .811/1000 .6529/1000] ; % dependent variable quantities
Y = log(y);
X = x;

s_X = sum(X);
s_Y = sum(Y);

s_X_2 = sum(X.^2);
s_XY = sum(X.*Y);

N = length(X) ;
B = (s_XY-(s_X_2*(s_Y/s_X)))/(s_X-(s_X_2*N/s_X)) ;
A = (s_Y - N*B)/s_X;
C = exp(B);

syms xx yy

yy = C*exp(A/xx);


figure
hold on
plot([0,5,10,20,30,40],[1.7871/1000 1.519/1000 1.311/1000 1.02/1000 .811/1000 .6529/1000],\'kh\')
ezplot(yy,[0,40])

---------------------------------------------------------------------------------------------------------------------------------------------------------

above code is merely for understanding and proper implementation.

2. in order to verify the above answer student is required to take up any value of h and ccalculate values of e using numerical method provided in question and the function which is output of the matlab program refered in para(1) of This answer.

Consider the following non-linear second order ODE:SolutionThe question asked implicitly require programming a code to solve for RK1 and RK2 with a variable h.

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site