\begin{align*}

\hat{f}(x,y,z) &= \sum_{j=n}^{m} f(x_j) \prod_{k=n,k\neq j}^m \frac{(x-x_k)}{(x_j – x_k)} \frac{(y-y_k)}{(y_j – y_k)} \frac{(z-z_k)}{(z_j – z_k)} \\

\hat{f}(x,y,z) &= \sum_{j=n}^{m} f(x_j) \mathcal{L}_{j}(x,y,z)

\end{align*}

One can see this is valid because if you evaluate the set of Lagrange Polynomials, aka $\lbrace \mathcal{L}_{j}(x,y,z) \rbrace_{j=n}^{m}$, at say $(x_k,y_k,z_k)$, you will find $\mathcal{L}_{j}(x_k,y_k,z_k) = \delta_{jk}$, where $\delta_{jk}$ is the Kronecker Delta and is defined as:

\begin{align*}

\delta_{jk} &= \begin{cases}

1 & j = k \\

0 & j \neq k

\end{cases}

\end{align*}

This Kronecker Delta property is one that defines the Lagrange Polynomials, thus making the formula above correct.

]]>Sorry for the delay, I have had a lot going on for the last month. I will probably setup a Visual Studio project (using VS 2015 though) that you can download soon so you can have something working on Windows. It might take until early January, which is when I will have some time off from work.

Best,

Christian ]]>

Thank you so much for the speedy reply. I have uploaded this project into Github, here is the site address:

https://github.com/tuananhlemta/MissileCalc_Chris

I used visual studio 2013 to create this project which based on your files. Please help me to check some errors bugs occurred.

Thank you very much.

Best regards,

Tommy ]]>

Second, the errors I see are partly due to linking issues where it thinks you’re trying to generate object code that has already been made. The ambiguity might also be because vec3 is defined a second time in some other part of the code, making its use ambiguous. I would have to see the Visual Studio project to be sure.

Best,

Christian

Thank you for your message, i’m glad to read something useful from your explain. I have tried to create a project in Visual C++ 2013 by using your code in the terms of the “missile Simulator” as you guided but there are some errors occurred and i really don’t know how to debug them. I need your help to successfully compile this work. I usually using the Matlab/Simulink software to simulate flight dynamics and control based on FDC model but it’s not good idea to ensure simulation in real time. I will post all of errors occurred bellow and please help me to solve them. Thank you very much.

error C2872: ‘vec3’ : ambiguous symbol

i think this error occurred in the function :

NED CoordTransforms::NEDtoENU(const NED & vec){

return vec3(vec[1], vec[0], -vec[2]);

and when i tried to change the return of function as:

return NED(vec[1], vec[0], -vec[2]);

After that there are some errors generated:

error LNK2005: “public: double __thiscall Fraction::convert(void)const ” (??$convert@N@Fraction@@QBENXZ) already defined in Fraction.obj

error LNK2005: “public: double __thiscall Fraction::convert(void)const ” (??$convert@N@Fraction@@QBENXZ) already defined in Fraction.obj

error LNK1169: one or more multiply defined symbols found \Visual Studio 2013\projectcu\MissileSim_Chris\Debug\MissileSim_Chris.exe 1 1 MissileSim_Chris

I appreciate you taking the time to read my questions. Thank you again!

Tom

Thanks for the compliment, glad you’re getting something out of this! In terms of MPC, I personally don’t have much experience implementing things with that yet. I could certainly look up things related to it, but that wouldn’t be too useful since you could as well. In terms of Neural-Filters, the only stuff I have seen previously was ADELINE styled filters. I have tinkered with that and implemented some for time-series estimation, though I have found using nonlinear activation functions can be quite good compared to just a linear approach. Where are you at with those topics?

In terms of the MissileSim code I have on GitHub, the “history.txt” file is actually the output file of the simulation. You could change that path in there to something you want and have it output data. At the moment, that code base doesn’t use an input file since I still haven’t setup certain models (like the thrust model and sensor models for the missile), so technically you could take the code and run with it as long as you have the dependencies (which might be some of my other projects on my GitHub).

Let me know if you have any other comments or questions!

Best,

Christian