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

learn more… | top users | synonyms

0
votes
0answers
53 views

deleteduplicates Delete elements of a list [duplicate]

I have a math problem about Mathematica, I am looking help from you. I hope that you could help me. The Math Problem: list= { {0,0,1},{1,0,0},{0,1,0} ,{1,2,3}}; ...
1
vote
1answer
88 views

Using Map in a function definition

I want to calculate the hessian of a matrix. So each element gets replaced by a 2 by 2 matrix. ...
0
votes
0answers
51 views

Is it possible to calculate with declarations only?

simple Example: maximize $u(x), x$ solution would show constraints: $\frac{\partial u(x)}{\partial x} = 0$ $\frac{\partial^2 u(x)}{\partial x} < 0$ etc... or do I always have to explicitly ...
-1
votes
2answers
72 views

How to fix the “Module” function, for implicit funcitons? [closed]

I wanted to make a function which gives the frequencies of a number in a specific list, when I came accros this problem. This is what I tried: ...
33
votes
2answers
709 views

Why is the new PositionIndex horribly slow?

This issue has largely been mitigated in 10.0.1. New timings for the final test below are: ...
11
votes
2answers
211 views

Why doesn't a Composition[] hold its arguments and what can be done about it?

Now that Composition (also RightComposition) has shorthand syntax I am more inclined to use it, however what I feel should be ...
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
89 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. ...
12
votes
6answers
791 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
69 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
72 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
62 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
92 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
50 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
53 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
621 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
709 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
96 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
77 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
67 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
64 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
87 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
87 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
260 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
268 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
88 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
100 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
111 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 ...
2
votes
4answers
338 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
72 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
204 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
58 views
0
votes
1answer
46 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
72 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
62 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
95 views

Getting “Null” output from package?

I have a script written to test a package as follows: ...
1
vote
0answers
56 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
200 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
75 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 ...
0
votes
1answer
52 views

ToExpression and Fortran notation

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

What is the formula Mathematica uses for ZetaZero?

What is the formula/algorithm Mathematica uses for the ZetaZero command?
0
votes
1answer
69 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
70 views
0
votes
1answer
53 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
51 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
86 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\{ ...