when solving Gilmore equation using ode45 , the answer comes as zero and it plots a straight line in the time interval

6 views (last 30 days)
clc
clear all
close all
%
q_0 = 998;
C_0 = 1484; %changes did 8000
r = 6.5; %changes did 6.5
mu = 0.001;
sigma = 0.072;
p_0 = 101;
R_0 = 61;%0.000061;
m = 0.11;
k = 0;
b = 1/(q_0 * (C_0)^2);
B = ((b*r - p_0))^(-1);
syms R(t)
eqn = (1- (diff(R(t),t)/(sqrt(C_0^2 + (r-1)*(((b*r)^(-1/r))/q_0)*(r/r-1)*(((p_0 + 2*sigma/R_0)* ((R_0^3 - m* R_0^3)/(R^3 - m* R_0^3))^k - (4*mu*diff(R,1)/R) - 2*sigma/R - B)^(1- 1/r) - (p_0 + B)^(1- 1/r))))))*R* diff(R(t),t,t) + (3/2)*(1- (diff(R(t),t)/(3*(sqrt(C_0^2 + (r-1)*(((b*r)^(-1/r))/q_0)*(r/r-1)*(((p_0 + 2*sigma/R_0)* ((R_0^3 - m* R_0^3)/(R^3 - m* R_0^3))^k - (4*mu*diff(R,1)/R) - 2*sigma/R - B)^(1- 1/r) - (p_0 + B)^(1- 1/r)))))))*((diff(R(t),t))^2) == (1+ (diff(R(t),t)/(sqrt(C_0^2 + (r-1)*(((b*r)^(-1/r))/q_0)*(r/r-1)*(((p_0 + 2*sigma/R_0)* ((R_0^3 - m* R_0^3)/(R^3 - m* R_0^3))^k - (4*mu*diff(R,1)/R) - 2*sigma/R - B)^(1- 1/r) - (p_0 + B)^(1- 1/r))))))*((((b*r)^(-1/r))/q_0)*(r/r-1)*(((p_0 + 2*sigma/R_0)* ((R_0^3 - m* R_0^3)/(R^3 - m* R_0^3))^k - (4*mu*diff(R,1)/R) - 2*sigma/R - B)^(1- 1/r) - (p_0 + B)^(1- 1/r))) + (1- (diff(R(t),t)/(sqrt(C_0^2 + (r-1)*(((b*r)^(-1/r))/q_0)*(r/r-1)*(((p_0 + 2*sigma/R_0)* ((R_0^3 - m* R_0^3)/(R^3 - m* R_0^3))^k - (4*mu*diff(R,1)/R) - 2*sigma/R - B)^(1- 1/r) - (p_0 + B)^(1- 1/r))))))*(R/(sqrt(C_0^2 + (r-1)*(((b*r)^(-1/r))/q_0)*(r/r-1)*(((p_0 + 2*sigma/R_0)* ((R_0^3 - m* R_0^3)/(R^3 - m* R_0^3))^k - (4*mu*diff(R,1)/R) - 2*sigma/R - B)^(1- 1/r) - (p_0 + B)^(1- 1/r)))))* (((b*r)^(-1/r))/q_0 * ((((p_0 + 2*sigma/R_0)* ((R_0^3 - m* R_0^3)/(R^3 - m*R_0^3))^k - (4*mu*diff(R,1)/R) - 2*sigma/R - B)^(-1/r))*((p_0 + 2*sigma/R_0)*k*(((R_0^3 - m* R_0^3)/(R^3 - m* R_0^3))^(k-1))*((-(R_0^3 - m*(R_0^3))*3*(R^2)*diff(R(t),t))/(R^3 - m*R_0^3)^2) - ((4*mu*R*diff(R(t),t,t) - 4*mu*(diff(R(t),t))^2)/R^2) + (2*sigma*diff(R(t),t))/R^2)));
[eqs,vars] = reduceDifferentialOrder(eqn,R(t))
initConditions = [364 0]
[M,F] = massMatrixForm(eqs,vars)
f = M\F
odefun = odeFunction(f,vars);
tspan = 000000:1:7000000;
[t,yexact] = ode15s(odefun, tspan, initConditions);
plot(t,yexact(:,1))

Accepted Answer

darova
darova on 27 Dec 2019
Here is what i tried. Do you know the result should looks like?
  8 Comments

Sign in to comment.

More Answers (1)

KALYAN ACHARJYA
KALYAN ACHARJYA on 27 Dec 2019
Edited: KALYAN ACHARJYA on 27 Dec 2019
"it plots a straight line in the time interval"
Because yexact(:,1) values return as same value for all 1st column elemnets
>>yexact(:,1)
364
364
364
364
364
364
....
...
As t values are changing across x axes, wheare as yexact(:,1) data elements are same
  1 Comment
kirankumari sheshma
kirankumari sheshma on 27 Dec 2019
That is my question. I would like to know why the yexact values are same ? when i use ode45 function, it still comes as the same.
i have given a picture image of the gilmore equation problem that i want to solve .

Sign in to comment.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!