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为时间增量。
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为时间增量。
赠送金币帖,要送出 10 个金币