忍者ブログ
PC使って便利なことをメモ
[31]  [30]  [29]  [28]  [27]  [26
×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

\int_0^\infty f(x)\cos\omg x dx
f(x)=-exp(x)

module exp_lib
implicit none
real(8) pi

contains

subroutine calf(f,x)
real(8),intent(in) :: x
real(8),intent(out) :: f
f=exp(-x)
end subroutine calf

subroutine de2_int(sum,em,omg,n,calf)
integer,intent(in) :: n
real(8),intent(in) :: em,omg
real(8),intent(out) :: sum
real(8) h,t,e6,phi,dphi,x,f
integer i
h=pi/(em*omg)
t=0.d0+h*0.5d0
!!$ e6=1.d0
!!$ phi=1.d0/6.d0
!!$ dphi=1.d0/2.d0
e6=exp(-6.d0*sinh(t))
phi=t/(1.d0-e6)
dphi=(1.d0+(-6.d0*t*cosh(t)-1.d0)*e6)/(1.d0-e6)**2
x=em*phi
call calf(f,x)
sum=sum+f*cos(omg*x)*dphi
do i=1,n
t=i*h+h*0.5d0
e6=exp(-6.d0*sinh(t))
phi=t/(1.d0-e6)
dphi=(1.d0+(-6.d0*t*cosh(t)-1.d0)*e6)/(1.d0-e6)**2
x=em*phi
call calf(f,x)
sum=sum+f*cos(omg*x)*dphi
t=-t+h*0.5d0
e6=exp(-6.d0*sinh(t))
phi=t/(1.d0-e6)
dphi=(1.d0+(-6.d0*t*cosh(t)-1.d0)*e6)/(1.d0-e6)**2
x=em*phi
call calf(f,x)
sum=sum+f*cos(omg*x)*dphi
end do
sum=sum*em*h
end subroutine de2_int

end module exp_lib

program exp
use exp_lib
implicit none
external calf
integer n
real(8) em,omg,sum
pi=acos(-1.d0)
sum=0.d0
em=100.d0
omg=1.d0
n=75
call de2_int(sum,em,omg,n,calf)
write(*,*) sum
end program exp
PR
Comment
name 
title 
color 
mail 
URL
comment 
pass    Vodafone絵文字 i-mode絵文字 Ezweb絵文字
コメントの修正にはpasswordが必要です。任意の英数字を入力して下さい。
この記事へのトラックバック
この記事にトラックバックする:
カレンダー
04 2024/05 06
S M T W T F S
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
フリーエリア
最新コメント
最新トラックバック
プロフィール
HN:
trtr
性別:
非公開
自己紹介:
メインにvineを使ってます。
ときどきubuntu。
バーコード
ブログ内検索
Template by Crow's nest 忍者ブログ [PR]