# Questions tagged [functions]

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

3,693 questions
Filter by
Sorted by
Tagged with
34 views

### Change the function-defined solution domain to fit NDSolve original Interpellation domain

Given a system of coupled non-linear equations, I used NDSolve to solve it in the domain of: $$-10^{50} \le r \le 10^{50}$$ ...
36 views

### Creating function with array input with desired coefficient and evaluate it

I had asked the same question before here Creating a list of functions with desired coefficients but did not get the desired answer, may be I was not clear in my question. I have defined this function ...
106 views

### Simplify inverse of function

This would be a noob question, but I need help simplifying the inverse of an expression ...
88 views

### Creating a list of functions with desired coefficients

I have defined this function to results some list of functions, however its not returning what I want ...
364 views

I have ...
125 views

### Pattern matching vs. condition in a function

I'm trying to learn stuff from pattern matching but I found sometimes pattern matching does not work as I expected. Could anyone explain why the below outputs are not same? Thank you. And could anyone ...
49 views

### NyquistPlot creates misleading connections with some plot range

This Nyquist plot depicts a plot range aiming to cover all crucial curve characteristics. ...
123 views

### Can I write a function that describes a hysteron?

Is there a way to write a "function", or as the answer below refers it better as a memory, that has the following output: k=0 if the last time x was outside the range (a,b), it was x<a. ...
73 views

### Same code behaves differently as a pure function and a function, and insider another function

I have a rule-transformer that takes a list of rules (and a list generator = {σ[z], σ[-1], σ}) ...
89 views

### Plotting root locus - how to display 'k' values on the curve?

I'm trying to plot the root locus for the function below. Is there any way to make it display the value of 'k' when I move the cursor along the curve, similar to a tooltip? ...
31 views

### Defining a function for FunctionCompile[]

Lets say that I have the definition EQN4 that is determined from some calculation. If I run it in a cell, I get the following output: ...
619 views

### How to draw an image similar to a periodic function (f [x+1]=2 f [x])?

The definition domain of function f [x] is R, satisfying that f[x+1]=2f[x], and when x belongs to (0, 1], f [x]=x(x-1). If for any x belongs to (-[Infinity], m], there is f [x]>=-8/9, find the ...
51 views

### Is it possible to ask Mathematica to give/find this largest (absolute value) argument of $\cosh$ in the expression?

I have the expression exp in terms of Cosh functions: ...
511 views

### Stopping mathematica from rearranging elements in a list

I have the following list set1={-(1/x), -(1/x) + x/2 - 2 Log[x] - Log[x]/x, 1} How when I am doing Complement[set1, {-1/x}] ...
69 views

### Define function to test arguments and set value to 0 (application 0 Log  = 0)

I have an expression that has the form f1[a, b, c] Log[ f2[a, b, c] ] Now if f1[a,b,c] and ...
64 views

### To draw a function within an interval [closed]

I need to draw this function: z=f(x), where z=tanh(y) and y=sin(x), within a range of x(-2Pi,2Pi)? Should I use "Plot" function or some other built-in functions? Thank you
51 views

### How to make a function that returns a function?

I have this function that returns another function Hs but the only way to use the function is to use Hs[t][]. Is this going to slow down my code and is there a way to write this so that I can ...
120 views

### How can I zoom in on a specific region?

I made this plot with Mathematica but it's hard to see the region around the cirtial point -1 + 0j. Is there any way to zoom the region? ...
76 views

### Trying to plot the Fourier transform solution to the heat equation on Mathematica [closed]

I have gotten the solution of the heat equation as where f(y) is the initial heat distribution which I have been given as f(x) = e^([Sigma]x^2). I am supposed to plot this at the value of sigma 1, 2 ...
1 vote
70 views

### Listable (on certain level) custom function

I wish to make custom listable function (for 2D points) with the next behaviour: ...
1 vote
188 views

### How to implement tridiagonal matrix algorithm?

I have created the tridiagonal matrix below: ...
1 vote
137 views

### Finding the minimum

I am trying to find the minimum R and its corresponding k, but for some reason (which I am not able to figure it out) I am getting an error that the function value is not a real number at k=1. ...
71 views

### How to make a polynomial output be used as function for input?

I basically made a code interpolating a set of data that gives me the polynomial for the interpolation. Here's the sample interpolation I did. ...
85 views

### How to create a plot like this one? I think I am having issues with implementing a logarithmic axis

I am having trouble creating a type of contour plot. I have an example of what I am trying to make which is this: and this: I know that for the first example above, the plot was not all made in the ...
1 vote
140 views

### Making the timestep of Euler method integration a variable

I am fairly new to Mathematica, and I've been trying to implement the Euler method of integration for a fluid velocity field. I can't work out how to make the timestep a variable of my Euler method ...
45 views

### Cross function not working for time dependent variables [closed]

I have two 1x3 matrices both containing time derivatives: OwC = {{a'[t]}, {b'[t]+c'[t]}, {0}} EwB= {{0},{b'[t]},{0}} But when I do Cross[OwC,EwB] I get: Cross::nonn1: The arguments are expected to be ...
78 views

### How can I apply Residue in a functional-style way? [closed]

Let me suppose that I have got some expression, for example f_{1}(x)+f_{2}(x) and also a list of a form: {1,2} How can I apply ...
25 views

### Adding constrains in a SYM function "Classicalsymmetries"

Please help me add constrains on my code. The function runs perfectly fine without the constrains but it gives me 7 cases and I only need one where all the constrains I have hold. This is the code ...
1 vote
116 views

### How to invert this function when the argument e is small?

I need to find an analytical solution the following equation for e in terms of n and p ...
1 vote
74 views

### Finding out derivative of variables from an expression

I have the following expression gh=(G^(0,0,1))[0,1,x]+G[1,x]; Where G^(0,0,1)[0,1,x]=D[G[0,1,x],x]. This is a model expression. ...
1 vote
61 views

### Replace rule inside mathematical operations

This is probably very trivial question. I want to replace D[G[0,2,1,x],x] where $D(0,2,1,x)$ is anything but the number of arguments may change keeping $x$ fixed, ...
1 vote
252 views

### How to interpolate an implicit function?

chi(t) is implicit function. The implicit function can be plotted by ContourPlot. Is it possible to obtain chi(t) explicitly using function interpolation? ...
1 vote
108 views

71 views

### How can I calculate P-Value for a custom distribution?

I used DistributionFitTest but it works only with a defined distribution. This is the distribution that I used: ...
1 vote
105 views

### Are these tacit functions? [closed]

I am new to Mathematica and am reading the primer document by Peter Young. Early on, before even introducing functions, he introduces constructions like ...
1 vote