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

learn more… | top users | synonyms

7
votes
1answer
394 views

RootSum result manipulation/simplification

Consider the sum sum1 = Sum[ k/( k^7 - 2 k + 3), {k, Infinity}] ...
3
votes
1answer
241 views

Evaluation of self-defined functions

I defined a function that I call disc which I want to minimize later. The function is defined as ...
0
votes
1answer
392 views

Why is the CTRL + / not working?

I've learned how to use this shortcut to input fractions in the 2D form, it worked nice on my notebook but I can't make it on my desktop. Any tip on what could be happening?
11
votes
4answers
590 views

Assessing argument type in set delayed function definitions

I'm wondering how to properly assess the type of arguments passed to functions defined with :=. I want my functions to be the most efficient, unambiguous and clear ...
-5
votes
3answers
459 views

Constructing lists by applying functions to another list

Suppose f is a function of two variables: $f = f(x,y)\quad$ and $L$ is a list. Could someone help me in defining a list of the form: $D = \{f(x,y)\ |\ x \in L,\ y \in L\}$ I tried this: ...
17
votes
2answers
2k views

Sum or Product with Exclusions

Is there a built-in feature for handling things like: $$\sum_{\substack{i=0\\i\ne j}}^n\frac{a-a_i}{a_i-a_j}$$ and $$\prod_{\substack{i=0\\i\ne j}}^n\frac{a-a_i}{a_i-a_j}$$ or should I work out some ...
1
vote
1answer
373 views

How to substitute variables in interpolated function?

I'm looking for the way to substitute variables in interpolated function again to original one. (I want to know how to get P(r, theta) from Psol(v, w).) The original variables : ...
0
votes
0answers
208 views

How Can I Use Conditional with Rational Domain Restrictions [duplicate]

I am reasking this question in a new thread. My previous post How Can I Use Solve/Reduce Output? seemed to have led to a an interesting dissussion of how to (better) solve the problem that produced ...
5
votes
1answer
1k views

How Can I use Solve/Reduce Output

Suppose I want x and y to be rationals Solve[ x^2 + y^2 == 1, {x, y}, Rationals] I am ...
3
votes
2answers
209 views

How does RootOfUnityQ work?

How does Mathematica's RootOfUnityQ function work? That is, how does Mathematica know if a number is a root of unity? Example: Let $x = \frac{1-i \sqrt{2+\sqrt{5}}}{1+i \sqrt{2+\sqrt{5}}}$. Then ...
7
votes
3answers
250 views

Get unevaluated option value?

This is kind of a follow-up to this question. I want to be able to define a function that takes an option, and then, inside the function, retrieve and test the unevaluated value of the option. For ...
3
votes
0answers
112 views

ProbabilityDistribution PDF on boundary points

I would like to evaluate the PDF of a custom ProbabilityDistribution at the min and max values. However, PDF[...] returns 0 at ...
11
votes
2answers
3k views

Pass function or formula as function parameter

I can write either Integrate[x^2, {x,0,3}] or f[x_] = x^2 Integrate[f[x],{x,0,3}] and get the same computation. Suppose I ...
8
votes
2answers
814 views

Speed up Mathematica code involving Convolve

I'm trying to plot the averaged autocorrelation function of a random wire profile $\xi(x)$ which is build from unitsteps which are each L units long. To calculate the average I'm generating nMax ...
10
votes
1answer
2k views

What is the difference between Set and SetDelayed?

I have a problem with defining a function and most of time I get confused by Set or = and ...
6
votes
2answers
768 views

Evaluating an If condition to yield True/False

I would like to decide whether an option passed to my custom function has the value Automatic or something else. This is my attempt: ...
2
votes
1answer
2k views

Function output from DSolve

I want to get a function as output form DSolve. For Example : sol = DSolve[{Q''[t] + 40 Q'[t] + 625 Q[t] == 100*Cos[10*t], Q[0] == 0, Q'[0] == 0}, Q[t], t] I ...
19
votes
1answer
303 views

What does “EquationalLogic`FindCounterexample[]” do?

I found the undocumented EquationalLogic`FindCounterexample[] by browsing the lists of available symbols, but I have no clue about its purpose. The name is ...
8
votes
2answers
2k views

Finding all partitions of a set

I'm looking for straightforward way to find all the partitions of a set. IntegerPartitions seems to provide a useful start. But then things get a bit complicated. ...
13
votes
6answers
436 views

Comparing the last output of a nested function with all the previous ones

