implicit real*8(a-h,o-z) real*8 a, b integer num, i, n parameter(num=100) real*8 datax(num), datay(num) c read(5,'(i5)') n read(5,'(2f10.5)') (datax(i), datay(i), i=1,n) c c subroutine call *** LSQ *** c (least square method) c call lsq(datax, datay, n, a, b) c write(6,'(a,f10.5,a,f10.5)') 'A = ',a, ' B = ',b c end c================================================================ subroutine lsq(x, y, n, a, b) implicit real*8(a-h,o-z) real*8 x(*), y(*), a, b, sx, sy, xm, ym, sxx, sxy integer i c sx = 0.0d0 sy = 0.0d0 do i = 1 , n sx = sx + x(i) sy = sy + y(i) end do c xm = sx / n ym = sy / n c sxx = 0.0d0 sxy = 0.0d0 do i = 1 , n sxx = sxx + (x(i)-xm)**2 sxy = sxy + (x(i)-xm)*(y(i)-ym) end do c b = sxy / sxx a = ym - b*xm return end
implicit real*8(a-h,o-z) integer m parameter (m=3) real*8 a(m,m+1), x(m) c do i = 1 , m read(5,'(4f10.5)') (a(i,j),j=1,m+1) end do c call gauss(a,x,m) c write(6,'(a,i3,a,f10.5)') ('X(',i,') = ',x(i), i=1,m) end c============================================================= subroutine gauss(a,x,n) implicit real*8(a-h,o-z) integer n real*8 a(n,*), x(*) integer i, j, k c do k = 1 , n do j = k+1, n+1 a(k,j) = a(k,j)/a(k,k) end do c do i = 1 , n if( i .ne. k ) then do j = k+1 , n+1 a(i,j) = a(i,j) - a(i,k)*a(k,j) end do end if end do end do c do k = 1 , n x(k) = a(k,n+1) end do c return end
Ca/N | 0.0121 | 0.0132 | 0.0179 | 0.0202 | 0.0215 | 0.0229 |
---|---|---|---|---|---|---|
Cb/N | 0.233 | 0.288 | 0.364 | 0.525 | 0.588 | 0.639 |
t/min. | 0 | 10 | 20 | 30 | 40 | 50 | 60 |
---|---|---|---|---|---|---|---|
αt/deg. | 2.316 | 2.248 | 2.167 | 2.078 | 2.000 | 1.919 | 1.842 |