3
votes
1answer
120 views

Gateaux (directional) derivatives and higher order differentials of a functional

I would like to calculate the Gateaux derivative of a functional (i.e. a function depending on functions). A simple example for the Dirichlet functional: $L(u(x))=\int_0^1 \frac{1}{2} (u'(x))^2 dx$ ...
1
vote
1answer
77 views

How to input pure function to package?

I would like to input a pure function into a custom written package, but am running into a variety of errors. The package I have created is as follows: ...
1
vote
2answers
115 views

Summing Over a Variable Number of Indices

I am trying to figure out the best way to include a variable number of indexes of summation in a program. For example: Suppose I want to define a function $g[n,s]$ that returns the sum ...
2
votes
2answers
474 views

Q-Function representation in Mathematica

I observed that there is no Q-function representation in Mathematica. The definition of Q-Function is: \begin{align} Q(x) &= \frac{1}{\sqrt{2\pi}} \int_x^\infty e^{-\frac{u^2}{2}}du \\ ...
1
vote
2answers
142 views

Using mathematical notation

Is it possible to write this function in mathematica exactly as shown, and then run the expression on a dataset? Please note I know that there are several other ways to do this. I am only ...
3
votes
1answer
223 views

NestList with a list inside?

I'm new to Mathematica, and was looking for more efficient ways to implement the Do loop below. a, ...
1
vote
0answers
45 views

Using anonymous functions instead of module or block. Bad idea? [duplicate]

Here is an example function which returns True if a point p is on an (open) line segment (A, B) assuming that Orientation[A, p, B] returns 0 if the three points are collinear: ...
0
votes
1answer
670 views

How can I define a Step-Wise function in Mathematica (Not using Heaviside Step Function)? [closed]

I need to define a function, which has very different behaviour in different regions. There are about 13 different regions. A sample of my function is the foloowing table: I want to define it as a ...
2
votes
3answers
204 views

Defining a function to determine when convergence is guaranteed

I'm investigating how many iterations are needed for a particular orbit to reach a fixed point of a function. Since I have many functions to test, I want to define a function in Mathematica that will ...
4
votes
4answers
293 views

Differentiating space curves

I'm trying to do some very basic differential geometry of space curves. For example, a space curve $\gamma:\mathbb R\to\mathbb R^3$ has unit tangent and normal vectors given by ...
2
votes
1answer
192 views

Can my permutations function be defined using iteration?

I have two functions, tuples and perm. They are similar. ...
2
votes
0answers
77 views
6
votes
3answers
360 views

How can I rewrite this with NestList or FoldList?

The original code used For: ...
4
votes
2answers
177 views

How can I improve this trial division procedure?

My background is procedural programming, so I find this construction quite natural. Is there a way to get rid of the While? ...
4
votes
6answers
207 views

Filter list with different list in it

I have a list like: {{{4, 14}, 1}, {{4, 15}, 1}, {{4, 16}, 1}, {{4, 17}, 1}, {{4, 18}, 1}, {{4, 14}, 3}, {4,15}, {{4, 16}, 2},{4,18}} Now I want to ...
3
votes
1answer
228 views

Evaluating a function on permutations of its arguments

Say I have a function "temp" of $n+1$ variables, $y,z1,z2,z3,...,zn$. I want to test if my function has certain symmetries like swapping $y$ with square of any $z$, swapping any two of the zs, ...
4
votes
2answers
303 views

Define product derivative

How do I define the $n$th product derivative of a function in Mathematica? The first product derivative $f^\ast$ of a function $f$ is $$ f^\ast(x)=\exp\left(\frac{f^\prime(x)}{f(x)}\right) $$ The ...
1
vote
2answers
133 views

How can define a set of nested parameters

I would like to know how I to define a function with a nested set of parameters (or whatever you would like to call it). For example, how would I get the following function ...
17
votes
3answers
726 views

Using pure functions in Table

I need a table with the elements made of pure functions and list elements. This is a simplified example: I need a list as: ...
2
votes
3answers
199 views

Ways to change an explicit function into a pure function

I'm trying to use FixedPoint to solve a transcendental equations, but the first argument of the FixedPoint should be a pure ...
4
votes
1answer
226 views