当前位置: 首页 > 程序语言 >fortran语言编写的直线方程不知道对不对,请教大牛

fortran语言编写的直线方程不知道对不对,请教大牛

作者 MYHG900510
来源: 小木虫 150 3 举报帖子
+关注

程序:(直线方程)
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为时间增量 返回小木虫查看更多

今日热帖
  • 精华评论
  • Bruce_lee

    没有学过fortran哎,祝福~~

  • jjdg

    1.你这不是一个完整的程序,没看明白你到底想要实现什么?
    2.你的变量都不声明的吗,

猜你喜欢
下载小木虫APP
与700万科研达人随时交流
  • 二维码
  • IOS
  • 安卓