Complex integral using matlab
up vote
0
down vote
favorite
Let $f(s)$ be a function. I would like to compute the following integral using Matlab
$$
I=int_{c-iinfty}^{c+iinfty}f(s)s^{-s}ds.
$$
How can we use Matlab to evaluate this integral.
Is the following notation convenient :
syms s x
int(f,x,c-iinfty+c,c+iinfty) ?
Thanks
matlab
add a comment |
up vote
0
down vote
favorite
Let $f(s)$ be a function. I would like to compute the following integral using Matlab
$$
I=int_{c-iinfty}^{c+iinfty}f(s)s^{-s}ds.
$$
How can we use Matlab to evaluate this integral.
Is the following notation convenient :
syms s x
int(f,x,c-iinfty+c,c+iinfty) ?
Thanks
matlab
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Let $f(s)$ be a function. I would like to compute the following integral using Matlab
$$
I=int_{c-iinfty}^{c+iinfty}f(s)s^{-s}ds.
$$
How can we use Matlab to evaluate this integral.
Is the following notation convenient :
syms s x
int(f,x,c-iinfty+c,c+iinfty) ?
Thanks
matlab
Let $f(s)$ be a function. I would like to compute the following integral using Matlab
$$
I=int_{c-iinfty}^{c+iinfty}f(s)s^{-s}ds.
$$
How can we use Matlab to evaluate this integral.
Is the following notation convenient :
syms s x
int(f,x,c-iinfty+c,c+iinfty) ?
Thanks
matlab
matlab
edited Nov 16 at 11:01
Jean Marie
28.1k41848
28.1k41848
asked Sep 30 at 15:39
Monir
116
116
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
You aren't allowed to use $infty$ (which is "inf" with Matlab) in such a case.
You have to replace it by a large enough number.
Here is the right way to do it, through an example (which is in fact classical)
clear all;close all;format long
a=rand;
f=@(z)(exp(z.^2));
I=integral(f,a-i*1000,a+i*1000)
J=i*sqrt(pi)
% theoretical result : I = J whatever the value of a
% practical result : I and J coincide up to the 15th decimal place !
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You aren't allowed to use $infty$ (which is "inf" with Matlab) in such a case.
You have to replace it by a large enough number.
Here is the right way to do it, through an example (which is in fact classical)
clear all;close all;format long
a=rand;
f=@(z)(exp(z.^2));
I=integral(f,a-i*1000,a+i*1000)
J=i*sqrt(pi)
% theoretical result : I = J whatever the value of a
% practical result : I and J coincide up to the 15th decimal place !
add a comment |
up vote
0
down vote
You aren't allowed to use $infty$ (which is "inf" with Matlab) in such a case.
You have to replace it by a large enough number.
Here is the right way to do it, through an example (which is in fact classical)
clear all;close all;format long
a=rand;
f=@(z)(exp(z.^2));
I=integral(f,a-i*1000,a+i*1000)
J=i*sqrt(pi)
% theoretical result : I = J whatever the value of a
% practical result : I and J coincide up to the 15th decimal place !
add a comment |
up vote
0
down vote
up vote
0
down vote
You aren't allowed to use $infty$ (which is "inf" with Matlab) in such a case.
You have to replace it by a large enough number.
Here is the right way to do it, through an example (which is in fact classical)
clear all;close all;format long
a=rand;
f=@(z)(exp(z.^2));
I=integral(f,a-i*1000,a+i*1000)
J=i*sqrt(pi)
% theoretical result : I = J whatever the value of a
% practical result : I and J coincide up to the 15th decimal place !
You aren't allowed to use $infty$ (which is "inf" with Matlab) in such a case.
You have to replace it by a large enough number.
Here is the right way to do it, through an example (which is in fact classical)
clear all;close all;format long
a=rand;
f=@(z)(exp(z.^2));
I=integral(f,a-i*1000,a+i*1000)
J=i*sqrt(pi)
% theoretical result : I = J whatever the value of a
% practical result : I and J coincide up to the 15th decimal place !
edited Nov 16 at 23:11
answered Nov 16 at 11:22
Jean Marie
28.1k41848
28.1k41848
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2936804%2fcomplex-integral-using-matlab%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown