Questions tagged [functional]

Questions related to functional methods, e.g. functional differentiation and integration.

Filter by
Sorted by
Tagged with
0 votes
0 answers
99 views

Use Mathematica to derive the probability distributions using the Principle of Maximum Entropy

I am reading the article of Deriving probability distributions using the Principle of Maximum Entropy and I am trying to derive some of the equations in it automatically using Mathematica. 1. ...
benjaminchanming's user avatar
1 vote
1 answer
99 views

How can I calculate the Euclidean metric in $l^2$ for two functions in Mathematica? [closed]

I have two functions, $f(x)=\sin x$ and $g(x)=\sin\frac{pi}{4}x$, and I want to calculate the average Euclidean metric as an expected value to score for the average distance between the two functions ...
Vangsnes's user avatar
  • 561
6 votes
1 answer
281 views

How to define a functional by the way it acts on its own output

I want to define a functional E by using the property E[ E[f[x]] ] := E[f[x]] for some arbitrary function f[x]. Meaning, that I ...
Demoncracy's user avatar
9 votes
5 answers
547 views

How do I map a function pairwise?

Given a list of pairs: data = {{a,b},{c,d},{e,f},{g,h},{i,j}} I need the moving map: MapPair[F,data] ...
QuantumDot's user avatar
  • 19.5k
2 votes
1 answer
188 views

How to reproduce Asymptotic Bounds of Recurrences in Wolframalpha

In Wolframalpha's Examples for Recurrences, there are bunch of Asymptotic Bounds of Recurrences examples, like this It can get perfect result: ...
maplemaple's user avatar
1 vote
1 answer
88 views

Why each iteration takes longer than previous one when using VariationalD in this loop?

I have a function $f$, and I would like to modify it iteratively to approach another one called $a$ (not because I think this is the best way to do anything, but for experimentation). For this, I use <...
zabop's user avatar
  • 137
2 votes
1 answer
184 views

How to get numerical value of functional derivative at specific point

I have a functional in the form: $$F[s(x)]=\int_0^1(s(x)-a(x))^2\mathrm{d}x$$ where $a(x)$ is a parameter function, and I would like to find the functional derivative of $F$ with respect to $s$. ...
zabop's user avatar
  • 137
0 votes
2 answers
139 views

How to declare that a function is arbitrary then specify them later? [duplicate]

I need to evaluate an expression, sum in this case, involving an arbitrary function. Below is a simplified version of what I wanted to do: ...
khvillegas's user avatar
0 votes
0 answers
79 views

Recursively rewrite function

Let's imagine I already have a function like myfac[0] :=1 myfac[n_ /; n>=0] := n myfac[n-1] this home grown factorial. Now I want to equip it with tracing (and ...
atdotde's user avatar
0 votes
1 answer
63 views

How to compose an algorithm to create new array (based on array data), if I need a reference to an array being created, no for loop, in mathematica?

I have an array with either 1 or 0. From this, I am trying to create a new array with intervals. I have some base interval, one step, we can say 1 second here. If there is 0, I skip, if there is 1 I ...
dzCodes's user avatar
0 votes
1 answer
154 views

Implementing an optimization algorithm in WL

I am trying to implement the Jaya optimization algorithm (Jaya). This is a flowchart from the Author 's webpage showing the details of the Algorithm. Note that there is a typo in the equation in the ...
Mahamed Omran's user avatar
0 votes
0 answers
38 views

Solving constraint optimization problem for different intervals using VariationalD

