You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
Can MATLAB solve a integrodifferential equation?
1 view (last 30 days)
Show older comments
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
Accepted Answer
Torsten
on 20 Nov 2017
u = 1/int(y*z,x,0,2*pi)
Best wishes
Torsten.
21 Comments
Sergio Manzetti
on 21 Nov 2017
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
on 21 Nov 2017
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
on 21 Nov 2017
Edited: Sergio Manzetti
on 21 Nov 2017
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
on 21 Nov 2017
Edited: Torsten
on 21 Nov 2017
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
on 21 Nov 2017
Edited: Sergio Manzetti
on 21 Nov 2017
This is precisely the reason I ask here. In fact, u can even be an operator, such as d/dx
Torsten
on 21 Nov 2017
I wonder why you call your equation an "integro-differential equation". Where is the differential operator ?
Best wishes
Torsten.
Sergio Manzetti
on 21 Nov 2017
u can be the differential operator, or it can be a simple function, such as "x"
Torsten
on 21 Nov 2017
Edited: Torsten
on 21 Nov 2017
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
on 21 Nov 2017
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
on 5 Dec 2017
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
on 5 Dec 2017
PS: Torsten, I get TWO values if I use double(Csol), how does that figure?
Torsten
on 5 Dec 2017
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
on 24 May 2022
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.
More Answers (0)
See Also
Categories
Find more on Calculus in Help Center and File Exchange
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)