### Author Topic: How to split the x-arrays  (Read 37 times)

#### winther ##### How to split the x-arrays
« on: 25. March 2021, 16:28:50 »
I got a question regarding how one can make the two arrays for tight coupling and the full system. Here is one idea for how to do this:

Make one array from $$x=x_{\rm ini}$$ to $$x=0$$ with N points. Let's say we have something like:
$${\rm xarray} = [-15, -14, -13, -12, ..., 0]$$

Now for a given $$k$$ compute then tight-coupling ends. Let's say this is $$x=-12.5$$. Then figure out what index $$i$$ this corresponds to in the xarray. Note that when tight coupling ends is just an approximation (it holds to great accuracy at much earlier times and does not hold at all at much later times) so if you start slightly later or earlier then that is no big problem at all. So in this case if you start at -12 or -13 instead of -12.5 then thats no problem.

This index is $$i = 3$$ above. Use this to extract out two arrays [i=0 -> i=3] and [i=3 -> i=N] e.g.:
$${\rm xtight} = [-15,-14,-13,-12]$$
$${\rm xfull} = [-12,-11,-10,...,0]$$
where the last point of the first is the same as the first point of the second. Each of these you can pass to the ODE solver and get back results that you then can store in result arrays. This ensures that we get the solution at exactly the same N points every time that you can store in your result arrays (which should also have N points in the x-direction).

« Last Edit: 25. March 2021, 16:30:25 by winther »