fortran语言编写的直线方程不知道对不对,请教大牛
程序:(直线方程)
if(cptim.le.0.0d0) then
p1=0d0
end if
if((cptim.gt.0.0d0).and.(cptim.le.40.0d0)) then
p1=s1*(cptim+timinc)
end if
if((cptim.gt.40.0d0).and.(cptim.le.120.0d0)) then
p1=12.5d0+s2*timinc
end if
直线方程:y1=0.3125x (0≤x≤40)
y2=12.5+0.09375(x-40) (40≤x≤120)
s1与s2为直线的斜率,分别等于0.3125与0.09375
cptim为时间增量起始时间,timinc为时间增量 返回小木虫查看更多
今日热帖
没有学过fortran哎,祝福~~
1.你这不是一个完整的程序,没看明白你到底想要实现什么?
2.你的变量都不声明的吗,