Originally Posted by **mehdi6** Hello everybody
does anyone knows how can I map an analytical expression for B to a discrete grid in numeral simulation?
Like the results of numerical MHD simulation which produce discrete data for B. |

I don't what B is, but you could perhaps just loop over your discrete space and sample the analytical function?

Psuedocode (C# style):

Code:

B = new List<double>();
foreach (var xValue in xValues)
{
var value = myAnalyticalFunction(xValue);
B.Append(value);
}
Print(B)

In the above pseudocode, "xValues" is a list of x-axis values. If your function is multi-variate, you can loop over points.