# Questions tagged [functions]

Questions about the use of built-in Mathematica functions, including pure functions.

268 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
23 views

### How to substitute part of expression with function variable (Goal: create function that solves expression numerically for one of the variables)

I have a complicated expression that contains N variables. I want to create a function of N-1 that solves for one of those variables Toy example: ...
37 views

### How can I access a list of functions?

I found answers to this question but I don't know how to apply them to the code below. The code below rotates a cube with edges of length 1 by an angle p around the z axis. The origin of the ...
27 views

### Using different functions in summation

I am trying to evaluate the sum $$c(k_1,k_2) = \sum_{a,b}{\Phi^{(2)}_{a,b} w_a(k_1) w_b(k_2)},$$ where $\Phi_{a,b}^{(2)}$ is the second derivative of $\Phi$ with respect to $a$ and $b$ respectively, ...
21 views

### Running out of memory when expanding an symbolic expression using rules.How to handle such cases?

while deriving equations related to dynamics of 6 connected body, I ended up creating about 3000 set of rules,because of which final expression looks simple, now the issue is when i want to ...
57 views

### Infinitesimals in Mathematica

Is it possible to parse for Mathematica the following function ? f[x_] := x + t, Where t is infinitesimal $dx$ ? I work on ...
38 views

### Defining and Squaring an Operator using Mathematica

Hello I have a question regarding the possibility of defining a operator using Mathematica. Essentially what I would like to do is define the following, \begin{gather*} {\mathcal D := \frac{1}{(x^2+...
27 views

### Finding intersections of points from more than two functions

How to find the intersections of points for more than two functions? Say I have f1, f2, and f3. I don't want to do : ...
74 views

### How to constrain parameters of a pure function?

Consider the following definition of splitList: ...
39 views

### Problema simulating FindRoot

I am writing a procedure that simulates the findRoot built-in function using the same code that appears at chapter 6 of $\textit{Programming in mathematica}$ by Paul Wellin. The code is the following....
22 views

### FactorSquareFree::lrgexp: Exponent is out of bounds for function FactorSquareFree. Error

I'm trying to make a two-dimensional contour plot of the temperature of a plate. This is my initial function: ...
27 views

### specify arbitrary number of arguments in a function

I want to design a function like Xor function inside Mathematica which can take an arbitrary number of boolean functions inside it as arguments and xor all the ...
47 views

...
31 views

### Redefine a function on certain values

This question is related to Zero-dimensional matrices, in particular to the answer https://mathematica.stackexchange.com/a/39543/42722. In Mathematica $0 \times n$-matrices are not well-defined, so I ...
64 views

### How to get a function from a numerical integration?

I wold like to know how to get a function from a numerical integration. Here is an example: h[y_?NumericQ] := NIntegrate[y*Sin[Sin[x]], {x, 1, 2}] h[2] Then my ...
18 views

### Problem with makeOperator which yields Polynomials of an operator

Hi Is it possible to improve the macro provided by Jens Polynomial expansion of operator ...
34 views

62 views

### How to turn an algorithm into a function

I have written a script to help me find the several local minima of a dataset. It takes two arguments: the dataset list and an x-coordinate value that tells the script from where to start looking for ...
132 views

### Automating a large operation by making a function

I would like to automate the following operation. To be transparent I shall put my code into separate chunks and explain the process. Suppose I have the following: ...
39 views

### How to define a function in an implicit form

Know the 2-variables function $F(x,y)$. How can I define the function $x\to f(x)$ s.t. $F(x,f(x))=0$?
54 views

### Function works outside For loop but not inside, and loop fails spectacularly

I'm building two lists, each to carry a different representation of the same set of objects. One list, list2, is constructed first; then the second list, ...
69 views

### How to list all the possible functions of given structure?

I can run this command : Tuples[{ Tuples[{x, y, z}, 2], {a, b, c}}] to list all combinations that looks like: ...
43 views

### Function iteration

I wrote a function in Mathematica that applies certain construction steps on the "incidence matrix" of a graph in order to obtain a new graph with certain properties. These construction steps can be ...
43 views

### Obtaining the equation type of an interpolated function

I used InterpolatingFunction on a set of points. How can I know the type of that equation ? (polynomial, sinusoidal, logarithmic,etc...). I am looking for a general case answer. Here is an example ...
74 views

### Problems with creating a matrix with functions

I have a function which gives me all the coordinates of a certain bloc in a lattice (with the help of another function for rows and columns): ...
21 views

### Error while defining custom matrix function

I'm trying to define a custom matrix Ry with a parameter x, in Mathematica. ...
36 views

### How to graph a text as a function of some arbitrary parameters?

I'm trying to graph a text in a couple of plots I have. I want to be able to edit the text depending on the values I choose (rho0, zp, zm, temp, ion, and perm) and show them at some point in my plot (...
101 views

### How to solve “Coordinate should be a triple of numbers”?

Something seems different with duplicated question "How to solve this error? āshould be a triple of numbers or a Scaled form.ā ", MMA tips may tell that Abs do not ...
55 views

### How to find a domain at which a function is non-zero

Consider some function f[x,y]. Is there any way to find a domain at which it is non-zero? Namely, I would like to compute the integral ...
37 views

### Defining a function through an ODE containing unspecified operators

I want to do some algebra using a function only defined through a DE containing unspecified operators. The DE is $$\partial_zu(z) = \left[\hat{D}+\hat{N}(z,u)\right] u(z).$$ Here $u$ lives in ...
52 views

### How to exclude some methods?

Can I exclude one or several methods from methods tried by a function? When we use some 'algorithm-intensive' function, we can often specify whether we want to proceed according to the chosen method ...
105 views

### How to handle exceptions and failures in Mathematica?

In python I can write fallback values like: ...
59 views

...