ユーマちゃんのブログ

質問・要望はTwitterもしくはコメントで。返信はTwitterで。

2018-01-01から1ヶ月間の記事一覧

Programming Example Report 14

program report14 implicit none real(8)::t,k real,parameter::TOL=1.0D-6 real(8),dimension(5)::NPV,s integer::i s(1)=0.0;s(2)=10.0;s(3)=15.0;s(4)=20.0;s(5)=25.0 do i=1,5 NPV(i)=forming(s(i)) End do k=0.0 do while(forming(k)>=0) k=k+TOL enddo…

Programming Example 13

Program Least_squaresimplicit none ! Global variablesinteger, parameter:: m=4 ! Number of coefficientreal(8):: S(m) ! Array of coefficient Sreal(8), parameter:: TOL=1D-6 ! Numerical tolerancereal(8), dimension(:), allocatable:: X, Y ! Arra…

Programming Example 12 日本語解説版(未完)

Program nonlinear_system! Global variablesinteger, parameter:: m=3 ! Maximum number of variablesreal(8):: S(m), H(m,m) ! Unknown variable vector Sreal(8), parameter:: TOL=1D-6 ! Numerical tolerance Call Guess(S)Call Solve(S) contains Funct…

Programming Example 12

Red characters are codes I wrote by myself today. 2018/01/05 But these can be changed like below using "matmul". --------------------------------------------------------------------- do while ( (err>TOL).and.(k