real function p(t, t1, t2, p0)
implicit none
real, intent(in) :: t, t1, t2, p0
real :: r
r = mod(t, t1 + t2)
if (r <= t1 ) then
p = p0
else
p = 0
end if
return
end function p
风平老涡 发表于 2020-8-23 04:51
[mw_shl_code=fortran,true]real function p(t, t1, t2, p0)
implicit none
real, intent(in) :: t, t1, t2 ...
风平老涡 发表于 2020-8-24 22:13
中心思想就是把任意时间 t 转换成(T1+T2)的余数,然后根据余数判断P值。
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |