BVP PROBLEM how can we take 'c' in x-axis(continuous range.[-1.3:0.02:-1.1]) and to find f"(0)

1 回表示 (過去 30 日間)
function main
S = 1; c = -1.25; Pr = 0.7; n = -0.8;
x = [3 -1];
x1 = fsolve(@solver, x);
function F = solver(x)
[t, u] = ode45(@equation,[0,5], [S, c, x(1), 1, x(2)]);
F = [u(end, 2)-1 u(end, 4)];
figure(1)
plot(t, u(:,2));
hold on
end
function dy = equation(t, y)
dy = zeros(5,1);
dy(1) = y(2);
dy(2) = y(3);
dy(3) = y(2)^2 - y(1) * y(3) - 1;
dy(4) = y(5);
dy(5) = Pr * (n * y(2) * y(4) - y(1) * y(5));
end
end
  2 件のコメント
Torsten
Torsten 2019 年 3 月 4 日
Is f = y(1) ?
MINATI
MINATI 2019 年 3 月 4 日
Dear Torsten
yes f = y(1)
Sorry for seeing late

サインインしてコメントする。

採用された回答

Torsten
Torsten 2019 年 3 月 4 日
function main
S = 1; c = [-1.3:0.02:-1.1]; Pr = 0.7; n = -0.8;
sol = zeros(numel(c),1);
x = [3 -1];
for i = 1:numel(c)
c_actual = c(i);
x1 = fsolve(@solver, x);
sol(i) = x1(1);
x = x1;
end
plot(c,sol)
function F = solver(x)
[t, u] = ode45(@equation,[0,5], [S, c_actual, x(1), 1, x(2)]);
F = [u(end, 2)-1 , u(end, 4)];
end
function dy = equation(t, y)
dy = zeros(5,1);
dy(1) = y(2);
dy(2) = y(3);
dy(3) = y(2)^2 - y(1) * y(3) - 1;
dy(4) = y(5);
dy(5) = Pr * (n * y(2) * y(4) - y(1) * y(5));
end
end
  15 件のコメント
MINATI
MINATI 2019 年 3 月 6 日
編集済み: MINATI 2019 年 3 月 7 日
I am working on this attached paper. For reference you can follow:
Want to solve Eq.(11)(12) with B.Cs (13)(14)
In Fig. (2-5), in X-axis c/a is taken.
In other figs., dual solution concept is used i.e if we change x = [3 -1]; as anything like x = [5 -2]; or any other, we will get SECOND solution.
MINATI
MINATI 2019 年 3 月 7 日
Please have a look

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpline Postprocessing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by