Questions tagged [functions]

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

234 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
50 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 ...
52 views

How to handle exceptions and failures in Mathematica?

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

Plot BV functions with singular derivatives in multiple space dimension

In 1-dimensional setting, two key examples of $BV$ functions (of bounded variation) $u: \mathbb R \to \mathbb R$ are the Heaviside function, whose derivative is the Dirac delta concentrated at $0$. It ...
56 views

...
47 views

Discrete convolution power

In my previous question we have discussed the posibility of various definition of convolution of power function within Mathematica. Now the question is "How to define convolution power in Mathematica ?...
22 views

Acquire a single-variable function by slicing a 3d graph along a given line

Consider my Calculus 2 math problem: Given a function f[x,y]=x^2-3xy and two vectors a = {1,2} and b = {1,1}. Spanning a linear ...
31 views

To assign an array to a function

// Pre-defined parameter kS = 2*(\[Pi]*NefS)/LambdaSS; Here, NefS is a function of LambdaSS. The matrix m (i,j) defined corresponding value of NefS (jth ...
26 views

How attribute a restrition for a variable inside a function

I have a function like this way: f[x_] := x + 2; In:= f[b + 2] Out= 4 + b How to impose a condition that the variable ...
42 views

Imposing conditions on argument for a function definition

Suppose that I wish to use "Piecewise" to merge two different interpolating functions (obtained via a NDSolve of some ODE), defined over negative and positive arguments respectively, like: ...
31 views

How to automatically see user defined function arguments list?

Having typed a user-created function's name I would like to be able to see either the concise syntax dropdown available for inbuilt functions (shown below left) or alternatively to be able to see the ...
73 views

How to copy a function/list/array without reference

I have code that runs in a loop to generate a function that has values assigned every multiple of a user-supplied step size. I want to copy the final function "value-wise" to a different function so ...
42 views

Defining a derivative as a function does not work

I have a fairly complicated function VIcase1L[b_,\[Epsilon]_, d_] := ....... All I wanted to to was to derive it this function with respect to b and define it. ...
27 views

Minimum of explicit functions in vector form

For fun, related to this question about minimizing implicit functions, how can I find the minimum of an explicit one expressed as a vector? For instance, an ellipse: ...
38 views

Function that once called “erase” every other definition of my notebook

I encounter a really weird effect in Mathematica and I don't know what the wrong thing is nor how to correct it. I work with vectors of four components and I have a minimal set of definitions that I ...
74 views

Find the maximum of a function involved with Floor function

My function is $$f(H,p) = \left\lfloor \dfrac{\lfloor H/p\rfloor + 3 - \sqrt{(\lfloor H/p\rfloor + 1)^2 - 4H}}{2} \right\rfloor$$ The constraints are $H \geq p(4p-1)$, $p$ is prime although ...
43 views

Create a color function from dynamic panel

I would like to generate a color function from the dynamic panel code and use it as I want...instead of using Copy to Clip Board and then past in myTM.... Any idea ?...
24 views

Trouble restricting function images

I am following this book https://www.amazon.com/exec/obidos/ASIN/1558606378/ref=nosim/ericstreasuretro with mathematica and I'm having some trouble on my way: 1) Consider the function ...
105 views

DSolve inverse function

I trying to solve a differential equation DSolve[{D[r[a], a] == 3 r[a]/a (w - (g *(1 + w)*(1 + r[a]))/(1 + g*r[a])),r == r0}, r, a] But the solution is a ...
40 views

Removing numerical instability in plots of functions over large domains

suppose you have a large domain you wish to plot a function over, which depends on numerical values usually around or above you machine precision e.g. ...
43 views

Finding the functions that Mathematica plots while using BodePlot

I've the following Mathematica-code: ...
32 views

How do I combine InterpolatingPolynomial and Integrate?

I want to find a real-valued polynomial (or trig) function f[x] that yields 0 at x=-a, and ...
55 views

Representing an interpolating function

I just want to figure out how to "represent" or to inject an interpolating function into a numerical calculation. So, suppose i have an interpolating function $int$ and then i want to use NDSolve or ...
55 views

Constructing a user function with an integral

Maybe this is a basic task to perform but I haven't found any literature. I am performing a convolution of two functions: ...
60 views

How to find ranges of values where specific conditions are true?

I'm trying to get Mathematica to solve a particular inequality in terms of the variables (and constants) of interest to find where the inequality holds as true. Specifically, I have three functions of ...
54 views

374 views

How can I define my own ColorFunction?

Suppose I want to define a color function to use more than one graph. I'd prefer not to type it out every time. I know that I can set ColorData like this: ...
38 views

MMA Function is not recognizing an input parameter to PrependTo Statement

I am getting an error in the following code? What is the error telling me? How to fix? ...