Where the ODE is
with boundary condition
y(1)=sin(1)
D = [1/pi*3 ,1];
N = chebop(D);
N.lbc = [1];
N.rbc = 1 - sin(1);
N.op = @(t,x,y) diff(y,2) + (2/x)*diff(y,1) + (1/(x^4))*y;
[x, y] = N\0;
plot([x, y]);

댓글 수: 6

Walter Roberson
Walter Roberson 2022년 4월 9일
What difficulty are you experiencing?
Chala Kedir
Chala Kedir 2022년 4월 9일
@Walter Roberson I couldn't plot the output, please if you could help me, it would help me a lot
Walter Roberson
Walter Roberson 2022년 4월 10일
What error message are you getting, at what line?
Chala Kedir
Chala Kedir 2022년 4월 10일
편집: Chala Kedir 2022년 4월 10일
this is the error message I get
Error using chebop/linearize
Failed to evaluate operator on the initial guess passed (or the one constructed
by CHEBOP). A potential cause might be division by a zero CHEBFUN. Please supply
a valid initial guess via the 'init' field of the CHEBOP.
Error in chebop/solvebvp (line 109)
[L, residual, isLinear] = linearize(N, u0, x);
Error in \ (line 56)
[varargout{1:nargout}] = solvebvp(N, rhs, varargin{:});
Error in untitled (line 6)
[x, y] = N\0;
Are you sure about your D ?
Shouldn't it be
D = [1, 1/3*pi];
?

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

답변 (1개)

Bhavana Ravirala
Bhavana Ravirala 2023년 2월 15일

0 개 추천

Hi,
The error you received indicates that the operator fails to evaluate the initial guess. To resolve this error, we can assign the initial guess with the boundary conditions.
N.init = [0; sin(1)];
Hope this helps!!

카테고리

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

제품

릴리스

R2022a

질문:

2022년 4월 9일

답변:

2023년 2월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by