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

learn more… | top users | synonyms

0
votes
0answers
41 views

Trouble outputting Plot

I am trying to solve a system of ODEs and plot them with Manipulate but I keep getting blank outputs. Below is my code: ...
0
votes
1answer
39 views

Convolving data set with gaussian profile

I have a spectrum looking like List, and I want to convole it with a gaussian of the form PDF[NormalDistribution[μ, σ], x] (where σ also depends on x). The raw ...
2
votes
0answers
35 views

Make Mathematica show function template's arguments in different lines (i.e. in column) by default?

I feel a bit uncomfortable with Mathematica 10's layout. I mean, I'm impressed how powerful functional programming can be and so on, but it's me or those programs are often just a bunch of nested ...
0
votes
1answer
50 views
0
votes
1answer
123 views

How to apply a tensor to a list of arguments

The problem I have is the following: Let C be a list of coordinates, say, C = {x1, x2, ..., xn} and ...
0
votes
0answers
51 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}}; ...
0
votes
0answers
34 views

Plotting four optimization solutions together on one plot [on hold]

I have three variables. One of them might be a constant. I have four functions. I would like to plot them in a special way. Different pairs of variables give different values for each function. I ...
2
votes
3answers
82 views

Speeding Up Replacing of Labels in Large Matrix?

I am Mathematica novice and am trying to find a fast way to replace labels in some rather large matrices (512x512 or 1024x1024) that have resulted from segmenting images with WatershedComponents or ...
5
votes
1answer
105 views

Why is AllTrue much slower than VectorQ?

This seems to be a theme with V10, a new function dedicated to a specific task doesn't live up to expectation performance-wise. Mr. Wizard has already uncovered 2 such functions here and here. So how ...
18
votes
3answers
487 views

DeleteDuplicatesBy is not performing as I'd hoped. Am I missing something?

Déjà vu: a new-in-v10 function should provide a better solution to an old problem, but my enthusiasm is curbed when I run timings. This time the function is ...
0
votes
1answer
39 views

Collapsing summation

I am trying to write a command to collapse the sum of terms into an expression with summation. Something like ...
0
votes
1answer
92 views

Plot3D unable to understand input function

I'm attempting to plot the Wigner Function of the Morse Oscillator defined as ...
5
votes
5answers
504 views

Prevent Part[] from trying to extract parts of symbolic expressions

If you have a list, e.g. {1, 2, 3} then you can extract the $k$th part using Part (...
1
vote
1answer
49 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 ...
29
votes
5answers
874 views

Why is there no PositionFunction in Mathematica?

Too often I have seen the programs of inexperienced users greatly slowed by using Position in an iterative fashion, when far faster would have been to compute a ...
1
vote
1answer
80 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
49 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
71 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: ...
29
votes
1answer
454 views

PositionIndex is horribly slow

I do not know how best to formulate this as a question but the new PositionIndex is horribly slow. Using Szabolcs's clever ...
10
votes
2answers
191 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 ...
11
votes
4answers
388 views

Plot the minimum of a list of functions

This is my first question on any stack-exchange site and I'm also very new to using Mathematica software so please excuse/correct me if I mess up. I would like to take a list of functions of a single ...
0
votes
1answer
79 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 ...
8
votes
4answers
494 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 ...
0
votes
0answers
83 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. ...
1
vote
2answers
57 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 ...
0
votes
1answer
107 views

Fixed Point Math in MMA

I am working with a library that needs input in a Fixed Point notation. I’d like to figure out a way to convert the floating point results into fixed point representation. The fixed point length is ...
1
vote
1answer
64 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
43 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
74 views

How can I represent this automorphism of Q(i,a)?

Let $a$ represent some real irrational number. I am trying to perform computations with an automorphism $f:\mathbb{Q}(i,a)\to\mathbb{Q}(i,a)$ which fixes $\mathbb{Q}(i)$ pointwise and maps $a$ to $i ...
3
votes
2answers
76 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 ...
0
votes
1answer
44 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 ...
0
votes
0answers
25 views

Getting a function constant values from it's f(x) [migrated]

Hello I'm new to this StackExchange site, in case this is off topic please point me out in the right direction. It's been about 3 years since I solved a math problem so I need some directions (not ...
8
votes
3answers
586 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 ...
4
votes
3answers
526 views

Simplify function notation

I have some calculations with arbitrary functions. In the output, Mathematica always shows the functions with its arguments. I would like to tidy the notation a bit, by hiding the arguments in the ...
8
votes
8answers
619 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 ...
11
votes
1answer
260 views

Overloading second argument of CountryData

For convenience I'm trying to add an extra property to CountryData ...
10
votes
4answers
652 views

How to find the domain and range of an implicit function?

For example, we have this curve: $$ x^2 + y^2 = 1 $$ Is there a function in Mathematica for finding out that the ranges for $x$ and $y$ are both [-1, 1]? What ...
1
vote
2answers
105 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
2answers
71 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 ...
-1
votes
3answers
115 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 ...
0
votes
0answers
62 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 ...
0
votes
1answer
60 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 ...
13
votes
4answers
378 views

How to make a function with its own options as well as passing options to other functions [duplicate]

I have a function with many of its own options, but I would also like to pass options to subfunctions using the FilterRules function. Here's a simple example: ...
0
votes
1answer
58 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
85 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
78 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
73 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 ...
3
votes
3answers
224 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 ...
6
votes
1answer
254 views
0
votes
3answers
85 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 ...