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 Center および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by