# Question:Solve ODE in fourier space numerically and transform to real space

## Question:Solve ODE in fourier space numerically and transform to real space

Maple 2018

Dear all,

consider two lists of complex values :

list1 := [l1,l2,l3,l4,l5]

list2 := [s1,s2,s3,s4,s5].

There is a set of second order differential equation

d^2u(k)/dt^2+I*A*du/dt-B*u=0

where A is sum of elements of list1 and list2 and B is multiplication of their element. Therefore,

d^2u(k)/dt^2+I*(l1+s1)*du/dt-(l1*s1)*u=0

d^2u(k)/dt^2+I*(l2+s2)*du/dt-(l2*s2)*u=0

d^2u(k)/dt^2+I*(l3+s3)*du/dt-(l3*s3)*u=0

d^2u(k)/dt^2+I*(l4+s4)*du/dt-(l4*s4)*u=0

d^2u(k)/dt^2+I*(l5+s5)*du/dt-(l5*s5)*u=0

How can I create a set of differential equations and initial conditions based on nops(list1), then solve this system of differential equations numerically in Maple.

since u[i] are function of k, next step is to transforme them to real space by inverse fourier transform.

finally save the results and plot them.

Note that for simplisity I wrote a linear equation but it is not. so, because of nonlinear terms it is not possible to use superposition of the solution. I have to take them as coupled system of equations.

====

for example

```list1 := [ [0., -5.496799068*10^(-15)-0.*I], [.1, 5.201897725*10^(-16)-1.188994754*I], [.2, 6.924043163*10^(-17)-4.747763855*I], [.3, 2.297497722*10^(-17)-10.66272177*I], [.4, 1.159126178*10^(-17)-18.96299588*I] ]

list2 :=[ [0., -8.634351786*10^(-7)-67.81404036*I], [.1, -0.7387644021e-5-67.76491234*I], [.2, -0.1433025271e-4-67.59922295*I], [.3, -0.2231598645e-4-67.25152449*I], [.4, -0.3280855430e-4-66.56357035*I] ]```

where first element is k and the second value is l_i and s_i

the differential equation is

`ode_u[i]:= diff(u[i](t),t\$2)+I*(list1[i]+list2[i])*diff(u[i](t),t)-list1*list2*u[i](t)=0;`

eta is in fourier space where k values are in list1[i].

We laso know that f(-k)= - f*(k) where f=list[i]

and u[i] as function of k, initially has a Gaussian shape at t=0 in fourier space.. 