Need some change in the present Analytical solution code which I'm unable
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
P.K. Pattnaik
am 10 Mai 2022
Kommentiert: P.K. Pattnaik
am 30 Dez. 2023
syms x F1(x) G1(x) H1(x) n fw h
Nt = 0.5; Nb = 0.5; Pr = 1; Le = 2; DF = diff(F1,x);
eq1 = diff(F1,x,3) + diff(F1,x,2) == 0; eq2 = diff(G1,x,1) + diff(G1,x,2) == 0; eq3 = diff(H1,x,1) + diff(H1,x,2) == 0;
EQ = [eq1, eq2, eq3]; S = dsolve(EQ);f1 = S.F1;
F(1) = fw + 1 - exp(-x);
for m = 2:5
for k = 1:m-1
K = F(k)*diff(F(m-k),2) - (2*n/(n+1))*diff(F(k))*diff(F(m-k));
F(m) = f1 + F(m-1) + h*( diff(F(m-1),3) + int(int(int(K))) + int(int(K)) );
end
end
F = F(1)+F(2);F0 = subs(F,x,0); dF0 = subs(diff(F,x),x,0); dFI = subs(diff(F,x),x,Inf);
sv = solve(F, {F0 == fw, dF0 == 0,dFI == 0})
%% I want to simplify 'F' by putting the conditions {F0 == fw, dF0 == 0,dFI == 0}, so that the values of the Constants present in 'F' can be find out.
3 Kommentare
Walter Roberson
am 4 Nov. 2023
use subs() to do the replacements before solving.
subs(F, {list of things to replace}, {list of things to replace with})
Akzeptierte Antwort
Torsten
am 4 Nov. 2023
Bearbeitet: Torsten
am 4 Nov. 2023
syms x F1(x) G1(x) H1(x) n fw h
Nt = 0.5; Nb = 0.5; Pr = 1; Le = 2; DF = diff(F1,x);
eq1 = diff(F1,x,3) + diff(F1,x,2) == 0; eq2 = diff(G1,x,1) + diff(G1,x,2) == 0; eq3 = diff(H1,x,1) + diff(H1,x,2) == 0;
EQ = [eq1, eq2, eq3]; S = dsolve(EQ);f1 = S.F1;
F(1) = fw + 1 - exp(-x);
for m = 2:5
for k = 1:m-1
K = F(k)*diff(F(m-k),2) - (2*n/(n+1))*diff(F(k))*diff(F(m-k));
F(m) = f1 + F(m-1) + h*( diff(F(m-1),3) + int(int(int(K))) + int(int(K)) );
end
end
F = F(1)+F(2);
F0 = subs(F,x,0);
dF0 = subs(diff(F,x),x,0);
dFI = subs(diff(F,x),x,Inf);
var = symvar(F)
C1 = var(1);
C4 = var(2);
C5 = var(3);
sol = solve([F0==fw,dF0==0,dFI==0],[C1 C4 C5]);
F = simplify(subs(F,[C1 C4 C5],[sol.C1,sol.C4,sol.C5]))
3 Kommentare
Torsten
am 5 Dez. 2023
Yes, F'(Inf) = NaN if F = F(1)+F(2)+F(3)+F(4)+F(5)
But this is problem-immanent - MATLAB cannot change the mathematics of the problem.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Algebra finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!