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)
Show older comments
kirankumari sheshma
on 27 Dec 2019
Commented: kirankumari sheshma
on 2 Jan 2020
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))
0 Comments
Accepted Answer
More Answers (1)
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
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!