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

learn more… | top users | synonyms

0
votes
0answers
27 views

Find Sequence Function and Clustering

After I created the eventfinder function (see 1st question First position of incremental series), for increment 20, I found that the incremental Events Manifest at: ...
3
votes
1answer
207 views

The UnitStep function and Intervals

For the input UnitStep[Interval[{-4, 5}]] I get Interval[{0, 1}] Why is this not ...
0
votes
0answers
53 views

Using DeleteCases to ignore term of Product

I'd like to calculate $\int_{-\infty}^{\infty}\mathrm{d}x/(1+x^6)$ through a variation of the residue formula, which is $\int_{-\infty}^{\infty}f(x)\mathrm{d}x=2\pi i\sum \text{Res }f$ for Residues in ...
6
votes
3answers
990 views

How to plot several functions without jumping? (multiple eigenvalues of a system as functions of 2 parameters)

I've been working on this research problem for months with some success by no global/proper solution to the problem. So I have square, Hermitian matrices of various sizes ($8,20,38$ dimensions) with ...
0
votes
0answers
32 views

Solving for limit of integration with a piecewise function (FindRoot vs NSolve) [duplicate]

I am trying to solve for the limits of integration using a piecewise function. I'm doing this in a loop over a list of data, mostly because I'm not well-versed enough in Mathematica to make this a ...
1
vote
2answers
133 views

Express roots of quadratic equation in a specific form [closed]

By solving this equation, I got two roots as follows: Solve[1 + Subscript[a, 1]*s + Subscript[a, 2]*s^2 == 0, s] Is there a way to express it in the form below ...
1
vote
1answer
40 views

How do I convert an expression that is a function of some variables into a functional?

If I have an arbitrary f[x, y, z], how do I convert it to f[#1, #2, #3] & without messing up scopes or causing scope leakage?...
5
votes
2answers
138 views

Using OddQ and EvenQ in piecewise functions: Buggy?

I was trying to evaluate a sum over a piecewise function, not unlike this example. However, my piecewise function needed to be defined differently for even and odd ...
5
votes
2answers
83 views

Hiding independent variables of a function in Traditional Form

I would like to perform a computation which involves fourth-order derivatives of a composite function of four variables. I am defining my function as ...
7
votes
1answer
292 views

Branch cuts of sqrt

I was trying to plot some complex functions with branch cuts on mathematica but I have two problems. 1) The function is with z-Sqrt[z-1]*Sqrt[z+1] with z complex. Now Mathematica says that the ...
3
votes
2answers
102 views

Dealing with a sequence of function arguments that may contain lists

I have a function with multiple input parameters, Func[x1, x2, x3, ..., xm]. On occasion a subset of these parameters might be provided as a list ...
18
votes
1answer
262 views

HistogramList is much Slower in 10.2 vs 10.1

While I was running a code I wrote using version 10.1, I noticed that in version 10.2 the running time of the same code was more than twice as long. After some digging, I figured out the culprit is <...
149
votes
7answers
7k views

What are the use cases for different scoping constructs?

Mathematica includes three functions that I know of which can be used to effectively (if not actually) define a variable and give it a value within a local scope: ...
6
votes
2answers
123 views

How to introduce two successive points inside the FixedPointList for each cycle?

If we want to draw the attraction basins of an iteration function of the following type $$x_{k+1}=x_k-\frac{f(x_k)}{\frac{f(x_k)-f(w_k)}{x_k-w_k}},$$ where $w_k=x_k+b f(x_k)$, $b\in R-\{0\}$, we can ...
18
votes
0answers
414 views

More Ticks::ticks errors in AbsoluteOptions in v10

Bug introduced in 7.0 or earlier and persisting through 10.4 or later While the specific bug affecting Plot described in AbsoluteOptions prints error messages in ...
3
votes
1answer
71 views

LineScaledCoordinate problem for exact coordinates

Edit: Confirmed bug. CASE:2326540. Still the case in V 10.4. Solution: Wait and use N meanwhile. I've faced this problem ...
0
votes
1answer
42 views

Computing approximations of exponential [closed]

