Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Propagate Gaussian uncertainty through NDSolve
ResourceFunction["NDSolveAround"][eqns,{u},{x,xmin,xmax}] numerically solves ordinary differential equations eqns containing Around quantities for the function u with the independent variable x in the range xmin to xmax. | |
ResourceFunction["NDSolveAround"][eqns,{u},{x,xmin,xmax},{y,ymin,ymax}] solves the partial differential equations eqns over a rectangular region. | |
ResourceFunction["NDSolveAround"][eqns,{u},{x,y}∈Ω] solves the partial differential equations eqns over the region Ω. | |
ResourceFunction["NDSolveAround"][eqns,{u},{t,tmin,tmax},{x,y}∈Ω] solves the time-dependent partial differential equations eqns over the region Ω. | |
ResourceFunction["NDSolveAround"][eqns,{u1,u2,...},...] solves eqns for the functions ui. |
"AroundReplaceOrder" | 1 | series expansion to order by which the uncertainty is propagated |
"NDOptions" | {Method -> EulerSum} | options to pass to internal calls of ND |
Solve a first-order ordinary differential equation with uncertainty:
In[1]:= | ![]() |
Plot the solution with error bars:
In[2]:= | ![]() |
Out[2]= | ![]() |
Plot the function and its derivative with 2D error bars:
In[3]:= | ![]() |
Out[3]= | ![]() |
Compute the derivatives of the "Value" and "Uncertainty" of the Around quantities independently and re-bundle them inside of Around:
In[4]:= | ![]() |
Out[4]= | ![]() |
System of ordinary differential equations with uncertainty in the parameters:
In[5]:= | ![]() |
In[6]:= | ![]() |
Out[6]= | ![]() |
Solve the heat equation in one dimension with uncertainty in the thermal diffusivity:
In[7]:= | ![]() |
In[8]:= | ![]() |
Out[11]= | ![]() |
Use higher order series expansions to propagate the gaussian error:
In[12]:= | ![]() |
Out[13]= | ![]() |
Compare the results to an analytical solution using AroundReplace:
In[16]:= | ![]() |
Out[20]= | ![]() |
Perform a Monte Carlo Simulation and compare the results to the values predicted using NDSolveAround:
In[21]:= | ![]() |
Out[26]= | ![]() |
In contrast to NDSolve or NDSolveValue, NDSolveAround requires the function specifications to be given in a list:
In[27]:= | ![]() |
In[28]:= | ![]() |
Out[28]= | ![]() |
In[29]:= | ![]() |
In[30]:= | ![]() |
Out[30]= | ![]() |
If the ND Scale and Terms options are not sufficient there may be significant error in the predicted values:
In[31]:= | ![]() |
Out[36]= | ![]() |
Wolfram Language 13.0 (December 2021) or above
This work is licensed under a Creative Commons Attribution 4.0 International License