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

learn more… | top users | synonyms

1
vote
0answers
30 views

Why the same function defined by Set and SetDelayed look different? [duplicate]

I am novice to Mathematica and maybe my question looks kind of silly, but nevertheless here is it. I input two functions: ...
2
votes
1answer
108 views

Show how Eliminate arrives at reduction

Does anyone know how to get Mathematica to show how it arrives at the following result? ...
1
vote
1answer
69 views

Help creating a simple function

Can someone help me to create a function. The truth I'm new in Mathematica and I don't understand well the way functions work in I. I need a function that animate some rectangles according to a curve ...
3
votes
1answer
72 views

Integrate[] does not work when the function has an antiderivative function

This function (1 + (1 + 1/(2*Sqrt[x]))/(2*Sqrt[Sqrt[x] + x]))/(2*Sqrt[x + Sqrt[Sqrt[x] + x]]) has the antiderivative function, since ...
-1
votes
1answer
76 views

Putting two functions in one manipulate plot

I have a problem that is somewhat related to this http://stackoverflow.com/questions/7727668/putting-two-plots-in-a-manipulate-whilst-keeping-the-plots-visible but I would like to plot two functions ...
10
votes
2answers
162 views

How do I override options with my own defaults?

I'm calling a function f from within a function g and would like to pass any valid options for ...
1
vote
1answer
90 views

using Module in NDSolve

I am trying to solve a set of two wave equations where solution of first equation defines initial conditions for the second one. And I would like to use Module to define those equations as a function ...
1
vote
1answer
76 views

Apply functions to functions yields slow execution speed

I'm trying to write a function that parametrizes a curve c(t) by its arc length. Technicly I'm finished but if I plot the result for an example curve like ...
15
votes
7answers
542 views

Enumerating tuples from a larger space such that all pairs of values are present at least once

I am trying to write a function that will accept a list of N lists and returns a list of N-tuples that represent all pairs of values from the original N lists at least once. To illustrate with an ...
1
vote
1answer
74 views

Manipulate - Evaluating Value of Function

I would like to visualize the properties of a threshold, which is a value of a function. Unfortunately, the value is expressed as scientific value (an approximation with 3-5 decimals would be fine) ...
1
vote
0answers
27 views

Apparent issue with derivative of FractionalPart

This issue came to my attention from Math.SE: http://math.stackexchange.com/questions/1015325/is-the-derivative-of-x-on-0-1-always-equal-to-1/1015342#1015342 To summarize, it appears that ...
1
vote
1answer
100 views

In there a way to derive the inverse value of CDF format MultinormalDistribution?

Is there a way to produce the inverse value of multinormal distribution function in CDF format with 0.05 significance level? I found the function called ...
0
votes
0answers
66 views

simulate a 32-bit signed integer overflow in a recurrence function

Considering the following recurring equation: which is this factorial function: I want to find the value of x where f(x) = 0. Actually, the solution is impossible with Mathematica, and it's ...
0
votes
1answer
42 views

Error: in the part assignment is not a symbol [duplicate]

I am trying to set part of a Doubly-indexed list aInitialPopulation to cNumHeg. Specifically I am trying to set the 3rd part of the list aInitialPopulatiom[[cNodeNumber]] to cNumHeg. My (attempted) ...
6
votes
5answers
167 views

What is the shortest way to switch between heads of nested functions

consider this example: f[g[x]] what is the shortest way to switch between heads of nested functions to produce. g[f[x]]
2
votes
1answer
65 views

Using Integrate to define a function

I'd like to define a function by way of the output of a definite integral with symbolic bounds. For instance, F[m_,k_] := Integrate[x,{x,m,k}] would define ...
1
vote
0answers
41 views

RowReduce doesn't work for this matrix?

I have this matrix A={{0,1,1,w},{1,0,1,x},{-1,0,1,y},{0,1,1,z}} where w, x, y, z are arbitrary constants. This matrix should be row reduced to the form ...
12
votes
2answers
2k views

Which Mathematica function has the longest name (by character length?)

