Solving 1-D non linear differential equation

Hello,
Is there a way to solve a non-linear differential equation : div(grad(u))=f(u) , which in 1-D gives d2u/dx2=f(u), with a function existing on matlab?
It seems that most functions are designed for 2-D problems. For instance, pdenonlin might be suitable, but to adapt the function to 1-D problem looks rather heavy for a beginner like me.
Many thanks in advance, Raphaël

댓글 수: 1

In fact, MOST functions are NOT designed for 2-d problems. There are a huge variety of 1-d solvers you can find, depending on the problem. Start reading about basics like ODE45, ODE15s, dsolve, bvp4c, etc. If you have a specific problem, you need to be more specific. Otherwise, you need to do some reading.

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

답변 (1개)

Raphael Poulain
Raphael Poulain 2018년 6월 28일

0 개 추천

Thank you for the answer.
Basically what I want to code is the poisson equation but I have strong oscillation (the solution is not stable), any idea why?
It should converge around 0.28. I have oscillation whatever the tolerance. The solver is ode15s.
The function I want to solve is :
function dudx=poisson(x,u)
temp=300;
eps0=8.8542e-12;
kB=1.38066e-23;
e0=1.6022e-19;
kBT=kB*temp/e0; %{kB*T in eV}
eps=12;
NC=2.8e25;
ND0=8e20;
eps_0=eps0*eps;
gD=2;
ND=ND0*(1-1/(1+(1/gD)*exp((u(1)-0.05)/kBT)));
ne=NC*exp(-(u(1))/kBT);
rho=ND-ne;
A=-e0*rho/eps_0;
dudx=[u(2); A];
end
Regards,

질문:

2018년 6월 25일

답변:

2018년 6월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by