- #1
CMJ96
- 50
- 0
Homework Statement
s=0.140406704
2. Relevant equation
The Attempt at a Solution
So I converted the ODE into the following two equations
$$\frac{dx_1}{dt}=x_2$$
$$\frac{dx_2}{dt}=x_1- \alpha sin(x_2)$$
I have done the following with the program so far, I came to a halt because I am not sure how to define k1 and k2 with functions of 3 variables, also I find it a little confusing that there is a time-step despite there being no t's in the functions?
program ab2
implicit none
integer :: i,n
real :: t,x1,x2,func1,func2,h, t0, x10,x20,s,k11,k12,k22,k21
a=0.5
h=0.01
t0=0
t=t0
s=0.140406704
x10=s
x20=-s
x1=x10
x2=x20
end program
function func1(x1,x2,t)
real :: func1,x1,t,x2
func1= x2
end function func1
function func2(x1,x2,t)
real :: func2,x1,x2,t,a
func2= x1-a*sin(x2)
end function func2