Tagged Questions

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

learn more… | top users | synonyms

0
votes
0answers
82 views

How to be faster at making a frequency list of increasing steps

I want to find propabilities of having a sequence in a list, by using frequencies. The case is that you will bet on an increase when the last event had an increased and bet on derease when the last ...
0
votes
0answers
91 views

Timing: how make a program to work faster using built in functions and tables

I want to improve my code to make it working faster even for very large numbers. ...
13
votes
6answers
840 views

Will Version 9 functions all work in Version 10?

Having developed a substantial code base in Mathematica 9, leads me to ask these important questions prior to downloading and installing Mathematica 10. Will any Mathematica functions from the ...
1
vote
2answers
79 views

FindRoot: getting number of iteration [closed]

I'm using FindRoot to solve a nonlinear system. I'd like to see what FindRoot is doing while computation, something like the display option for Matlab fsolve. At the end of the day, I want the number ...
1
vote
1answer
75 views

Bug in NDSolve (Mathematica 9.0.1)? [duplicate]

The following code performs many times the same identical operation, but the time it takes increases systematically. This seems to be a problem of Mathematica 9.0.1 and above. Mathematica 9.0.0 does ...
0
votes
1answer
68 views

Nminimize fails claiming not a number value, even with _?NumericQ [closed]

I have the following function to minimize for a > 0 ...
2
votes
1answer
95 views

Define PolyLog so that positive reals evaluate on upper edge of branch cut

Generalizing the previous question: Define Log so that negative reals evaluate on lower edge of branch For real positive values $x>1$, Mathematica's polylogarithm function ...
0
votes
1answer
53 views

Combining functions - is this a case for Piecewise?

I have a function $Eb1$ which was the subject of a question I asked recently - you can see it here on stack exchange. Now, in that example it's specified between a boundary $r_n$ and $r_o$ where $r_o ...
0
votes
1answer
61 views

How to track row swap in Gaussian elimination?

How do I track which rows were swapped in the Gaussian elimination using RowReduce? I am doing metabolic control analysis on a mathematical of the energy metabolism I have in Mathematica. I need to ...
8
votes
3answers
634 views

Why are functions called first-class objects in Mathematica?

I've heard lots of people say a function is a first-class object in Mathematica. "Everything is an expression, including function." "There is no distinction between functions and data." Having read ...
8
votes
8answers
802 views

Finding maximum or minimum of implicit functions

is there any built in function that can be used to find maximum or minimum of implicit functions? For example, if we have the equation $$x^2 + y^2 = (2 x^2 + 2 y^2 - x)^2,$$ then we can visualize the ...
2
votes
0answers
99 views

Which functions automatically generate new functions?

In his video http://www.wolfram.com/broadcast/video.php?channel=362&video=1643, Wolfram gives the following example: the output from ...
2
votes
2answers
79 views

Funny behavior of Ellipsoid function

From its description I thought that the normalizations of the directions d_i of the semi-axes did not matter when using the ...
0
votes
1answer
73 views

Laplacian in D Dimensions

Is it possible to compute $\Delta F=\nabla^2 F$ for $F=F(x^1,x^2,…,x^D)$ with $D$ finite? I seem to be only able to specify spherical coorindates, for example, if I want to leave standard ...
0
votes
1answer
66 views

Cannot solve equation

I just started using mathematica and I'm facing a problem that I just can't solve. I want to solve the following equation: Code: ...
1
vote
1answer
97 views

How can I define a function that takes a list of reals?

I'm trying to define a function f which takes a list of reals. My purpose is to build a function which I can give a list of reals, integers or strings and have it ...
0
votes
2answers
89 views

Defining a function as a sum of several Gaussians

I have a function that is a summation of several Gaussians. Working with a 1D Gaussian here, there are 3 variables for each Gaussian: A, ...
0
votes
0answers
100 views

Problem With NDsolve trying to simulate n-body-gravity problem

Im Trying to model a cloud of point masses that act according to gravity, what im strugeling with is the exclusion of cases where euclidian distance = 0, If I try to do it with an If statement in my ...
2
votes
3answers
282 views

Tracking iterations of a function

I'm learning MMA with Wagner's book. On page 41, he uses this to display the iterative steps of a FindRoot. However, I can't seem to replicate this (code at end), perhaps due to the difference in MMA ...
3
votes
2answers
79 views

Function pattern to support listed and non-listed arguments

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 ...
6
votes
1answer
271 views

What is wrong about Abs[x]-a? Is it a bug?

Why is the Out[74] not {1 - a, {x -> -1}}? ...
0
votes
3answers
89 views

Create polynomials from Series

This question actually doesn't have quite a lot to do with the Series function, but I don't know how to describe my problem. So here's the thing. I'm trying to ...
0
votes
1answer
60 views

Integrating function can't be epressed? [closed]

Hi I have a function in a form of $$\frac{a}{x}exp(\frac{b}{\sqrt{3}-x})$$ The code is Integrate[a/x*E^(b/(3^0.5 - x)), {x, 1, 3^0.5}] But it can't work ...
2
votes
1answer
111 views

