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

learn more… | top users | synonyms

10
votes
1answer
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, ...
6
votes
2answers
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 ...
0
votes
1answer
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. ...
1
vote
1answer
42 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? ...
3
votes
1answer
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 ...
2
votes
2answers
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 ...
6
votes
1answer
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] ...
-2
votes
1answer
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 ...
-1
votes
1answer
57 views
5
votes
2answers
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 ...
3
votes
1answer
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. ...
0
votes
0answers
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 ...
0
votes
0answers
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 ...
0
votes
0answers
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 ...
3
votes
2answers
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 ...
10
votes
0answers
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: ...
0
votes
3answers
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 ...
3
votes
0answers
32 views
1
vote
2answers
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 ...
2
votes
1answer
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: ...
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
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 ...
1
vote
1answer
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 ...
1
vote
0answers
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: ...
4
votes
1answer
76 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 ...
0
votes
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 ...
2
votes
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 ...
1
vote
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. ...
2
votes
2answers
69 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: ...
5
votes
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 ...
2
votes
0answers
30 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
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 ...
3
votes
2answers
104 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
34 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 ...
0
votes
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 ...
2
votes
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 ...
0
votes
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: ...
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. ...
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: ...
2
votes
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) ...
8
votes
0answers
85 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: ...
0
votes
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 ...
0
votes
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: ...
1
vote
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) ...
0
votes
0answers
52 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 ...
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
124 views

How do I get Series[] as a functional, rather than as an expression (i.e. to avoid the dummy variable)?

How can I write an equivalent to Series that doesn't require a dummy variable? Note that the series should be constructed before the evaluation point is supplied, ...
1
vote
1answer
39 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 ...
1
vote
2answers
130 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 ...