I came across DamerauLevenshteinDistance[u,v] in the documentation center so that got me thinking: Which documented Mathematica function has the longest name? ...
0
votes
0answers
40 views

Should this be equal to Gamma function or not?

I define the following function: Nat2[s_] := InverseFourierTransform[FourierTransform[1/t, t, w] (-I w)^(s - 1), w, x]/Cos[Pi (s - 1)] /. x -> 1 I expected ...
10
votes
1answer
240 views

Why does the documentation call functions “pure”?

Clearly, functions in mathematica are not pure functions according to the definition on Wikipedia (no side effects - basically implementabe with table lookups): ...
1
vote
1answer
180 views

How can I call the R-programming packages in my Mathematica?

I am trying to call the R-programming package called highfrequency in my Mathematica so that I can use its function rCov. I ...
1
vote
1answer
93 views

handling division by zeros and line equations

today I was writing a code which takes some line equation and a circle equation,finds intersection points that are on $II$ and $III$ quadrants,draw a tangent line to circle from that point and then ...
0
votes
0answers
67 views

Empty Graph for Absolute Function

I wanted to plot the following equation: Plot[((x/7)^2 Sqrt[(Abs[Abs[x] - 3]/(Abs[x] - 3))] + (y/ 3)^2 Sqrt[(Abs[y + 3 Sqrt[33]/7])/(y + 3 Sqrt[33]/7)] - 1) (Abs[x/2] - ((3 ...
1
vote
1answer
41 views

Multiway Systems Rules List Management

I'm working with a multiway system and I have a number of different mutation rule lists. I need an efficient way of managing which rule lists I apply. Here is the basic multiway system code that I'm ...
1
vote
1answer
69 views

Plotting a function in {X(Y),Y} space

The code below generates some data and defines a function f[x,cb]:=NMaximize[expr,x] that upon being evaluated returns: {function value at max $x$,the function maximizing $x$}. ...
7
votes
2answers
183 views

How to redefine the type of multiplication in Det

I would like to redefine the type of multiplication that is used in Det (calculates the determinant). Instead of the standard multiplication I would like to use a custom function Fun[a,b] (which takes ...
14
votes
1answer
241 views

Why do big-O terms disappear in definite integrals since Mathematica 9?

In Mathematica 8, when I computed the following input: Integrate[Series[Cos[x], {x, 0, 2}], {x, 0, a}] Mathematica returned an expression that had a O[a^4] in ...
2
votes
1answer
70 views

FinancialDerivative function call without parameter fails in Mathematica 10

fixed in 10.0.2 When I type FinancialDerivative[] in Mathematica 10. There is error listed as follows. Anybody know how to solve it? Thanks.
1
vote
1answer
60 views

User defined functions and decimal places displayed

I have a couple of complicated user-defined functions, one which calls the other, and I wish to control the number of decimal places displayed when I call the "mother" function. I have tried the ...
1
vote
1answer
62 views

In which version was this Extract syntax introduced?

In Mathematica 10.0.1 this works: Extract[{a, b, c, d, e}, {{{1, 3}}, {{5, 4}}, {{2}}}] {{a, c}, {e, d}, {b}} In ...
2
votes
0answers
27 views

Automatically discover the class of an arbitrary matrix

In Wolfram|Alpha it is possible to discover some specific classes to which a matrix belongs. For instance, typing this in Wolfram|Alpha ...
0
votes
0answers
58 views

Birch clustering in Mathematica

I want to implement birch clustering in Mathematica. MAthematica only has 4 methods of clustering, is there any implementation for Birch clustering? Birch clustering is much faster than K means ...
2
votes
0answers
79 views

Distance Time Warp (DTW) function implementation in mathematica

The DTW (Distance time warp) is given here http://en.wikipedia.org/wiki/Dynamic_time_warping There is an implementation of DTW in R as well as MATLAB. However i am unable to find something for DTW in ...
0
votes
1answer
29 views

How to rearrange CharacteristicPolynomial[ ] terms?

I have a symbolic matrix A, which I need to find the characteristic polynomial, then order the polynomial in greatest-to-least form. (Ultimately to find the matrix inversion via Cayley-Hamilton ...
2
votes
2answers
52 views

Returning the 3-dimensional vector from a skew symmetric matrix

I'm trying to write a function that takes in a skew symmetric matrix and returns the corresponding vector. When I write the following code, it works when I leave it as variables, but it does not work ...
0
votes
1answer
53 views

How to evaluate a “pure function”? [closed]

I need to evaluate the result of DSolve, e.g. {{y -> Function[{x}, x^2 - x^3]}} at some specific point. I tried y[1] and y /. x -> 1. Hope someone knows how to do it
0
votes
0answers
41 views

Add constraints to a variable number of parameter in Minimize

i want to use Minimize with a variable number of Parameter which works fine: ...
4
votes
2answers
115 views

Can't figure out how to apply these functions repeatedly

I have the following problem, and even though I've tried Fold & Inner, Sow & Reap, et al. I can't figure out the clean way to do this. Here's the problem. I have a list that starts as ...
1
vote
1answer
68 views

C compiler error: the no library could be generated error

I have windows 8, Mathematica 9, and I've just installed Microsoft Visual Studio 2013 with update 3. I'm try to run Compile with the option ...
4
votes
2answers
475 views

How to create a function like in Python

I want to call a function that would perform a function rather than assigning an expression to them. I.e. ...
5
votes
1answer
207 views

Why doesn't this pattern work? [closed]

I want the in-built function Count to count the elements in a list which are greater than a value. Example: Count[{1, 1, 2, 3}, (# > 1.5) &] Why doesn't ...
0
votes
2answers
59 views

How do I get a Do function to create a list?

I have a Do function which gives me a column of expressions. How can I get the Do function to give me these expressions in a list. i.e The do function gives me this: a b c d I would like it do give ...
0
votes
2answers
157 views

Problem in downloading “ToMatLab” package [duplicate]

Iam trying to download "ToMatLab" Package from http://library.wolfram.com/infocenter/MathSource/577/ but it is showing me an error message by showing a big question mark and "File could not be ...
0
votes
1answer
84 views

Functions in functions

I have three functions f(x,y) , g(t) , and h(t) and somehow I have to find (d/dt)f(g(t),h(t)) where t = 0. How would I go about writing this in Mathematica? In this equation g(t) is taking place of x ...
2
votes
3answers
160 views

Extracting coefficients from a power series

I have a function defined explicitly as a power series: $$\sum_{n=0}^\infty{T_n}\frac{x^n}{n!}=\frac{\frac{x^3}{3!}}{e^x-1-x-\frac{x^2}{2!}}$$ and I would like to extract the coefficients $T_k$ as ...
14
votes
6answers
535 views

How can I evaluate only a single step of a recursive function?

Let's say have a simple recursive function for the Fibonacci sequence f[0] := 1 f[1] := 1 f[n_] := f[n - 1] + f[n - 2] but I want to see how it will expand in a ...
2
votes
2answers
63 views

Conditional replace of a column

Im trying to replace the value in the Nth column of a list if a condition is true, returning the modified list. I've tried modifying the answer from 61219 and been through most of related questions ...
0
votes
1answer
55 views

What does this Append expression do? [closed]

I have to understand some code. A part of it is written below. Can someone explain to me what it does: ...
7
votes
3answers
135 views

How to deal with the condition $u_i=u_{i+1}$ in B-Spline basis function?

The defintion of B-Spline basis function as shown below: Let $\vec{U}=\{u_0,u_1,\ldots,u_m\}$ a nondecreasing sequence of real numbers,i.e, $u_i\leq u_{i+1}\quad i=0,1,2\ldots m-1$ $$N_{i,0}(u)= ...
0
votes
1answer
36 views

Rigging a function to output a distinct value every nth call

There's some fixed script I am unable to alter (keeping things simple: Table[f[i], {i, 1, 10}]), , however, I can alter a function that the script calls (again, ...