Solution of second order discontinuous ODEs (BVP)

17 views
Skip to first unread message

Afzal Shadab

unread,
Apr 14, 2025, 6:42:52 PM4/14/25
to chebfun-users
Dear all,

I am trying to numerically solve the following discontinuous second order ODEs in chebfun where I first define K1/K = 0.9. This system finds an eigenvalue for \beta for which all boundary conditions are satisfied as a solution of the function \Phi.

Can someone suggest the best way to implement it?

 Screenshot 2025-04-14 at 6.36.49 PM.png

Thanks and regards, 
Afzal

===========================================================

Mohammad Afzal Shadab, PhD (he/him)

Future Faculty in the Physical Sciences Postdoctoral Fellow

Princeton University

mashadab.github.io | (737) 206-2080

Nick Hale

unread,
Apr 15, 2025, 10:23:50 AM4/15/25
to chebfun-users
Hi Azfal

Chebfun does support discontinuous ODEs. Here is a toy example:

t0 = 0;
N = chebop(@(t,u) diff(u,2) + 10*(t>t0)*diff(u) - .5*(t<=t0)*u, [-1 t0 1]);
N.lbc = 0; N.rbc = 0;
u = N\-1;
plot(u)

For second-order ODEs, continuity of u and u' is enforced automatically. However, you can override this. See https://www.chebfun.org/examples/ode-linear/JumpGreen.html

If the operator is linear, then Chebfun returns eigenvalues and eigenvectors using eigs(). 

>> [V, D] = eigs(N, 1);
>> plot(V)

I hope this helps

Nick

PS. The above seems to work, but I plucked it out of the air and make no claims that it is a well-posed problem.
Reply all
Reply to author
Forward
0 new messages