Recent content by joseph2015

  1. J

    Python How to Plot y=x^2 Using Matplotlib?

    Thank you very much for your replies and helps
  2. J

    Python How to Plot y=x^2 Using Matplotlib?

    Thanks for your reply. However, it will produce points even if i used line code lines. Joe
  3. J

    Python How to Plot y=x^2 Using Matplotlib?

    import matplotlib.pyplot as plt R = 2 for x in range(0,50): y = x**R # plt.plot(x,y,marker = 'o') plt.plot(x,y,'--') plt.xlabel('X-axis') plt.ylabel('Y-axis') plt.title('plot test') plt.legend() plt.show()
  4. J

    Fortran Fortran subroutine solving for the velocity and displacement of a spring

    The reason I am looking to understand how to put it in the subroutine, is I am looking to learn how to build larger code in the future and use makefiles to compile. In terms of how fast i can't tell for now as they both run in a blink
  5. J

    Fortran Fortran subroutine solving for the velocity and displacement of a spring

    Dear FactChecker the following is the corrected version that works with your helps :), Thanks ====================================================================== program msd implicit none real, parameter :: tstop=100. integer i real, dimension(2000) :: t,y,v open (2, file = "test.txt")...
  6. J

    Fortran Fortran subroutine solving for the velocity and displacement of a spring

    Thank you very much jtbell and FactChecker, the issue was not passing i. I really appreciate your help.
  7. J

    Fortran Fortran subroutine solving for the velocity and displacement of a spring

    I have a simple Fortran code for solving velocity and displacement of spring, the code works fine when writing all together without using a subroutine. but as I am learning Fortran I tried to do it using subroutine, but I keep getting errors appreciate any help in advance. program msd implicit...
  8. J

    Comp Sci Help with solving first order ODE using a simple Fortran code, please

    Thank you very much for your answer I am trying to follow the change of s as a function of time and h, then plot s vs h. for example: if s is a strength of a material, while h is height (from 100 to 1cm), I would like to plot s vs h for 100 years time. Kind regards, Joseph
  9. J

    Comp Sci Help with solving first order ODE using a simple Fortran code, please

    I am trying to solve the following first order ODE using a simple Fortran code : $$ ds/dt=k_i * \sqrt{v}$$ where both (ki) and (v) are variables depending on (h) as follows $$ k_i=\sqrt{χ/h^2}$$ $$v= \mu h$$ where (μ) and (χ) are constants. (the arbitrary values of each of them can be seen...
  10. J

    Fortran Physical time (years) in simulations

    what these have to do with my question? I am really lost!
  11. J

    Fortran Physical time (years) in simulations

    Thank you very much, that helps alot.
  12. J

    Fortran Physical time (years) in simulations

    Hello My name is Joseph I am a physics student, I am new to Fortran, I know how to write a code for solving differential equations, but now I have a physics equation for evolving star rotation as a function of mass. and I do not know how to evolve (using any numerical method, such as Euler) so...
Back
Top