I have been trying to solve for a constraint optimization problem (which eventually yields to a Laplace distribution). Consider the following equation (1) \begin{equation*} J=\int^{\infty}_{-\infty} p(...
Pedro Jesus's user avatar
7 votes
3 answers
450 views

How to Solve Functional Differential Equation

I tried to solve this equation numerically. eqnEx = x''[t] + x[2 t] == 0; NDSolve[{eqnEx, x[1] == 10, x'[1] == 0}, x[t], {t, 1, 10}] Two important character of the ...
OneMoreLovely's user avatar
1 vote
2 answers
168 views

Power series expansion in terms of a function

I have a two variable function z[x,y] = f[x,y] + g[x,y], such that I know the functional form of f[x,y] but not of ...
PPIP's user avatar
  • 13
4 votes
2 answers
190 views

How can I solve a functional equation with domain restrictions?

I have three properties for a function: ...
LightninBolt74's user avatar
4 votes
4 answers
790 views

How do I define functionals in Mathematica?

When I write W[f_] := Integrate[f[x], {x, 0, π}] I may rightly conclude that W[Sin] = 2, ...
Quasar Supernova's user avatar
1 vote
1 answer
96 views

Is it possible to solve a PDE in NDSolve for a simple functional PDE where the dependent variable is evaluated at a point?

Is it possible to configure NDSolve to approximate solutions of a PDE where the state variable is evaluated at a point? Mathematica detects such a PDE as a delay equation, but clearly all that is ...
Carmen Chicone's user avatar
0 votes
1 answer
91 views

Could not able to set up a differential equations using EulerEquations command

I have a constructed the Lagrangian of a mechanical system by finding the kinetic and potential energy of the system. Then I tried using EulerEquations to set up a differential equation by taking the ...
acoustics's user avatar
  • 1,699
0 votes
1 answer
513 views

How do I compute the infinity-norm of a function? [closed]

I have a technical question on Mathematica 11. I have to compute the $\infty$ norm of q function, $f(x,y)$, on a rectangular domain $[a, b] \times [c,d]$. How can I do this with Mathematica?
Ire's user avatar
  • 33
6 votes
1 answer
1k views

How to compute symbolically the Legendre transform of a function?

Is it possible to compute symbolically the Legendre transform of a function in Mathematica? I find no LegendreTransform function.
a06e's user avatar
  • 11.1k
9 votes
1 answer
532 views

Non-trivial functional derivatives

Looking for ways to calculate functional derivatives in Mathematica, I found this question. The answer by Jens points to a documented application of DiracDelta ...
Janosh's user avatar
  • 1,281
1 vote
2 answers
158 views

Define a functional and nest it with its arguments

I'm looking for a definition of a functional f which works correctly with varying arguments t while it will be nested. For ...
Drakonomikon's user avatar
1 vote
1 answer
107 views

How to call a function with an arbitrary list as its arguments inside a functional? [duplicate]

I have the following functional defined (i.e. a function of another function) where variableList contains the variable (arguments if you wish) of the ...
Milad P.'s user avatar
  • 197
2 votes
2 answers
209 views

Select Only Positive Values and Prepend a Title

I have the following list: ...
Terry Price's user avatar
3 votes
1 answer
132 views

Using functionals in Mathematica [duplicate]

I recently installed Mathematica and I wanted to define a functional in it. This is what I did: ...
Sunil S.'s user avatar
  • 135
1 vote
1 answer
1k views

Using NDSolve initial conditions as parameters for a function and then a replacement rule

I am trying to make a function based on two initial conditions of a set of differential equations: ...
random0303's user avatar
0 votes
1 answer
205 views

Transpose four lists of data into two lists for use in List Plot [closed]

I have four lists of data x1 = {1,3,5,7} y1 = {0,2,4,6} x2 = {10,12,14,16} y2 = {8,10,12,14} In one line is it possible to use transpose to get two lists which ...
olliepower's user avatar
  • 2,224
2 votes
0 answers
129 views

How to implement time dependence in the DoFun package?

DoFun is a very usefull mathematica package that helps to write Dyson-Schwinger and FRG flow equations when these are to complex to write down by hand. You can download it here and read it's manual ...
Steven Mathey's user avatar
0 votes
1 answer
83 views

Folding 3-variate function with 2 iterator

I have a function say $f$ and some initial point $x$ and pairs of iterators $\{\{a_1,b_1\},\{a_2,b_2\},...\}$ I want to foldlist as follows: $\{x,f[x,a_1,b_1],f[f[x,a_1,b_1],a_2,b_2],...\}$ can ...
user13892's user avatar
  • 9,113
5 votes
1 answer
108 views

Computing list elements that refer to earlier elements and two other lists without iteration

I am attempting to compute the elements of a list, $\{a_i\}$ given lists $\{b_i\}$ and $\{c_i\}$ using the following formula: $a_i = \frac{1}{c_1}(b_i - \sum_{j = 2}^{i}c_{j}a_{i-j+1})$ for $1\leq i \...
user10108's user avatar
0 votes
0 answers
551 views

Boundary value problem: complicated functionals

I am trying to solve a non-linear boundary value problem where the differential equation is a convoluted function of the variable I am trying to solve for. The equation below presents the final form ...
Sayani Majumdar's user avatar
1 vote
0 answers
288 views

Optimizing a functional using variational calculus

Here I am, trying to get the trajectory $(x(t),y(t))$ that will minimize the following Lagrangian (i.e. the integrand of the functional) between $(-1,-1)$ and $(-1,y_{eff})$ where $x_{eff}$ is defined ...
NSERC Protester's user avatar
1 vote
1 answer
215 views

Apply function to output of previous function

I am trying to write a function that takes 3 tuples. Each tuple contains two lists which are first divided. This results in 3 lists. Then I want to take the Mean of all the columns. I can do this ...
olliepower's user avatar
  • 2,224
0 votes
1 answer
124 views

Solve equation with two different sets of replacement rules

I want to solve eqn for c0 in the following code. I want to do it with both replacement rules. I realize I could just use solve ...
olliepower's user avatar
  • 2,224
2 votes
1 answer
1k views

MapThread multiple functions onto multiple lists

I'm trying to learn the functional style which seems to prevail in Mathematica. I'm having trouble accomplishing the following: Let's say I have multiple lists of arbitrary data (using two lists ...
phosgene's user avatar
  • 400
2 votes
0 answers
87 views

Different delays in notebook and command-line?

I was surprised by the following sequence of expressions: Remove[foo$, bar$]; foo$ = Function[Set[bar$, 42]]; At this point, I expected ...
Reb.Cabin's user avatar
  • 8,651
6 votes
1 answer
762 views

Functional programming Style & Performance

Hello i have been spending time to convert my R tools into Mathematica Packages mainly because i like the functional programming style in Mathematica. In doing so it seems that i run into one ...
bernddude's user avatar
  • 161
26 votes
6 answers
4k views

Looking for a way to insert multiple elements into multiple positions simultaneously in a list

I would like to take the following data: insertValues = {r, x}; insertPositions = {{1}, {5}}; originalList = {a, b, c, d, e, f, g}; and generate output that ...
Todd Allen's user avatar
  • 2,114