Solving edge-value problems with unknown intervals

24 次查看(过去 30 天)
I am currently experiencing the following problem:
I am solving a system of nonlinear differential equations with 6 differential equations and 7 boundary conditions (y1=y2=y3=y4=0 at x=x1; y3=1.1,y5=y6=0 at x=x2). Where the boundary condition (y3=1 at x=x2) affects the range of the solution interval and the final numerical results. When I used the bvp4c function that comes with matlab, it was clear that I could only impose 6 boundary conditions (I imposed y1=y2=y3=y4=0 at x=x1; y5=y6=0 at x=x2). Because the solution interval (x1=0, but x2 is unknown) is uncertain, I start with a range given x2, traverse within that range, solve the system of differential equations, and then determine whether y3 is equal to 1 at x=x2; but since the system of differential equations is missing a constraint, there are many cases where: at x=x2, it does satisfy y3=1,y5=0,y6=0, but not the result I want. result. Then I tried (imposing x=x1, y1=y2=y3=0; x=x2, y3=1,y5=y6=0),x2 traversing a range to find the case where x=x1 is exactly satisfied by y4=0, but that case is still not optimal. So I am thinking that the problem should fall under the category of solving edge-valued problems with indeterminate intervals, how do I add more than one of this constraint to the system of differential equations in this case? Is there an optimization algorithm involved? How to deal with it? I hope my friends can give me some advice.
The differential equations are as follows:( are constants)
and the boundry conditions are:( is an unknown variable)
I tried to solve it using the margin problem approach, using matlab's bvp4c function, but ran into the problem I described above.Please help me see if there is a better mathematical way to deal with this problem.My code is as follows and it runs without a problem, just the results are not what I want. For example, inside the solution result, actually y3>0.
clear
clc
tic;
bar = waitbar(0,'读取数据中...');
x2=linspace(8,20,13000);
len = length(x2);
v0=[];
l1=[];
k=0;
for i=1:len
x1=0; delta0=1.1;
xmesh = linspace(x1,x2(i),500);
solinit = bvpinit(xmesh, @guess);
sol = bvp4c(@bvpfcn, @bcfcn, solinit);
str=['计算中...',num2str(100*i/len),'%'];
waitbar(i/len,bar,str)
u0_judge=abs(sol.y(2,1)-0);
while(u0_judge<1)
k=k+1;
v0(k,:)=sol.y(3,:);
x(k,:)=xmesh;
plot(x(k,:),v0(k,:))
hold on
l1(k)=x2(i);
break
end
end
close(bar)
toc;
function res = bcfcn(ya,yb)
res = [ya(1); ya(2); ya(3); yb(3)-1.1; yb(5); yb(6)];
end
function dydx = bvpfcn(x,y,ML,NL)
D11=1142.9; A=1; sigma0=0.1; Iy=1/12;
ML=6; h=1; d0=0.2*h; b=1;
NL=ML*(exp(-h/d0)-1)/(-d0+h/2+(2*d0+h)/2*exp(-h/d0));
dydx = [(-y(5)*sin(y(4))+NL)/D11/A+1;((-y(5)*sin(y(4))+NL)/D11/A+1)*cos(y(4))-1;
((-y(5)*sin(y(4))+NL)/D11/A+1)*sin(y(4));(y(6)+ML)/D11/Iy;
-((-y(5)*sin(y(4))+NL)/D11/A+1)*b*sigma0;((-y(5)*sin(y(4))+NL)/D11/A+1)*y(5)*cos(y(4))];
end
function g = guess(x)
g = [sin(x);cos(x);x;cos(x);cos(x);cos(x)];
end
  2 个评论
Torsten
Torsten 2024-4-11,13:28
Maybe someone will be able to help if you state your equations and boundary conditions is a mathematical way. I think noone in the forum enjoys extracting the problem from your code.
And please include code always as a plain ascii file because we are not able to use graphics in MATLAB to run them.

请先登录,再进行评论。

回答(1 个)

Torsten
Torsten 2024-4-11,15:45
编辑:Torsten 2024-4-11,17:27
Define a dimensionless variable x' = x/l1 and transform your equation to the form dY/dx' = ... which has to be solved in [0 1].
You will get l1 as a free (unknown) parameter in your system of equations.
Now define a seventh ODE as
dy7/dx' = 0
and insert y(7) for l1 in your system of equations.
This seventh ODE gives you the possibility to define your seven boundary conditions for bvp4c.
  2 个评论
fengbo wang
fengbo wang 2024-4-16,11:54
Thank you very much for your advice and help, I managed to solve this problem!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Boundary Value Problems 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by