## euler.jl # # Discussion: # # Use the Euler method to integrate a simple ODE. # # y(t)=(7.1+(3//10)*sin(t)*exp(3t)- # (1//10)*cos(t)*exp(3t))*exp(-3t) # # Licensing: # # This code is distributed under the MIT license. # # Modified: # # 09 March 2024 # # Author: # # John Burkardt # include( "../euler/euler.jl" ) include( "../timestamp/timestamp.jl" ) print( "\n" ) timestamp( ) print( "\n" ) print( "euler_test():\n" ) print( " Julia version\n" ) print( " Test euler(), which uses Euler's method to estimate the\n" ) print( " solution of an ordinary differential equation.\n" ) F(t,y) = sin(t) - 3 * y tspan = [ 0.0, 1.0 ] y0 = 7.0 n = 8 t, y = euler( F, tspan, y0, n ) display( y ) print( "\n" ) print( "euler_test():\n" ) print( " Normal end of execution.\n" ) timestamp( )