Function Repository Resource:

NVariationalBound

Source Notebook

Search numerically for the values of parameters of a trial function that extremize a functional

Contributed by: Wolfram Research

ResourceFunction["NVariationalBound"][f,u[x],{x,xmin,xmax},ut,{a,a0},{b,b0},]

numerically searches for values of the parameters a,b,… of a trial function ut, starting from a=a0,b=b0,…, that extremize the functional , where the integrand f is a function of u, its derivatives and x.

ResourceFunction["NVariationalBound"][f,u[x,y,],{{x,xmin,xmax},},ut,{a,a0},{b,b0},]

searches for values of the parameters of a trial function of two or more variables.

ResourceFunction["NVariationalBound"][{f,g},u[x],{x,xmin,xmax},ut,{a,a0},{b,b0},]

searches for values of the parameters that extremize the ratio , where the integrands f and g are functions of u, its derivatives and x.

Details and Options

ResourceFunction["NVariationalBound"] returns the extremal value of the functional as well as the optimal parameter values.
ResourceFunction["NVariationalBound"] uses FindMinimum to search for values of the parameters that extremize the functional.
A parameter specification of {a,a0,a1} searches for an extremum using a0 and a1 as the first two values of a, avoiding the use of derivatives.
A parameter specification of {a,a0,amin,amax} searches for an extremum, stopping the search if a ever gets outside the range amin to amax.

Examples

Basic Examples (2) 

Eigenvalue problem for a third-order ordinary differential equation:

In[1]:=
eqn = y'''[x] + 7  y''[x] + Pi  y'[x] == \[Lambda] y[x];
In[2]:=
sol = Assuming[ Re[c] < 0, ResourceFunction["NVariationalBound"][{y[x] eqn[[1]], y[x]^2}, y[x], {x, 0, Infinity}, E^(c x), {c, 1}]]
Out[2]=

The solution fits the equation well in this case:

In[3]:=
y[x_] = E^(c x) /. sol[[2]]
Out[3]=
In[4]:=
eqn[[1]] - eqn[[2]] /. {\[Lambda] -> sol[[1]]} // Chop
Out[4]=
In[5]:=
Clear[y]

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 1.0.0 – 06 February 2019

Related Resources

License Information