Define function that counts recursive fibonacci

If I write count=0; fib[0]:=(count=count+1; 0); fib[1]:=(count=count+1; 1); fib[n_] := (count = count+1; fib[n-2] + fib[n-1]); Then I can ...
1
vote
2answers
120 views

Define the square of a function [closed]

Is there any good way to define the square of a function in M9? Usually one can write e.g. f[z_] = 3*Sin[z] etc etc. But is it possible to define ...
3
votes
4answers
384 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 ...
1
vote
0answers
80 views

Expression for evaluating multiple functions?

I am constructing 3D data points for a plot and corresponding to specific conditions "manually". I define the values of five parameters [these I always have to define myself]. From those, I evaluate ...
4
votes
3answers
211 views

Counting number of inversions

Is there an inbuilt method to find the number of inversions in a set of numbers? I found Inversions in Combinatorica but when I ...
0
votes
2answers
65 views
0
votes
1answer
49 views

Switching the ordinate and abscissa causes problem in `ParametricPlot`

I have a function that plots properly in PolarPlot, but I'd like to plot it in ParametricPlot and then switch the y and x ...
0
votes
1answer
75 views

Is there a way to make the MemberQ function apply to a list?

Is there any way to ask a boolean question if the elements of the list {2,5} are in the list {1,2,3,4,5}?
0
votes
1answer
63 views

How I can define a new function as a function argument?

I need to pass a function with t as independent variable as a function parameter and want to create a new function of the same through this provided the argument of another function. Here is my code. ...
0
votes
1answer
101 views

Getting “Null” output from package?

I have a script written to test a package as follows: ...
1
vote
0answers
59 views

How to find matrix exponential using RootSum?

From what I've been able to deduce, Mathematica uses a root sum scheme to determine the exponential of a matrix. Can someone please explain to me the theory behind this? I've searched, but have had no ...
0
votes
2answers
240 views

How to pass a list as function argument?

I have the following function lFreqPhylo[a_, Q_, b_, p_] := Sum[Log[freqFunction[r[[p]][[i]], L[[p]][[i]], a, Q, b, {i, 1, nbranches[[p]]}]; The objects L, r ...
-1
votes
3answers
117 views

Creating Do loop that cycles back to earlier values

I need to create a Do loop that distributes letters in a list of lists. I also need to be able to cycle back through to the beginning of the list. For example, I ...
2
votes
1answer
78 views

Can Do-Loops iterate backward? [closed]

If I create a Do statement, Do[expr, {i, imin, imax}] is there a way to make the statement evaluate from ...
1
vote
1answer
53 views

ToExpression and Fortran notation

ToExpression["9.0E-03"] interprets String as 9*e - 3 instead of what I am expecting ...
2
votes
1answer
108 views

What is the formula Mathematica uses for ZetaZero?

What is the formula/algorithm Mathematica uses for the ZetaZero command?
1
vote
1answer
72 views

Apply function to output of previous function

I am trying to write a function that takes 3 tuples. Each tuple contains two lists which are first divided. This results in 3 lists. Then I want to take the Mean of all the columns. I can do this ...
5
votes
1answer
71 views
0
votes
1answer
58 views

Inverse functions - how are they calculated?

Mathematica is able to calculate InverseFunction[LogIntegral] and InverseFunction[RiemannR] (and many other inverse functions). ...
1
vote
1answer
54 views

VertexSize with GraphPlot [closed]

I'm constructing a graph using GraphPlot and I want some vertices to have a different size than others, like this: ...
2
votes
2answers
98 views

Graphical solution of a a two-variable system containing an equation and an inequality

I'm currently studying atmospheric-gravity waves and their dispersion relations. I want to have look at values of $(x,y)$ that solve the following system : \begin{equation}\label{}(1) \left\{ ...
1
vote
0answers
72 views

Find eigenvalues without filling the matrix

Is it possible to find eigenvalues of a matrix without filling it? The matrix elements are given by a known function f[p1,p2]. This is relevant for a matrix too ...
1
vote
1answer
59 views

Get subgraphs: communities of graph g

I have a graph g. I want a set of graphs c which holds the community subgraphs of g. I ...
3
votes
0answers
79 views

Why does Part behave like it transposes lists? [closed]

From the documentation of Part: Part[expr,i,j,...] is equivalent to expr[[i]][[j]]... ...
1
vote
2answers
99 views

function of derivative of a function

I know a similar question is answered somewhere, but it doesn't work for my case for some reason. I have the following problem in Mathematica. I want to compute f[h[x]]= x^2 + D[h[x],x]. Here, h[x] ...
2
votes
1answer
82 views

Why evaluation doesn't fail if arguments are invalid? [duplicate]

Sorry for a noob question, but this is something that I wonder about each time I work with Mathematica. Coming from standard programming languages (Python and Java), I expect my functions to fail ...
0
votes
1answer
147 views

Discrete peaks to curve via Voigt summation

I have two data sets. One is an experimental recording of an absorption spectrum, composed of regularly spaced (wavenumber, intensity) coordinates with a fine wavenumber resolution, thus making ...