how to solve ode which includes ode and integral

2 visualizaciones (últimos 30 días)
Emil
Emil el 28 de Jul. de 2014
Respondida: Torsten el 6 de Jul. de 2015
How can I solve the following equations:
df(x,y)/dx= y*f^2(x,y)-dg(x)/dx*f(x,y)/g(x)+y*g(x)
dg(x)/dx=2g(x)*integral{f(x,y)dy} ... (y goes from -t to +t)
with given f(0,y), and g(0).
  2 comentarios
RahulTandon
RahulTandon el 6 de Jul. de 2015
THIS IS A ODE ALRIGHT, BUT A SYMBOLIC MATH PROBLEM. IT IS NOT AN ODE45 PROBLEM! OK BY YOU! BELOW IS THE SOLUTION!
RahulTandon
RahulTandon el 6 de Jul. de 2015
i think the function f(x,y) will have to be futher specified to get a particular solution to the proble!

Iniciar sesión para comentar.

Respuestas (2)

RahulTandon
RahulTandon el 6 de Jul. de 2015
clc; syms t x y f(x,y) g(x) k1 k2; Sol = dsolve('Dg - 2*g*int(f,y)','Dx - y*f^2- f/g*Dg','g(0)==k1','IgnoreAnalyticConstraints', true,'y'); % we obtain the symbolic solution to the problem Sol2 = solve(Sol.x==0,Sol.g==0,f(0,y)==k2); Sol.x

Torsten
Torsten el 6 de Jul. de 2015
Choose an equidistant grid in y-direction: yi=-t+(i-1)/(n-1)*2t (i=1,...,n).
Call the ODE Integrator (ODE15s,e.g.) for the n+1 differential equations
df(x,yi)/dx= yi*f^2(x,yi)-2g(x)*integral{f(x,y)dy}*f(x,yi)/g(x)+yi*g(x)
dg(x)/dx=2g(x)*integral{f(x,y)dy}
and approximate the integral via the trapezoidal rule:
integral_{y=-t}^{y=t}{f(x,y)dy}=dy/2*sum_{i=1}^{i=n-1}(f(x,yi)+f(x,y(i+1)))
with dy = 2t/(n-1)
Best wishes
Torsten.

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by