Write a fortran program that can solve a differential equati

Write a fortran program that can solve a differential equation using Eulers Method.

Solution


implicit none
real, dimension (10)::x,y
integer::j
real ::x0,y0,n,g
read(*,*) x0,y0,n
x(1)=x0
y(1)=y0
print*,\"for x=\",x(1) , \"y=\",y(1)
j=2
do
x(j)=x(1)+(j-1)*n
y(j)=y(j-1)+n*g(x(j-1),y(j-1))
if (x(j).gt.M) exit
print*,\"for x=\",x(j) , \"y=\",y(j)
j=j+1
enddo
end
real function g(x,y)
implicit none
real ::x,y
g=\"\"write your function here)
end


M is the maximum value that can be taken by x

Write a fortran program that can solve a differential equation using Eulers Method.Solution implicit none real, dimension (10)::x,y integer::j real ::x0,y0,n,g

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site