# Tagged Questions

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

68 views

### Checking if input is a function

I would like to write a program to find the leading coefficient of a given polynomial. (Sounds easy, right?) I'd like to be able to handle the format x^2-x+7 (with ...
176 views

### Return a sentence with numerical values

I have the following function: example[a_, b_] := Module[{c}, c = a + b; Return["The solution is c"] ] I would like to know how to return that ...
77 views

### What function superseded SpaceForm?

In older versions of Mathematica you could use SpaceForm to leave a certain amount of spaces when writing to a file. For example, if we have the following data: ...
171 views

### Core functions or operations that every aspiring Mathematica programmer should know? [duplicate]

I am aware that there are common yet very powerful operations like Map, Thread, Apply, ...
310 views

### What does empty {} mean in Module? [duplicate]

I have a question. I would like to know what an empty list ({}) means when used in Module[] as the code below shows? Why has a ...
56 views

### Partial derivative of function of two variables

This question is not enlightening nor is it difficult. But some part of my notation or how I have defined my functions is messing up the D[f,x] function. ...
43 views

### Mathematica Empty Plot FourierSinSeries function

I'm trying to get a plot of different order Fourier series of the function x-1, why does Mathematica give me an empty plot? ...
69 views

### Calling results of applying f to expr inside NestList

Being new to Mathematica, I try to follow the suggestions of using NestList, Map, Table ...
42 views

### Better alternative to Hold/ReleaseHold for postfix application of Monitor

Trying to Monitor a process using the postfix notation, as in Table[Pause[n/10], {n, 5}] // Monitor[#, n] & fails: the ...
69 views

### Custom operator form for system functions?

There are some functions for which an operator form would make sense but isn't implemented. For example, I'd like to make this work: RandomSample[3] @ Range[10] ...
69 views

### Plotting 3-dimensional graphs [duplicate]

I just started Calculus 3 and I thought it would be useful to see images of functions to get used to the transition of visualizing in 3-dimensions. I was wondering how one would go about plotting a ...
57 views

...
164 views

### Get envelope of a set of functions?

I'm new with mathematica and I'm trying to solve a problem. I have a set of functions in the same variable. Let's say the domain is [0,2]. I would like to get an ordered list of the functions ...
53 views

### Undocumented “Output” alignment argument to “Column?”

In this SE question, Inheriting Stylesheets when using CreateDocument, I noticed the literal string argument "Output" to Column. ...
36 views

### Graphing/Plotting multivariate profit function with inequalities

I have the following profit function which I would like to 3Dplot in Mathemathica: Profit = (8c^2-16c*s-10c-4s-3)/(32s+16) , where ...
92 views

### Impose a boundary condition to a function

Background I am trying to impose a boundary condition on a function of two variables $u(x_1,x_2)$. The boundary condition is: $u(x_1,0)=A\cos(\omega x_1)$. The same function in mathematica ...
46 views

### How to calculate a continuous function once and access values later?

I have a function that involves a numerical calculation: h[v_]:=NIntegrate[f[x]*Log[p[x, v]], {x, -Infinity, Infinity}] I need to visualize how well a bunch of ...
69 views

### Calculate Cumulative Mean and Standard Deviation of a list without FOR loops [duplicate]

I have a simple list mylist={x_1,x_2,...,x_N};. Now I want to map a function over this list, e.g. the Mean and StandardDeviation functions, so that it will give me ...
112 views

### Possible Bug in LinearSolveFunction with Sparse Vectors

Bug introduced in 5.0 and persists through 10.4.1 LinearSolveFunction is new in 5.0 Consider the following set of equations and corresponding variables: ...
74 views

### Write complex number in terms of absolute value and phase

I have a long vector and some of the values (19 out of 64) are complex. I got them using the Mathematica Rationalize function, so the complex ones are written in the a+bi form. Is there a function I ...
32 views

### Performance of Apart with complex numbers

Consider the following code ...
93 views

### n fold convolution of a function via a recursion function

I wanted to write a recursion function to calculate the n-th convolution of a function f[x_]. I wrote the function ...
142 views

### Creating a function takes a list and dynamically modifies that list [duplicate]

I'm trying to create a function that uses a dynamic locatorpane to populate a list with the coordinates of user defined locators (added by alt+clicking). This code works fine: ...
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 ...
54 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 ...
66 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 ...
46 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: ...
77 views

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 ... 1answer 57 views ### Transform a variable's exponent from an exact rational to an inexact decimal here is a little problem I could not find a solution for. I have a variable with an exponent represented as a fraction, for example, var = a^(39/106) Now I ... 2answers 68 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 ... 1answer 79 views ### Excel lookup function? [duplicate] I have two lists, one for the length of words and another list for the corresponding bonus points. ... 2answers 70 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: ... 4answers 101 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 ... 2answers 123 views ### How can draw the inner region of the one -parameter function? ... 0answers 31 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 ... 0answers 28 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 ... 2answers 105 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 ... 1answer 35 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 ... 1answer 40 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 ... 1answer 84 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 ... 0answers 39 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: ... 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. ... 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: ... 0answers 70 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) ... 0answers 86 views ### Slot number cannot be filled I got a strange message with the derivative of a two-argument function defined by a definite integral. For example if "f" is defined as: ... 2answers 126 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 ... 0answers 24 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: ... 2answers 128 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) ...
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 ...