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

learn more… | top users | synonyms

0
votes
0answers
56 views

break down the function

I am using Series function, but I found that it cost too much time. Since the Series function is Taylor expansion and I only need first order, I want to break down the code, so I can make it faster <...
0
votes
1answer
60 views

Why my Function Has no Output Plot?

Below is my commands on a mathematica script to plot a function. In order to see why the function has issue to be plotted, I have tried to plot the intermediate functions one-by-one. It seems that my ...
4
votes
1answer
81 views

How to pass a pair of values to Table function?

I define a function like this: ϕ[t_,ϕ0_,ϕ1_]:=ϕ0+ϕ1/ArcSin[0.97] ArcSin[0.97 Sin[2Pi f(t-0.25/f)]]/.f->30 which generate: $$ \phi (t)=0.754586 \times \...
1
vote
1answer
68 views

How to extract all necessarily code for a function?

Many times when someone pastes a piece of code into SE there are missing values and symbols that the user left out. To prevent this I'm looking for a function that uproots other functions (extract ...
1
vote
0answers
52 views

Is there any way to see a kernel function's code? [closed]

I was using the extremely useful function PrintDefinitions from the GeneralUtilities package and I encountered this: ...
2
votes
2answers
73 views

Why is the square of a differential operator not evaluated automatically?

I defined an operator: py[f_[x, y]] := (I*h*D[f[x, y], y] - x) // Expand (not important, but it represents a simplified component of a quantum momentum in a ...
2
votes
2answers
72 views

Omit argument specification in function [duplicate]

If a function has e.g. 5 input arguments (a,b,c,d,e), how can I omit to specify only argument c, so that its default value is taken, but the other arguments should be passed to the function? E.g: <...
1
vote
1answer
83 views

Excel lookup function? [duplicate]

I have two lists, one for the length of words and another list for the corresponding bonus points. ...
5
votes
4answers
106 views

Using roots to get original equation

I have a list of four rules, that I would like to use to find the original polynomial that produced them. The rules are of the form ...
2
votes
0answers
32 views

Solving for coefficients of a polynomial? [closed]

I'm sure I'm doing something wrong here, but I'm damned if I can figure out what. I'm trying to find a cubic function that passes through (0, 270), (1, 312), (2,230), (3,0), but the first way I tried ...
0
votes
0answers
29 views

A bootstrap on the p-value of a simple linear model

My model: $y_t=\beta_1+\beta_2x_{2t}+\beta_3x_{3t}+u_t$, with $u_t\sim N(0,\sigma^2)$. My sample is of size 50. I'm trying to do a parametric bootstrap for the t-statistic of $\beta_3$, and I'm ...
2
votes
0answers
131 views

Input List of Images into a cloud deployed API function

I'm new to APIFunction and CloudDeploy, but essentially, here's my situation: I have a function (let's call it ...
3
votes
2answers
110 views

Matrix Diagonalization programming

I have a very simple problem, with me misunderstanding the use of Modules and Functions in general, in mathematica. I have a function of which I want to input a Matrix, and in the function I want ...
0
votes
1answer
42 views

Finding text files in a given path and applying a function to those files

I made a function called "SolveLinearSystem[]" that solves,as its name suggests, a linear system of any amount of variables. It takes the path of a text file as its only argument. The function then ...
0
votes
1answer
36 views

WhenEvent StopIntegration not working [closed]

I am trying to use a WhenEvent to StopIntegration when Tmelt=1356 is reached. Although the NDSolve appears to be working, "StopIntegration" is not stopping the integration and no value is given for ...
4
votes
0answers
94 views

Why does FromDigits transpose its argument (sometimes)?

a = {{1, 2}, {3, 4}, {5, 6}} ; FromDigits /@ Transpose@ a == FromDigits @ a (* True *) The only "strange" syntax I've found in the docs is But it doesn't ...
2
votes
1answer
88 views

Fitting EV charging curve

I would like to fit my set of data (x = time and y = power) as seen below, and obtain function of x describing it as close as possible, in order to manipulate it (applying different SOC, time offsets ...
2
votes
0answers
76 views

Function output

I would like a function that computes Cartesian product of two sets z=(Tuples@{#1,#2}), and computes the number of elements in this set(list) ...
0
votes
0answers
66 views

Wolfram Mathematica: Sum of a function over a list [duplicate]

I have the function: $I_q(n)=\frac{1}{n}\sum_{d|n}\mu(d)q^{n/d}$, where $\mu(d)$ is the Möbius function. How do I get it in Wolfram Mathematica? It should be something like that: ...
0
votes
0answers
37 views

Names disapper when using PlotLegend [duplicate]

I am using Mathematica 8.0.1.0 and when I use PlotLegend the names disappear. Could you help me fix it? Thank you. ...
0
votes
2answers
138 views

How to define a formula-less function? [closed]

How can I tell Mathematica that $f(t)$ is a function of time without providing it with a formula? I want to write an auto Lagrangian calculator. And a derivative taker is needed which writes the ...
1
vote
1answer
54 views

Building function where the output is graphic [closed]

I want to build a function, where the inputs are points and voronoimesh, and points. But, the output would be a graphics parameter. the code is following: ...
1
vote
2answers
132 views

How to show convergence to a number?

How can we show that, using either of the two equivalent functions, we converge to some number? $$\sum_{n=0}^\infty f(n)\ =\ 2.75056...$$ $$ f(n):=\frac{1}{\binom{\frac{1}{8} \left(2 (n+2) n+(-1)^{n+...
23
votes
5answers
6k views

How can I differentiate numerically?

Mathematica has two ways to integrate: Integrate and NIntegrate. But what about D? ...
0
votes
0answers
28 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
208 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
1k 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
140 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
300 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
103 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 <...
152
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
124 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 ...
19
votes
0answers
425 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
106 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: ...