필터 지우기
필터 지우기

How do I use a step function in Boundary value problem ?

조회 수: 4 (최근 30일)
Gaurav Singh
Gaurav Singh 2022년 11월 10일
댓글: Gaurav Singh 2022년 11월 11일
Hi,
. I am using sol = bvp4c(odefun,bcfun,solinit). I don't know how to include a step function in my differential equation defined in odefun. Is it possible to do so or odefun can only handle predefined functions? Thankyou for reading. Any suggestion is highly appreciated.
  댓글 수: 9
Bjorn Gustavsson
Bjorn Gustavsson 2022년 11월 11일
Fourth derivatives brings back memories (very very vague ones) of the one course in solid mechanics and bending beams and bridges. There we had tables of solutions for different kinds of loads and end-conditions. If this is your problem it might be possible to piece together a solution from such characteristic solutions that fits these conditions.
Gaurav Singh
Gaurav Singh 2022년 11월 11일
Thanks Bjorn. The step function makes life a bit difficult.

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

답변 (1개)

Gaurav Singh
Gaurav Singh 2022년 11월 11일
Thankyou all. I guess, I have figured it out. For now, I am able to use heaviside function in my problem. Here is the code;
function dydx = mat4ode(x,y,lambda) % equation being solved
global k
dydx = [y(2)
y(3)
y(4)
2*k^2*y(3)-(1*(-heaviside(x+1)+heaviside(x-1)+0.5)+lambda)*y(1)];
end
  댓글 수: 2
Torsten
Torsten 2022년 11월 11일
편집: Torsten 2022년 11월 11일
This will introduce jumps at x+1 and x-1 for every point x of your grid vector. I doubt that this is what you want.
Gaurav Singh
Gaurav Singh 2022년 11월 11일
편집: Gaurav Singh 2022년 11월 11일
Thanks for your comment Torsten. Can you please elaborate more on this. May be I am missing something important here. From my understanding, as its a forth order DE, the solver gives me continuous function up to order three. The third derivative is having sharp corner at x=+1 and -1.
I belive fourth derivative will be discontinuous. Is there any fundamental err in suppyling heaviside function directly in DE in Matlab?

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

카테고리

Help CenterFile Exchange에서 Boundary Value Problems에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by