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 comentario

John D'Errico
John D'Errico el 25 de Jun. de 2018
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.

Iniciar sesión para comentar.

Respuestas (1)

Raphael Poulain
Raphael Poulain el 28 de Jun. de 2018
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,

Etiquetas

Preguntada:

el 25 de Jun. de 2018

Respondida:

el 28 de Jun. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by