Need some change in the present Analytical solution code which I'm unable

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

@ Thanks Torsten
Can it be possible for you to import some of your ideas.
Can somebody help here
use subs() to do the replacements before solving.
subs(F, {list of things to replace}, {list of things to replace with})

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Torsten
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)
var = 
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]))
F = 

3 Kommentare

But it is not working if we take
F = F(1)+F(2)+F(3)+F(4)+F(5);
instead of
F = F(1)+F(2);
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by