bvp4c problem with fewer boundary value than variable

In my problem i have 11 varaible of y but only 9 boundary conditions what can i do here? Another additional problem is equation 3 and 4 both contain θ₂ and φ₂ how do i write y9' and y11' for them? in my code i took one of the constant as zero. I also tried taking some other boundary condition (f'' and f'')=0 to solve it but solution is unstable.
clc;clear;
work=0;
nnn=0;
aa=.5;
bb=10;
cc=30;
name='B';
sol=main(aa,bb,cc,name);
function sol1=main(aa,bb,cc,name)
sol=jobs(aa);
% sol1=jobs(bb);
% sol2=jobs(cc);
figure('Name',name)
hold on
subplot(2,2,1)
plotting(2,"Pimary Velocity(F')",sol,cc)%,sol1,sol2,aa,bb,
subplot(2,2,2)
plotting(5,"Secondary Velocity(G)",sol,cc)
subplot(2,2,3)
plotting(8,"Concentation 1 (\Xi)",sol,cc)
subplot(2,2,4)
plotting(10,"Temparature(\Theta)",sol,cc)
xlim([0 3.2])
hold off
sol1=sol;
end
function plotting(line,titles,sol,aa)%,sol1,sol2,aa,bb,cc
hold on
grid on
a=plot(sol.x,sol.y(line,:),'r');
% b=plot(sol1.x,sol1.y(line,:),'g');
% c=plot(sol2.x,sol2.y(line,:),'b');
xline(0);
yline(0);
% legend([a; b; c],{num2str(aa); num2str(bb) ;num2str(cc)})
title(titles)
hold off
end
function out=jobs(VARABLE)
RC=.1;FW=.5;
M=0.5;BI =1.5;BE = 1.5;AE = 1+BE*BI;R=0.6;GR=8;
GM=6;PR=.71;EC=0.3; S = 0.5;S0 = 1;K=.5;SC=.6;
D = 2;GAMMA = 1;EPS = .8;ST = 5;STT= .5;
NEBLA = 2;LAMB=.8;short=AE^2+BE^2;XX=1+D;W1=1.5;CP=1.5;DF=.8;n=.01;
sol1 = bvpinit(linspace(0,1,500),[1 1 1 1 1 0 0 0 0 0 1]);
sol = bvp4c(@bvp2d, @bc2d, sol1);
sol1=bvpinit(sol,[0 10]);
sol = bvp4c(@bvp2d, @bc2d, sol1);
% sol1=bvpinit(sol,[0 2]);
% sol = bvp4c(@bvp2d, @bc2d, sol1);
out=sol;
function yvector =bvp2d(~,y)
% if y(1)==0
% y(1)=0.01;
% end
yy4=(-y(4)-y(3)*y(1)-W1*(2*y(4)*y(2)+y(3)^2)+K*y(2)+(M/(AE^2+BE^2))*...
(AE*y(2)+BE*y(5))+R*y(5)-GAMMA*y(2)^2+GM*y(10)+GR*y(8))/(-W1*y(1));
yy7=(-y(1)*y(6)-y(7)-2*W1*y(2)*y(7)+K*y(5)-(M/short)*(AE*y(5)+...
BE*y(2))+R*y(2)+GAMMA*y(5)^2)/(W1*y(1));
% yy11=(y(1)*y(9)-y(1)*y(11)*DF*SC+(EC/CP)*(y(3)^2+y(6)^2)+...
% (M*EC)/short*(y(2)^2+y(5)^2)+RC-DF*SC*(y(10)+1))/(1/PR-DF*S0*SC);
% yy9=(y(1)*y(9)+EC/CP*(y(3)^2+y(6)^2)+M*EC/short*(y(2)^2+y(5)^2))/(-PR);
% yy11=(-y(1)*y(11)-S0*yy9-RC*y(10))*SC;
yy11=(-y(1)*y(11)+RC*y(10))*SC;
yy9=(y(1)*y(9)+EC/CP*(y(3)^2+y(6)^2)+M*EC/short*(y(2)^2+y(5)^2)+DF*yy11)/(-PR);
yvector=[y(2);y(3);y(4);yy4;y(6);y(7);yy7;y(9);yy9;y(11);yy11];
end
function residual=bc2d(y0,yinf)
residual=[y0(1)-FW;y0(2)-1;y0(5);y0(8)-1;y0(10)-1;yinf(3);yinf(4);
yinf(2);yinf(5);yinf(8);yinf(10)];
end
end

댓글 수: 8

The solution of a bvp problem with 2 boundary conditions less than equations usually has two degrees of freedom. Since bvp4c can only solve problems with a uniquely solution, you won't succeed with this solver.
ulan
ulan 2024년 5월 24일
편집: ulan 2024년 5월 24일
which other solver should I try?And also is there a way to consider value of both for θ₂ and φ₂ for the problem i.e. solving it without taking Sc or Df =0 ?
Torsten
Torsten 2024년 5월 24일
편집: Torsten 2024년 5월 24일
For simple problems, dsolve is an option - it would return a solution that depends on two free parameters. But because of the complexity of your equations, I'd guess that your problem is unsolvable with dsolve and unsolvable with bvp4c unless you work out two further boundary conditions to fix a unique solution.
I don't know what you mean by
And also is there a way to consider value of both for θ₂ and φ₂ for the problem i.e. solving it without taking Sc or Df =0 ?
Writing down your system in a readable mathematical form with boundary conditions and a list of the unknowns would help.
In my equation 3 and 4 both of them contains θ₂ and φ₂ which are the heighest derivatve of them. When i try to write equation of θ'' from equation 3 it contains value of φ''. Here φ'' is value of it from previous loop and it shows "Unrecognized function or variable 'yy9'." and same is also the case when i try to write θ'' from equation 4 ,it contains φ''.In my equation I took So=0 to remove θ'' from equation 4.are there any way around it?
Most probably equations 3 and 4 are a linear system of equations in θ'' and φ''. Explicitly solve for them.
Imagine θ'' were x and φ'' were y in the following. Then you know how to solve
a11*x + a12*y = b1
a21*x + a22*y = b2
for x and y ?
syms a11 a12 a21 a22 b1 b2 x y
eqn1 = a11*x + a12*y == b1;
eqn2 = a21*x + a22*y == b2;
solve([eqn1,eqn2],[x,y])
ans = struct with fields:
x: -(a12*b2 - a22*b1)/(a11*a22 - a12*a21) y: (a11*b2 - a21*b1)/(a11*a22 - a12*a21)
Thats what i tried to do at first but my instructor prohibited me to do it.He said not to mix these two equation instead take one of the constant as 0.Thank you for your valuable time.
He said not to mix these two equation
The two equations are mixed in the state they are now because they both contain θ'' and φ''. If you solve for θ'' and φ'', they become "unmixed" because you explicitly solve for the highest derivatives.
Syed Sohaib Zafar
Syed Sohaib Zafar 2024년 9월 3일
이동: Walter Roberson 2024년 9월 3일
Do you find the answer to this? I'm also solving a problem similar to this. I Considered some extra boundary conditions but results are not quite good.

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

답변 (0개)

카테고리

질문:

2024년 5월 24일

이동:

2024년 9월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by