Results no good when summing total differential about transport of a vector

60 Views Asked by At

I think that my issue could be solved on this forum because this is about mathematic and numerical problems. If you think this is not the right place, please let me know.

I have coded an application which reproduces the transport of a vector along a geodesic (actually called "great circle" because I consider a spherical surface).

You can use it on the following link :

[transport animation][1]

The following image represents the starting scene of animation :

Starting scene of animation

Once image is loaded, you can click on it to see the full window, change parameters on the right-top menu like angles of rotation along Ox and Oz axis, and starting vector coordinates (theta and phi components).

Finally, you can launch animation by clicking on "Start" button.

The yellow circle is the geodesic.

The shadow plane represents the tangent plane of the current point of geodesic (it is always face to the user. theta and phi basis vectors are represented by pink vectors).

You can see that turquoise vector is the initial vector and the green one is the transported vector (its angle with yellow geodesic is always the same).

This transport makes change the coordinates of green vector in local tangent plane (i.e shadow window) : these changes are ruled by computing the total differential of each vector component (the formula are located at the top-left window).

As you can see in output results called "Total differential for current Interation", I compute the value of $\text{D}v^{\theta}$ and $\text{D}v^{\varphi}$ between 2 consecutive iterations on the yellow great circle.

Here's below a figure representing the current value of tangent plane origin ($\theta,\varphi$) when I browse along the geodesic :

Longitude and latitude

Here's below the figure representing the value of total differential for each iteration, (actually, like I said above, I compute the total differential between 2 consecutive iterations), up to the end of animation that I have performed by clicking on "Pause" button.

total differential for current iteration

On the figure above, These total differentials ($\text{D}v^{\theta}$,$\text{D}v^{\varphi}$) are changing in a cyclic way, and mostly, $\text{D}v^{\theta}$ and $\text{D}v^{\varphi}$ are very closed to zero value (with order of 10^-2 for the amplitude on the figure above) : that are the expected values.

So everything seems to be good except one thing : When I want to do the summation of all previous total differential (for each iteration like above), I don't get a cyclic change and the values for both $\text{D}v^{\theta}$ and $\text{D}v^{\varphi}$ are increasing as and when animation is running.

Here's below the figure illustrating this increase :

integrated total differential with summation

If I do the summation of all terms corresponding each one to only one iteration, I compute :

$$\sum_{i=1}^{n} (\text{D}v^{\theta})_i = \sum_{i=1}^{n} (v^{\theta})_{i+1} - (v^{\theta})_{i} - (v^{\varphi})_i\, \text{sin}\theta_{i} \text{cos}\theta_{i} (\varphi_{i+1}-\varphi_i) $$

$\implies$

$$\sum_{i=1}^{n} (\text{D}v^{\theta})_i = (v^{\theta})_{n+1} - (v^{\theta})_{1} - \sum_{i=1}^{n} v^{\varphi}_i\, \text{sin}\theta_{i} \text{cos}\theta_{i} (\varphi_{i+1}-\varphi_i)$$

and the same king of computing for : $$\sum_{i=1}^{n} (\text{D}v^{\varphi})_i$$

My main isue is that I don't understand why the values of integrated total differential are increasing : If I let the animation during a long time, the values can be really different from zero (one excepts always the values to be closed to zero for this integrated total differential, like for only one iteration).

From a mathematic point of view, the total differential (for one interation or by summing) is always equal to zero but here, this is a numerical simulation, so I except values closed to zero, not strictly null.

Maybe, a little error is accumulated at each rotation. However, I thought that error would be itself compensated when I am in positive latitude and negative case (for example or on another criterion), so the summation should be cyclic and not increasing.

If someone could help me to fix this issue, this would be kind.

Thanks

UPDATE 1:

@Professor Vector

Here is the result when I take the half of step used in all above figures : this figure represents the summation of total differential :

integrated total differential with summation and Half step (**0.005 instead of 0.01**)

As you can see, the cumulated error is smaller. If I compare the area of "1000"-th iteration (which corresponds to "500"-th iteration for initial step (I mean the step used in all above figures, i.e step=0.01), the value is about 0.5e-4 with half step whereas the same area for initial step is 2e-4. So I have roughly about a factor 4x between the 2 cases.

Is there a way to prevent this increasing ? I think I could make decrease the error by taking again a smaller step but in this case, animation is very very ... slow.