Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Graphs in fortran

  1. Dec 30, 2011 #1
    hello..here is a program..

    and i need to make a graph of tcentre(i) against t(i)..how to do this...

    these variables are bold in the below code

    Code (Text):

    !here are the declaration of variables

    DIMENSION THEETA(10),DF(10),F(10),c(10),b(10),t(10),z(10),sum_1(10),Tcenter(10),r(10),w(10)
    REAL K,THEETA,DF,F,c,b,sum_1,x,z,T0,Tcenter,alpha,r,q
    integer t,y,p,j,l,m,s

    !the assignments of constants
    A = .1
    H = 23.
    SIGMA = 46.
    K = 1.-(A*H/SIGMA)
    EPS = .0001

    ! initial temperature in KELVIN


    !a do loop which caculates and assigns elements to the declared variables
    DO N=1,10
    ! First calculating THEETA value
    RN = N
    ! Then using that THEETA value we get derivative
    ! converting degrees to radians


    DF(N) = 1./COS(r(N)**2)
    ! Then using that same THEETA value we get F
    F(N) = r(N)*(1./K)



    END DO

    ! here starts the loop for generation of roots

    !newton method used


    do l=1,10




        10       x=q-(q*(1./K)/1./COS(q**2))

        if (abs(x-q).lt.eps)goto 20


        goto 10

        end do

        20   w(l)=x

       ! thee roots are printed


        end do


    !-calculation of other variables in the temperature formula

        do p=1,10





       end do

        do i=0,9




    !- this loop calculates the temperature at the centre for each value of time  
    do j=1,10



      write(*,*)'temperature at centre',[B]Tcenter(j)[/B]



      end do

  2. jcsd
  3. Dec 30, 2011 #2


    Staff: Mentor

    Fortran itself doesn't have any graphing capabilities that are part of the language, to the best of my knowledge, but perhaps there are some graphics packages that you can import to do this.

    Are you doing this on your own or is it a part of a class. If it's for a class, your instructor should provide some means for your to be able to graph a set of data.

    If you're doing it on your own or as a work project, either ask someone about graphics packages or do a Web search for something like "Fortran graphics package". That's what I would do.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook