syms x f(x) g(x) h(x) M2 M3 a1 k K L A Rd Br Pr Nb Nt G Le H
eqn = [ diff(f,2) - L*diff(f)*diff(g) + A*a1*exp(L*g) == 0,...
(K/k+Rd)*diff(g,2) + (K/k)*(M2+M3)*diff(h)*diff(g) + exp(-L*g)*Br*(diff(f))^2/a1 + Pr*(Nb*diff(h)*diff(g) + Nt*(diff(g))^2) + H*g == 0,...
diff(h,2) +(Nt/Nb)*diff(g,2) + G*Pr*Le*(1-h) == 0 ];
cond = [ f(0) == 0,g(0) == 0,h(0) == 0, f(1) == 0,g(1) == 0,h(1) == 0 ];
F1 = dsolve(eqn,cond); f1 = F1.f; g1 = F1.g; h1 = F1.h; disp(collect([f1 g1 h1],x))

 채택된 답변

Walter Roberson
Walter Roberson 2021년 2월 12일

0 개 추천

syms x f(x) g(x) h(x) M2 M3 a1 k K L A Rd Br Pr Nb Nt G Le H
eqn = [ diff(f,2) - L*diff(f)*diff(g) + A*a1*exp(L*g) == 0,...
(K/k+Rd)*diff(g,2) + (K/k)*(M2+M3)*diff(h)*diff(g) + exp(-L*g)*Br*(diff(f))^2/a1 + Pr*(Nb*diff(h)*diff(g) + Nt*(diff(g))^2) + H*g == 0,...
diff(h,2) + (Nt/Nb)*diff(g,2) + G*Pr*Le*(1-h) == 0 ];
cond = [ f(0) == 0,g(0) == 0,h(0) == 0, f(1) == 0,g(1) == 0,h(1) == 0 ];
reshape(eqn(x),[],1)
ans = 
F1 = dsolve(eqn, cond); f1 = F1.f; g1 = F1.g; h1 = F1.h; disp(collect([f1 g1 h1],x))
Warning: Unable to find symbolic solution.
Dot indexing is not supported for variables of this type.

Error in sym/subsref (line 902)
R_tilde = builtin('subsref',L_tilde,Idx);

댓글 수: 3

diff(h,2) +(Nt/Nb)*diff(g,2) + G*Pr*Le*(1-h) == 0
^
That is not addition. That is "unary plus". Just like
[1 -2]
is not subtraction, you can use + instead of - in expressions the same way you use negative sign; for example,
[+1 -2 +2 -1]
would be perfectly understandable in context.
Spacing is important. Inside [] and {}, unless you are inside (), if there is whitespace between the previous term and this term, and there is + or - that is not followed by whitespace before the next term, then the previous term ends. To signify addition or subtraction, you need to either have whitespace after the character or else you need to have no whitespace before the character
[+1-2 + 2 -1]
U S A U
U -> Unary operator
S -> subtraction
A -> addition
and two terms would result, (1-2+2) and (-1)
Walter Roberson
Walter Roberson 2021년 2월 12일
Next thing to note is that you cannot provide two boundary conditions for the same function differential order. f(0)==0, fine by itself. f(1)==1, fine by itself. f(0)==0 and f(1)==1 together, will not work. The boundary conditions are used only to try to find a value for the constant of integration, and the code cannot reason about them further than that.
But in your case, it does not matter: even if you remove the boundary conditions, the system is too hard for MATLAB to solve.
MINATI PATRA
MINATI PATRA 2021년 2월 12일
Thanks
Walter
for your valuable suggestion. I think because of hghly nonlinearity, dsolve is unable to solve. Any way, I have solved with bvp code.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2021년 2월 12일
편집: KALYAN ACHARJYA 2021년 2월 12일

0 개 추천

The issues are here
f1=F1.f;
g1=F1.g;
h1=F1.h;
Here, lets say for first line of the code
f1=F1.f;
Whre F1 is the sym variable with size 1x4, whereas f is the sym function
>> whos F1
Name Size Bytes Class Attributes
F1 1x4 8 sym
>> whos f
Name Size Bytes Class Attributes
f 1x1 8 symfun
What exactly are you trying to do in these lines?
Variable Access??
randerss simil
randerss simil 2021년 2월 12일

0 개 추천

M2 M3 a1 k K L A Rd Br Pr Nb Nt G Le H
Assign values for above variables instead of symbolic variables,
As you are using only three equations, with 3 unknowns in x, f, g, h
Then you can solve it,

댓글 수: 2

randerss simil
randerss simil 2021년 2월 12일
dsolve expects, as many equations as the number of symoblic variables that constitute equations.
randerss simil
randerss simil 2021년 2월 12일
Try with ode45 function

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

질문:

2021년 2월 12일

댓글:

2021년 2월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by