I have the code f[x_] := 13 x e^-x bit = Nest[f, 1, #] & /@ Prepend[1]@Range[4, 16, 4] Which I am using to compute values of $f^{(4)}(1), f^{(8)} (1), \...
18
votes
4answers
447 views

How to keep some of the results of the NestList

I'm using some iterative arithmetics to calculate wave propagation with the help of NestList. I have to use a small step size for iteration to guarantee the accuracy, which lead to too much data (e.g, ...
0
votes
1answer
58 views

Using Plot3D for finding trend clearly

I have a function of two positive variables $t$ and $C$ with $t$ and $C$ in a specific range as below. $0 < C < 10^{-5}$ and $0< t <4.54 \times 10^{-6}$. I want to see which variable of $...
0
votes
2answers
105 views

Trouble creating a bifurcation diagram of a trajectory

I wish to create a bifurcation diagram of the trajectory made by $f(x,a) = a - x^2$ which shows the tangent bifurcation point and the period doubling point. The tangent bifurcation point occurs at $\{...
1
vote
1answer
31 views

Iterating my function by $4$ using NestList — Syntax Confusion [duplicate]

I want to iterate my function $f(x) = 13xe^{-x}$ by $4$ multiple times. That is, $f, f^{4}, f^{8}, f^{12},\cdots$. Using Nestlist[f,x,4] I can get $f,f^{(2)}, f^{(3)...
12
votes
5answers
2k views

How to completely delete the head of a function expression

Is there any way to completely remove the head of an expression function? For example, how would I remove the head Cos from ...
0
votes
0answers
28 views

Obtain a SymmetricReduction of a bivariate (symmetric) function given in Piecewise form

I would like to re-express the following bivariate (symmetric) function (defined over the unit square) ...
1
vote
0answers
48 views

Creating an indexed set of functions with the indices in the function names [duplicate]

As the titles describes, I want to create a list of functions like the following, where the indices are not in the argument slots: ...
1
vote
1answer
180 views

Transform list of inequalities into matrix form $A\ x \leq b$

I have a list of linear inequalities, and I want to get it into the form $A\ x \leq b$; i.e., find the matrix $A$ and the vector $b$. Is there any function in Mathematica that can that can do this?
3
votes
2answers
3k views

Define a color function using Piecewise

How can I define a ColorFunction for my ContourPlot using Piecewise? For example, after ...
0
votes
2answers
470 views

Expansion in Basis Functions

I am trying to create an expansion of the form f[x,y]->Sum[Cn[x] y^n,{n,1,order}] To replace the function f by the ...
2
votes
1answer
63 views

Create an accumulator array from a function

I am making some images for a project about the hough transform line detection, I am showing the slope-intercept form , the normal form and their accumulator arrays to show the peaks. I am kind of new ...
1
vote
1answer
52 views

Using the Nest function — Confusion on my output

I have the following code and output where the original function is $f(x,a) = a^2 - x^2$. ...
2
votes
0answers
63 views

How do I define a collections of commands for later use? [duplicate]

Many ask me to tackle this problem by making another function(subroutine) of the lines I want to pick out, using Block,Module,etc The problem is different here.Notice that Block and Module ...
0
votes
0answers
27 views
3
votes
1answer
74 views

plotting after solve does not display anything

I'm quite new to Mathematica language, I am trying to figure out where I am making mistakes in Plotting a specific function that depends to other variables: I want to plot ...
1
vote
0answers
51 views

Different behavior of Power between versions 9 and 10

Rather by accident I've noticed that the following trivial code produces different output in Mathematica 9 and 10: -((-1)^n) Mathematica 9: $-(-1)^n$ ...
4
votes
0answers
71 views

RealDigits and functional style

So while thinking about Replacing numbers of which you only know certain digits I have faced, again, a problem that I find hard to extract from RealDigits' output ...
0
votes
1answer
64 views

If Statement in function does not evaluate

I've written a function that should try to simulate a "triangle-wave-signal", given a few parameters. It looks like this: ...
1
vote
1answer
47 views

Want to map over both the file data and the file names of the data source files

I have a lot of experimental datafiles I would like to plot first and check, if they can be used for further analysis or not. To avoid importing every single file I used FileNames and than mapping. ...
11
votes
2answers
252 views

Vertex descendants subgraph

Keywords: vertex, ancestors, descendants, subgraph, directed graph, flow subtree So let's say we have a TreeGraph: ...
4
votes
5answers
319 views

Alternative to Sign

The Sign function works in a very straightforward manner: Sign[8] Sign[-8] Sign[0] ...
6
votes
1answer
142 views

Unexpected behavior from Indexed (threading and messages)

I was going to include Indexed in this answer, thinking that it operated much as a List-only ...
19
votes
1answer
260 views

What is the difference between defining a function and specifying the type of argument, versus applying a test to that argument?

Say I want to create a function that evaluates differently based on what type of argument is given. I've found two ways of doing this, ...
1
vote
2answers
76 views

Problems using a function as an argument

I made a function: f[x_]:=x^2+1 and when i use it on, for example f[5], i get the answer 26. . But when i use it on: PollardRho[a_, f_] := Module[ {}, Return[f[a]] ] And when i write ...
2
votes
2answers
2k views

How could I define a function as the solution of equations in Mathematica?

I have posed a specific question yesterday but it may be too trivial to answer. I think the question could be asked in a more general way so it is easier to answer. Then I could solve the original ...
0
votes
1answer
45 views

Using the Solve function [closed]

I am new to using Mathematica and am attempting to find the roots of a function using the Solve[] function. I can replace $f[x]$ within Solve[] with the actual function and it will work that way, but ...
3
votes
2answers
105 views

How do I run 1-855 data points( imported from excel sheet) into a formula to obtain value for each data point?

I am very new to Mathematica and I just couldn't figure out the solution for the following problem. I have two columns in an Excel file. I have imported the 1st column as ...
0
votes
1answer
51 views

Oddity with ToExpression [duplicate]

Is this a bug? ToExpression["3231.432"] 3231.43 I would have expected the following: 3231.432 I am using Mathematica 10.2.0
4
votes
1answer
114 views

Associations complement

So I'd like to complement two associations through shared keys... not the best description, so here's an example: ...
2
votes
2answers
152 views

Revolve a non one-to-one function about the y-axis

I am attempting to revolve $f(x)=-x(x-3)(x-2)^2$ about $x=0$. What I have come up with is that I need to redefine each interval between the relative extrema as a separate function, and then treat it ...
1
vote
1answer
52 views

Define a function interactively with sum

I have to define a function which has 1e4 terms added up together. f(x1, x2) = (sum i, j, k, l from 1 to 10) (C(i) * C(j) * C(k) * C(l) * exp( (alpha(i)+alpha(j)) * x1 + (alpha(k)+alpha(l)) * x2 )...
4
votes
1answer
201 views

Computing the Caputo fractional derivative of a polynomial

In fractional calculus, the Caputo derivative of a monomial has the following form: $$\operatorname{\mathit D}_t^\alpha\,t^\beta = \frac{\Gamma(\beta+1)}{\Gamma(\beta-\alpha+1)}t^{\beta-\alpha}$$ I ...