필터 지우기
필터 지우기

How do I solve a second order ordinary differential equation with boundary conditions?

조회 수: 8 (최근 30일)
The equation I am trying to solve is c"+2/a*c'=c/0.4(0.1+c); In my code c is 'x' and t is 'a'. The boundary conditions are dc(0)=0 and c(1)=0 % this function breaks down the second order function into two first order % eq function dxdt=F(t,x) dxdt=[x(2); -2./t.*x(1)+t./(0.04.*(0.01+t))]; end% This function applies the boundary conditions. function res=fb(xa,xb) % xa is the derivative boundary condition and xb the normal boundary % condition res=[xa(2); xb(1)-1]; end % This is the code to solve bme=bvpinit([0.1 1],[0.1 1]); sol=bvp4c(@F, @fb, bme); plot(sol.y(1,:), sol.x); xlabel('a'); ylabel('Ss/S'); title('Plot for S~Km');
Can anyone verify my initial set up is correct and if so, how to just have values from 0 to 1 for my x-axis?

답변 (1개)

Sachin Kumar
Sachin Kumar 2017년 4월 19일
Below link has some examples on using bvp4c, you can verify with these examples:

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by