Can MATLAB solve a integrodifferential equation?
1 次查看(过去 30 天)
显示 更早的评论
Hi, I have checked some posts on the forum, however to no avail.
I have the given system:
{
syms h g x C
h = 2
g = 4
C = 1/sqrt(2.*pi)
y = ((exp(2.*g.*i.*x./h)).*(((h.^2)./2) + (g.*x)/2.*h.*i));
z = ((exp(-2.*g.*i.*x./h)).*(((h.^2)./2) + (g.*x)/2.*h.*-i));
[int(y.*z*.u, x], 0, 2.*pi)]==1
} which should solve for u. Is it feasible with some modifications?
Thanks
采纳的回答
Torsten
2017-11-20
u = 1/int(y*z,x,0,2*pi)
Best wishes
Torsten.
21 个评论
Sergio Manzetti
2017-11-21
Hi Torsten, maybe I haven't outline the problem correctly:
it should be:
[int(y.*z*.u )*, x], 0, 2.*pi)]==1
where u is inside the integrator. It is not possible to extract u from the integrator by dividing by int(y,z,x,o,2i), that is why it is an integrodifferential eqn. u is inside the integration operation.
Torsten
2017-11-21
If u is a scalar, you can take it out of the int-operator.
What is u if it's not a scalar value ?
Best wishes
Torsten.
Sergio Manzetti
2017-11-21
编辑:Sergio Manzetti
2017-11-21
u is a function which is multiplied with y and z, which are functions. The three of them are under then dx symbol, and thus cannot be divided per se in our out of the integral sign.
Torsten
2017-11-21
编辑:Torsten
2017-11-21
Of course u can be taken out of the integral if it does not depend on x.
Your equation is solved if you set u to be equal to the scalar value
u = 1/int(y*z,x,0,2*pi)
Maybe there are other requirements on u which make this impossible, but up to now, you didn't state them.
Best wishes
Torsten.
Sergio Manzetti
2017-11-21
编辑:Sergio Manzetti
2017-11-21
This is precisely the reason I ask here. In fact, u can even be an operator, such as d/dx
Torsten
2017-11-21
I wonder why you call your equation an "integro-differential equation". Where is the differential operator ?
Best wishes
Torsten.
Sergio Manzetti
2017-11-21
u can be the differential operator, or it can be a simple function, such as "x"
Torsten
2017-11-21
编辑:Torsten
2017-11-21
I think you should first take a look at the definition of an integro-differential equation:
https://en.wikipedia.org/wiki/Integro-differential_equation
There is no MATLAB program that directly solves this type of equations.
But what exactly is the equation you are trying to solve ?
If it's the one you stated and u depends on x, you must explicily specify how u depends on x, e.g. u(x)=a*cos(x) with unknown a. Then - as a next step - you can determine "a" via the "solve" command.
Best wishes
Torsten.
Sergio Manzetti
2017-11-21
Tried it, and got "a" not defined
end
syms h g x C
h = 2
g = 4
C = 1/sqrt(2.*pi)
y = ((exp(2.*g.*i.*x./h)).*(((h.^2)./2) + (g.*x)/2.*h.*i));
z = ((exp(-2.*g.*i.*x./h)).*(((h.^2)./2) + (g.*x)/2.*h.*-i));
u = 1/[int(y.*z*.*a*cos(x), x], 0, 2.*pi)]
solve
Sergio Manzetti
2017-12-5
Dear Torsten, I tried this new variant:
if true
% code
end
syms h g x C
h = 1
g = 5
y=@(x)(C - (exp(2.*g.*1i.*x./h));
z=@(x)(C - (exp(-2.*g.*1i.*x./h));
prod=@(x)y(x).*z(x)*(1+x^2);
W= integral(prod,0,2*pi)==1;
and I should get the result for "C", however that is simply 0. It looks incorrect, or is the W part correctly written?
Thanks!
Sergio Manzetti
2017-12-5
PS: Torsten, I get TWO values if I use double(Csol), how does that figure?
Torsten
2017-12-5
From your Ansatz, you get a quadratic equation in C which usually has two solutions.
Let MATLAB show "int(prod,x,0,2*pi)" and you'll see.
Best wishes
Torsten.
GNANASEKARAN S
2022-5-24
Dear Torsten,
I have the source term of the form u(1-int u) in two dimension. How to write the FDM code? Could you please tell.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!发生错误
由于页面发生更改,无法完成操作。请重新加载页面以查看其更新后的状态。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
亚太
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)