my main question is how I can compare the last output of a nested function with all the previous ones and stop iterating when I find a repeating value. (I have 2 other questions but I think they are ...
4
votes
3answers
3k views

Why won't Mathematica Integrate my function?

My code: ...
1
vote
2answers
199 views

Expectation over a list with nested-mapped expressions

I need expected values of a list where the random variable to take expectations over should be an input into expressions defined earlier. I suspect Set[] and SetDelayed[] tripped me. (Or Map and ...
3
votes
2answers
641 views

How can I assign a Fit result to a function?

I have this code ...
2
votes
3answers
268 views

How to Compute Aggregate Best and Worst Cases for a Large Number of Estimates?

I need to aggregate multiple estimations, but I haven't been able to find a built-in function in Mathematica that aggregates multiple probablity estimations (I am specially interested in estimations ...
17
votes
5answers
7k views

How to find the domain and range of a function with Mathematica?

I'm studying calculus and in some exercises I am asked to find the domain and range of a function. Does Mathematica have already a built-in function for this? I can imagine some ways of doing so, ...
0
votes
2answers
130 views

About minimizing calculations when using ComposeList

I have a lot of functions to use in a iterative way, and I need some of the calculation results. For example: ...
6
votes
5answers
273 views

How to nest my own “times” function to get powers

I have a "times" function. I'd like to create a power function using it. It should look like this for an 6th power: ...
3
votes
2answers
379 views

What is the command to find function invariant?

What is the command to find function invariant? http://demonstrations.wolfram.com/AFunctionInvariantUnderAGroupOfTransformations/ what is algorithm it use to calculate this? Edit there is a book ...
2
votes
2answers
151 views

Custom function not returning any output

I'm trying to write a custom function but it isn't returning any output. Here's my code so far: ...
7
votes
2answers
2k views

How to create a rectangle wave (duty cycle $\ne$ 50 %)?

I'm trying to use phase-shifted SquareWave[] functions to create a rectangle wave: ...
3
votes
2answers
597 views

decompose a number (less than 255) in a sum of powers of 2

Is there a built in function that would take a number and decompose it into a sum of powers of 2? The numbers will be non negative less than 256. For what it's worth I'm trying to understand a paper ...
5
votes
1answer
130 views

How to make the Show function work in this case?

I can't get this to work, the Show function shows only the first plot. Why this happens and how to solve it? Show[Plot[x^2, {x, 2, 10}], Plot[1 - x, {x, 1, -10}]] ...
2
votes
2answers
625 views

Conditions for Piecewise[ ] Command

I am trying to plot a function in which is piecewise defined. I found the Fourier coefficients of this, and my question is how to define even & ...
6
votes
1answer
602 views

Evaluate continued fraction

Mathematica has the ContinuedFraction[] function to give the continued fraction expansion of a rational (or approximation of a real) number. I'm interested in the ...
7
votes
2answers
205 views

Why does Solve and Sum give different answers when according to Table it is the same sequence?

I have been thinking about a piece of code today, but I don't understand why I get different outputs from two in my mind similar Mathematical sums. First I observe that the Table command for this: ...
2
votes
3answers
782 views

Output of plots from within Do[ ] Command

I am wondering why the following does not plot the way it's written and exactly how does the Do[] function operate? I think I could be using it incorrectly. ...
8
votes
1answer
1k views

(Non-Convex) Polygon Union and Intersection Functions [duplicate]

Possible Duplicate: Intersecting graphics Back in 2009 I posted a question in comp.soft-sys.math.mathematica looking for a function which generates the union of two (not necessarily convex) ...
2
votes
3answers
175 views

Using Nest inside NestList

I need results like this: {Cos[Cos[x]], Sin[Cos[Cos[x]]],Cos[Cos[Sin[Cos[Cos[x]]]]], Sin[Cos[Cos[Sin[Cos[Cos[x]]]]]], ... } I've tried to use ...
16
votes
3answers
334 views

How to keep some of the results of the NestList

I'm using some iterative arithmetics to calculate wave propagation with the help of NestList. I have to use a small step size for iteration to guarantee the accuracy, which lead to too much data (e.g, ...
10
votes
1answer
242 views

How to pass composite function list to SortBy?

In order to sort alphanumeric-as-string data of the form {"T3", "T14", "T1", "E2"}, so that "T14" comes after ...
2
votes
3answers
220 views

Ways to change an explicit function into a pure function

I'm trying to use FixedPoint to solve a transcendental equations, but the first argument of the FixedPoint should be a pure ...
5
votes
1answer
129 views

RankedMax and Max do not behave identically

I have spent three hours debugging some code and at the end I think I found a bug. Otherwise I cannot explain what I am seeing: When I want to use RankedMax on ...
1
vote
3answers
3k views

How to write values of function to file?

For example, say I wanted to plot Sin(x) like this: Plot[Sin[x],{x,0,2 Pi}] But instead of plotting to a graph, I want to now tabulate the values of Sin[x] to a ...
6
votes
4answers
373 views

Why does my function defined with constraints on patterns not work? [duplicate]

Possible Duplicate: Why doesn't PatternTest work with Composition? My function is something like this, ...
7
votes
5answers
358 views

Is it possible to insert arguments into functions when they're used like Function@ or //Function?

Is it possible to insert arguments into functions when they're used like Function@ or //Function? Sometimes I need to do this, but then I have to return to the standard function usage: Function[] ...
11
votes
2answers
1k views

Converting ConditionalExpression to Piecewise

I have Solve[] return a list like ...
14
votes
1answer
265 views

What Method options does FindInstance accept?

While answering Trouble getting FindInstance to return multiple results for certain constraints it became clear that for this problem FindInstance would be better ...
-3
votes
1answer
841 views

How to find the maximum value and the argument of a function of three variables y dividing into grids?

I am dealing with a non-linear function of three variables, namely R0k, R1 and alpha. To find its maximum value, I divided the three variables into grids and maximized the function by plotting the ...
8
votes
2answers
795 views

What is the Mathematica equivalent for the Excel function tinv()?

TINV() returns the t-value of the Student's t-distribution as a function of the probability and the degrees of freedom. For example ...
12
votes
3answers
553 views

How to make the suggestion box appear?

When you type a function in Matlab, quickly a suggestion box comes up showing functions similar to the one you're typing. I thought that Mathematica didn't have this but one day, I typed half of a ...