How to solve 2nd order ODE inequality ?

Hello to all,
I am trying to numerically solve a 2nd order ODE inequality of the form : y"(x) + y'(x)*a(x) + y(x)*b(x) <= 0 ( a(x) and b(x) are spatially varying parameters). Also, my solution y(x) must be > 0 for all x.
It is possible to solve a similar problem in Matlab ( y"(x) + y'(x)*a(x) + y(x)*b(x) = 0 ) using ode solvers, however, I am uncapable of enforcing the above constraints (ODE<=0 and y(x)>0).
Are toolboxes like Yalmip useful in solving such problems?
Thanks in advance
Firas

3 comentarios

Hildo
Hildo el 29 de Nov. de 2016
If this problem can be solved with Yalmip, you can use Yalmip + SEDUMi. But I don't understand with this problem can be solved con Yalmip or you are look for some other toolbox with similar declaration of the problem.
Firas Mourad
Firas Mourad el 29 de Nov. de 2016
I was just wondering if such a problem can be solved using a toolbox like Yalmip. If not, then I welcome other suggestions :)
Firas Mourad
Firas Mourad el 29 de Nov. de 2016
Just an update. I got a reply from a Yalmip forum : such problems cannot be sloved using Yalmip.

Iniciar sesión para comentar.

Respuestas (1)

Tamir Suliman
Tamir Suliman el 29 de Nov. de 2016
Editada: Tamir Suliman el 29 de Nov. de 2016
lets assume that we have the equations:
y''+a*y'+b*y<=0 a , b are f(x) where x>0
let y(x)=Y1 and dy(x)/dx = Y2
dY1/dx= Y2 dY2/dx= -a*Y2-b*Y1
lets assume a =3 b =4 then the program code would be similar to
a=3;b=4;
syms y(x)
[V] = odeToVectorField(diff(y, 2) == -a*diff(y) -b* y);
M = matlabFunction(V,'vars', {'x','Y'})
sol = ode45(M,[0 20],[2 0]);
fplot(@(x)deval(sol,x,1), [0, 20])
if statement would be sufficient to add the constraints

2 comentarios

Firas Mourad
Firas Mourad el 29 de Nov. de 2016
Thank you Tamir for your reply.
Could you please elaborate more on how the if statement will be used?
Tamir Suliman
Tamir Suliman el 2 de Dic. de 2016
Editada: Tamir Suliman el 2 de Dic. de 2016
if sol > 0 then code please do some thing for me here
else if sol < 0 then code please do some thing for me else code
end

Iniciar sesión para comentar.

Categorías

Más información sobre Symbolic Math Toolbox en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 28 de Nov. de 2016

Editada:

el 2 de Dic. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by