| 查看: 375 | 回复: 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 |
» 猜你喜欢
欢迎发来filecode的Mz6后的代码验证其规律
已经有94人回复
投稿咨询
已经有4人回复
时间戳变了,能看出什么问题?
已经有5人回复
93BebMhtakh前后11位开头都是大写
已经有5人回复
感觉是下周放榜了
已经有11人回复
filecode=后面第一个是大写字母
已经有10人回复
哪位老哥知道今年的国自然具体哪一天放榜?
已经有15人回复
今天系统多次维护,明天很可能放榜!
已经有9人回复
时间戳又变了8-15
已经有25人回复
2027广东省杰青
已经有6人回复

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










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