Çözüldü Sinüs İntegral Fonksiyonu - Programlama - Sayısal İntegrasyonda Simpson Yöntemi

Konusu 'Limit ve Süreklilik,Türev,İntegral' forumundadır ve Honore tarafından 12 Ekim 2026 23:33 başlatılmıştır.

Yüklüyor...
  1. Honore

    Honore Yönetici Yönetici

    Mesajlar:
    11.514
    Beğenileri:
    652
    Cinsiyet:
    Bay
    Meslek:
    Müh. (Elk./Bilg.)
    Northern Arizona University'den çözümlü bir problemin fen lisesi klasik sınavı için biraz zorlaştırılmış uyarlaması:

    a ∈ R olmak üzere "Sinüs İntegral Fonksiyonu" Si(a) = (alt sınır x = 0, üst sınır x = a), ∫ ( sin(t) / t ) dt olduğuna göre,
    (alt sınır x = 0, üst sınır x = 2), ∫ ( sin(π·x) / x ) dx integralinin değerini "Si" fonksiyonu olarak bulunuz ve bildiğiniz bir programlama dilinde aynı sonucu 10^(-4) hassasiyetle hesaplayan kodlamayı yapınız.


    [​IMG]
    https://i.ibb.co/Fqx7KD7W/NAU.png
    https://ac.nau.edu/~jws8/classes/136.2024.1/worksheets/ws36s.pdf
    (Sayfa 1, Soru 3)

    Fortran Çözümü:
    [​IMG]
    https://i.ibb.co/230CvBwD/NAU-Fortran.png

    Program:
    Kod:
    ! Revised version of the program at
    ! https://ww2.odu.edu/~agodunov/computing/programs/book2/Ch03/simpson.f90
    Program main
    !=============================================
    ! Integration of a function using Simpson rule
    !=============================================
    implicit none
    double precision :: f, a=0.000001, b=2, integral
    integer :: n=7, i
    double precision, parameter:: pi = 4.*atan(1.0)
    external f
    
    write(*,100)
    
    do i=1,16
       call simpson(f,a,b,integral,n)
       write (*,101) n,integral
       n = n*2
    end do
    
    100   format('        n       Simpson ')
    101   format(i9,f15.6)
    end
    
    Function f(x)
    !----------------------------------------
    ! Function for integration
    !----------------------------------------
    implicit none
    double precision f, x
    double precision, parameter:: pi = 4.*atan(1.0) !remove
    f = sin(pi*x) / x ! a = a = 0.000001, b = 2 için
    return
    end
    
    Subroutine simpson(f,a,b,integral,n)
    !==========================================================
    ! Integration of f(x) on [a,b]
    ! Method: Simpson rule for n intervals
    ! written by: Alex Godunov (October 2009)
    !----------------------------------------------------------
    ! IN:
    ! f   - Function to integrate (supplied by a user)
    ! a   - Lower limit of integration
    ! b   - Upper limit of integration
    ! n   - number of intervals
    !
    ! OUT:
    ! integral - Result of integration
    !==========================================================
    implicit none
    double precision :: f, a, b, integral, s
    double precision h, x
    integer n, i
    
    ! if n is odd we add + 1 to make it even
    if((n/2)*2.ne.n) n=n+1
    
    ! loop over n (number of intervals)
    s=0.0
    h = (b-a) / dfloat(n)
    
    do i=2, n-2, 2
       x = a + dfloat(i)*h
       s = s + 2.0*f(x) + 4.0*f(x+h)
    end do
    
    integral = (s + f(a) + f(b) + 4.0*f(a+h))*h/3.0
    
    return
    
    end subroutine simpson
    WolframAlpha Kontrolu:
    [​IMG]
    https://i.ibb.co/BK6n5YL4/NAU-WA.png
    https://www.wolframalpha.com/input?i=integrate sin(pi*x)/x from x=0..2
     
    : Fortran

  2. Benzer Konular: Sinüs İntegral
    Forum Başlık Tarih
    Limit ve Süreklilik,Türev,İntegral İntegralde Trigonometrik Dönüşüm - Ters Sinüs Hiperbolik Fonksiyon 2 Temmuz 2019
    Katı Cisimler ve Diğer Konular Kosinüs ve Pisagor Teoremleri-2.Dereceye İndirgenen 4 Derece Denklem-Piramit Hacmi Perşembe 11:52
    Katı Cisimler ve Diğer Konular Düzgün Beşgen Piramit Açılımı - Kosinüs Teoremi 3 Eylül 2026
    Ivır Zıvır Sorular - Sohbet (Trivial Questions - Chat) Sinüs Teoremi - Ters Trigonometrik Fonksiyon 6 Ağustos 2026
    Dörtgenler ve Çokgenler Yamukta Açı - Kosinüs Teoremi - İki Bilinmeyenli Denklem 17 Temmuz 2026

Sayfayı Paylaş