- #1
nirajaryal
- 1
- 0
I need to do numerical computation by fourth order Runge Kutta Algorithm
in fortran. But I stuck in programming because the differential
equation contains imaginary part.
Take for e.g. the set of diff.equation are
x'=(i)y *exp(iwt) ;where i is imaginary no. and w is constant!
y'=(i)x*exp(iwt)
I tried to define complex function f and g as
f=(0,y *exp(iwt))
g=(0,x *exp(iwt))
and i defined x and y as real (because the argument of the complex
no.has to be real,right?/otherwise it doesn't accept)
But after every iteration,the x and y becomes real as
x=x0+some linear combination of the function f(which is complex)//and
real +complex gives complex no. and hence shows error!
So i unable to proceed further! So how should I proceed?
in fortran. But I stuck in programming because the differential
equation contains imaginary part.
Take for e.g. the set of diff.equation are
x'=(i)y *exp(iwt) ;where i is imaginary no. and w is constant!
y'=(i)x*exp(iwt)
I tried to define complex function f and g as
f=(0,y *exp(iwt))
g=(0,x *exp(iwt))
and i defined x and y as real (because the argument of the complex
no.has to be real,right?/otherwise it doesn't accept)
But after every iteration,the x and y becomes real as
x=x0+some linear combination of the function f(which is complex)//and
real +complex gives complex no. and hence shows error!
So i unable to proceed further! So how should I proceed?