| 查看: 335 | 回复: 0 | ||
springer_木虫 (著名写手)
|
[求助]
上三角法解线性方程组,虽然没报错,但结果不正确。大神们帮忙看看
|
|
上三角法解线性方程组,虽然没报错,但结果不正确,大神们帮忙看看 program main implicit none integer,parameter :: n=4 real :: A(n,n),b(n),x(n) A = reshape([2,1,3,4,0,3,2,5,0,0,7,3,0,0,0,2],[4,4]) b = [50,49,53,12] call uptri(A,b,x,n) write(*,101) x 101 format (T5,'计算结果',/,'x=',4(/F12.6)) end program main subroutine uptri(A,b,x,n) implicit none integer :: i,j,n real :: A(n,n),b(n),x(n) x(n) = b(n) / A(n,n) do i = n-1,1,-1 x(i) = b(i) do j =i+1,n x(i) = x(i) - A(i,j) * x(j) end do x(i) = x(i) / A(i,i) end do end subroutine uptri |
» 猜你喜欢
博士延得我,科研能力直往上蹿
已经有7人回复
退学或坚持读
已经有27人回复
面上基金申报没有其他的参与者成吗
已经有5人回复
有70后还继续奋斗在职场上的吗?
已经有5人回复
遇见不省心的家人很难过
已经有22人回复
多组分精馏求助
已经有6人回复

找到一些相关的精华帖子,希望有用哦~
求fortran计算方法指导 14元非线性方程组 之前8元的使用bfs法能解14元解不了呀求指导
已经有4人回复
求大神帮忙拟合一个非线性方程,求出模型参数
已经有15人回复
数学小白求助,解超定非线性方程组,求大神帮忙
已经有4人回复
求助,用1stopt解方程组,两次得到的解不唯一?什么原因,大神帮忙
已经有6人回复
sos!!1stopt解非线性方程组,一直出现常数定义错误的问题!求大神帮助!
已经有12人回复
求大神帮忙解病态线性方程组
已经有5人回复
科研从小木虫开始,人人为我,我为人人













回复此楼
点击这里搜索更多相关资源