All Questions

Filter by
Sorted by
Tagged with
2
votes
0answers
70 views

Lambda calculus reduction in Mathematica

Are there any built-in functions for reducing lambda terms in Mathematica? If not, how might one do it? I've heard of Function, which is good for $\beta$-reduction, ...
2
votes
1answer
36 views

Construction of symmetric function / matching function argument patterns

[Edited for clarification after comment] Suppose that the function f is defined as the linear combination of several translated/reflected functions starting from the primitive f0[x,y,z] ...
1
vote
1answer
76 views

How to pass lists as arguments in NMinimize or FindMinimum?

The following code runs in Mathematica 12. But, I have two problems that I would like to solve: (1) How to pass a list as an argument to the function g in such a way that it can be used seamlessly ...
2
votes
1answer
49 views

How to declare derivatives of a multivariable function as real in order to get Re and Im part of the expression?

Re and Im work properly, with appropriate assumptions, in the example like this ...
4
votes
1answer
61 views

How to define a named constant with evaluation rules similar to GoldenRatio?

I want to define a named constant standing for a more complicated symbolic expression, for example, PlasticConstant for the plastic constant: ...
2
votes
1answer
50 views

Function definition interrupts pattern matching?

I'm trying to redefine NonCommutativeMultiply (NCM) to behave like an anticommuting operator, based on the question here. This involves calling Unprotect on NCM and adding a definition that leaves <...
2
votes
1answer
54 views

RegionMember not returning analytical result

From this question I'm using a function by kglr to find the inequality constraints for a shape. The function is this ...
5
votes
1answer
539 views

Recursive function for Integration by parts algorithm

I need to write a function that performs repeatedly integration by parts on an integral, in views of transferring the derivatives from one function to the other. For example, in the case where the ...
3
votes
1answer
93 views

Jordan product in Mathematica

Does anyone know how to best handle non-associative operations in Mathematica? I am specifically interested in finite commutative Jordan algebras. I would like to construct a product operator x such ...
5
votes
2answers
156 views

Defining general odd function

I would like to define some function $f$ that is odd, $f(-x)=-f(x)$, and can be used in symbolic computations. I am a bit more ambitious than this question and its answers. One way of achieving my ...
14
votes
1answer
321 views

How to define homogeneous functions that respect Euler's theorem of homogeneous functions?

A homogeneous function of degree $k$ is defined as a function that observes the following specification rule: $f(a x_1, a x_2, ..., a x_n) = a^k f(x_1, x_2, ..., x_n)$ (see Wikipedia entry, ...
1
vote
1answer
97 views

Remove part within square brackets for function

So I've defined a variable as follows: q = {{x[t]}, {Φ[t]}} V=0.5*x[t]^2*m^2+0.5*Φ[t]^2*I I've had to differentiate with respect to time so: ...
5
votes
4answers
187 views

Multi-index variable depending on signature of permutation of indices

I do have some multi-indexed variable, e.g. like this \begin{align*}f_{123} &= 1\\f_{345} &= 1/2\end{align*} where $f$ is antisymmetric under permutation of any pair of indices, i.e. e.g. $...
3
votes
2answers
366 views

Why can't FindFit get the proper result in this problem?

Cross-posted in http://tieba.baidu.com/p/4425634583 The mathematica helps me solve one differential equation in numerial method and got the data of the answer,but the taylor series fit is not good in ...
3
votes
2answers
148 views

Computing powers of the operator using symbolic computation

Suppose $t\in\mathbb{R_+}$ - some parameter, $V: \mathbb{R}\to\mathbb{R}$ - some function. I have an operator $S:f\mapsto S[f]$ that maps a function $f$ to a function $S[f]$: $$ S[f](x) = f(x+\sqrt{t})...
4
votes
1answer
268 views

The basic primitive recursive functions

How can the basic primitive recursive functions be expressed in the Wolfram Language? Apparently here's an example for primitive recursion: ...
2
votes
3answers
114 views

Dropping rational coefficients

I have a list of expressions (they all are exact numeric quantities, not containing any variables), some of them have integer or rationals coefficients, or complex coefficients with rational or ...
17
votes
6answers
1k views

How can I evaluate only a single step of a recursive function?

Let's say have a simple recursive function for the Fibonacci sequence f[0] := 1 f[1] := 1 f[n_] := f[n - 1] + f[n - 2] but I want to see how it will expand in a ...
2
votes
1answer
173 views

Defining a function (but not explicitly)

I have a question that must have a simple answer, but googling and searching this website did not produce an answer, so I'm asking it here. I'm working with three variables $x, y, \theta$, and I want ...
3
votes
2answers
162 views

Symbolic multiplicative partitions

Let $p_n\#\equiv\prod_{k=1}^{n}p_k$ (primorial): p[n_] := Times @@ Prime[Range[n]] then the multiplicative partitions of $p_{1,2,3,4}\#$ are $$ \{\{2\}\},$$$$ \{...
2
votes
1answer
415 views

Linearity of a function in Mathematica

I have a function which has something like myFunc[q,a state[c,d]] a could be anything, and I want to tell Mathematica that ...
6
votes
1answer
97 views

How to bail out from a non-applicable transformation function?

I provide a custom function in TransformationFunctions options of FullSimplify that can do a transformation only for some values ...
8
votes
3answers
3k views

Algorithm for parts integration

Sorry if this is a duplicate, I've searched how to do this to no avail. What I'd like to do is a function that integrates by parts $n$ times, i.e $$ \int u(x) v(x) dx = u \left(\textstyle{\int}v\...
7
votes
2answers
397 views

How to implement a formal expectation operator over an unknown distribution?

I need to do some simplification of an expression involving averages over a stochastic variable (in order to verify a long analytical calculation). The easiest way to do that, I figured, were if I ...
5
votes
2answers
1k views

Write a function that returns the logarithmic derivative

How can we write a function that if we input an expression f, it returns the log derivative $\frac{1}{f} \frac{df}{dx}$? We have to use a conditional or pattern ...