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

learn more… | top users | synonyms

11
votes
4answers
517 views

Generating Random Real numbers with certain numbers not included

I'm writing a program that i need 1000 real number between -3 and 6. the code that I used for generating and saving them was l = RandomReal[{-3, 6}, 1000] But I ...
0
votes
0answers
38 views

RegionPlot fails when given function with internally redefined variables

I've just upgraded to v10, and have noticed that some of my trusty old notebooks which used RegionPlot now fail to run. I've boiled down the problem I'm having to ...
0
votes
0answers
31 views

Improving RationalInterpolation Result

The following code produces a {4,4} rational interpolation approximation accurate to 10^-6 or better over the range ...
2
votes
1answer
237 views

How to make a function from body with variable number of arguments?

Suppose I have an UNKNOWN function, which generates formulas with given number of x[i]. ...
1
vote
1answer
43 views

Composition of Multivariable function

I am trying to compose functions of xleft, maybe like xleft[xleft[f]] or even higher order. And here is my function: ...
0
votes
1answer
74 views

Diffentiating a function f with respect to x [duplicate]

I have a tabe y={10,20,30,40...} and x={62,63,64,65...} y is a function f and this function needs to be interpolated. How do I defferentiate the function f with respect to x?
0
votes
1answer
40 views

Taking function output as shown, and processing it regardless of its history

I am making some symbolical calculations for my quantum chemistry class. I am supposed to build a wave function composed of multiple other functions, each of which is also composite of some lower ...
0
votes
3answers
63 views

Complement[] changes order of elements?

Consider this example: Complement[{a, y, c, d, e}, {a, c}, {d}] (*{e, y}*) However, I was expecting the result to be: ...
1
vote
2answers
143 views

How to tell Mathematica that certain variables are real/imaginary, integer-valued, etc

I'm trying to expedite some quantum mechanical calculations by running them through Mathematica. Expectation values and stuff like that. When I say, for example, ...
0
votes
1answer
49 views

What is the simplest way to obtain function obect of a given function?

Suppose I have a function p of some arguments: p[x_,y_]:= (* something *) Now I with to pass this function as an object to ...
1
vote
1answer
105 views

Why does LyapunovSolve solve non-standard form?

LyapunovSolve[A,Q] solves the equation $A P + P A^T = Q$ for $P$ whereas the standard form (wikipedia,lecture notes, p.25, linear control systems) of the Lyapunov ...
11
votes
1answer
344 views

Better Autocompelete for the Front-End

I wonder if it is possible to improve the front-end's autocomplete capability. Compared with some other more sophisticated editors/IDEs, such as eclipse, Mathematica's front-end does not provide a ...
1
vote
0answers
74 views

Crosscorrelation for nonperiodic signals

I want to detect patterns (of an absorption spectrum which is nonperiodic) with Mathematica automaticly. I have found CorrelationFuncion but as far as I understand, ...
1
vote
1answer
181 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 ...
0
votes
1answer
46 views

Mathematica Lattice Reduce Command

I'm going through a very old copy of "Mathematica: A System for Doing Mathematics by Computer" for self practice. I'm on chapter 3, and ran into the LatticeReduce ...
2
votes
2answers
114 views

cycloid parametric [closed]

How do I enter 3 parametric equations for cycloids corresponding to circles with radii 1, 2, and 4. I have tried ...
5
votes
3answers
156 views

Missing control for depth of Inner

Working on a mechanics problem, I stumbled on something peculiar: Since Inner is a generalisation of Dot, it changes its ...
1
vote
2answers
46 views

How to add a part of a list to a function?

I want to be able to add a specific portion of a list to a part of a function but this fucntion intakes 6 variables where as the list is of example: ...
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
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 ...
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
vote
1answer
198 views

using a Mathematica function to define a new function

I'd like to define a function of three variables which produces a new, named function of a single variable, where this final variable is not a member of the first three. So I'd like something where I ...
1
vote
1answer
94 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 ...
2
votes
1answer
237 views

Matrix exponential MatrixExp[] vs Sum[MatrixPower[]] doesn't match?

I might be an idiot, but I cannot get the manual expansion of $e^{At}$ to match the MatrixExp[A t] result. For example, I have the following: ...
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
68 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 ...
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]]
4
votes
2answers
88 views

Function pattern to support listed and non-listed arguments [duplicate]

I often want to write functions that take as an argument either a) a rule or b) a list of rules. As an example, when using Replace with just one rule, it does not ...
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) ...
2
votes
1answer
69 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? ...
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): ...
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 ...
1
vote
1answer
94 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
70 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$}. ...
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 ...
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 ...
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 ...
5
votes
1answer
102 views

FlipView can't handle CurrentValue[“MouseOver”]. Kernel crash

Is this code crashing your Mathematica session? (it can so look out :P) ...