how to solve ode which includes ode and integral

조회 수: 2 (최근 30일)
Emil
Emil 2014년 7월 28일
답변: Torsten 2015년 7월 6일
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
RahulTandon
RahulTandon 2015년 7월 6일
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 2015년 7월 6일
i think the function f(x,y) will have to be futher specified to get a particular solution to the proble!

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

답변 (2개)

RahulTandon
RahulTandon 2015년 7월 6일
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 2015년 7월 6일
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.

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by