Tagged Questions

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

learn more… | top users | synonyms

6
votes
1answer
115 views

Is it possible to circumvent a bug inside SeriesCoefficient?

As far as I can tell, there seems to be a bug in SeriesCoefficient: ...
2
votes
1answer
208 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: ...
0
votes
3answers
78 views

Half kth term if n is even and k=n/2?

I am trying to write a function which will perform the equation in the attached image. So far, I have: ...
1
vote
1answer
119 views

How to define a list that contains all primes less than x?

how can I define my own list in which I have all primes less than x?
2
votes
1answer
136 views

Discontinue, then continue x-axis of 2D Histogram

I have the pictured Histogram. It was generated by the following lines: ...
0
votes
2answers
567 views

How to find number of connected components of graph G?

Is there a command that can count the number of components of a graph, in the same way that VertexCount[G] counts vertices?
0
votes
0answers
46 views

Time varying Poisson rate using ParameterMixtureDistribution

I have a system in which there is a Poisson arrival process with rate $\lambda$. I need to split this process into two independent poisson processes $\lambda_i$ and $\lambda_u$. Where ...
1
vote
1answer
79 views

How to study the sign of an expression including a function, with conditions on the function?

I'm trying to study the sign of an expression, having information on some of my parameters. I don't know how to code these conditions. For example, I want to know when this expression: ...
0
votes
0answers
17 views

Using functions as input for a function - won't simplify [duplicate]

I've defined a function P[k_] := 1/[Sqrt]2 (R[k] + L[k]) where R and L generate matrices. However the output of this function never full simplifies (even when I use the Simplify[%] functions). It ...
1
vote
0answers
210 views

Derivative of the Absolute Value Function in Mathematica looks very different from the actual answer

Derivative of the Abs Function in Mathematica looks very different than the actual answer. Why? How to correct this? For example I entered ...
2
votes
1answer
145 views

A question about definite integrals and timing

I need to integrate the expression G given below: ...
1
vote
1answer
76 views

FlipView Alignment problem

Here's the problem with MWE: Framed[ FlipView[Framed /@ {100, 1}, Alignment -> Center] , ImageSize -> {100, 150}, Alignment -> Center] I ...
0
votes
0answers
43 views

Plot two functions of two variables against each other [duplicate]

I have two functions f1(n,m) and f2(n,m) but the issue is that f1 generates many values say ...
2
votes
0answers
63 views

Complicated output from simple Eigenvalues problem

I have code that uses Eigenvalues on matrices of various sizes. But the output of what should be a very simple problem, namely finding the eigenvalue of a 1x1 matrix, is overly complicated. ...
0
votes
1answer
81 views

Blank plot that shows up briefly when changing plot options

I wrote some code in Mathematica to calculate and plot, in tw0 different ways, a function depending of two variables. But the plots are empty even if it takes a few minutes to evaluate the plot ...
3
votes
2answers
329 views

Manipulating slots in a pure function

How does one manipulate the slot numbers in a pure function? Some trick with Evaluate or Hold? I'm aiming for something along ...
0
votes
0answers
42 views

Verify “Type” of solution [duplicate]

I've written some Mathematica functions which allow the user to verify if a mathematical function has certain properties. What I'm basically doing is generating "random" functions in respect of ...
3
votes
2answers
238 views

How to copy a function by value?

I need to change a function symbol multiple times by assigning another symbol to it, but when I'm trying to do that the symbols overwrite each other. I'm assuming this is because the assignment is by ...
0
votes
1answer
62 views

nested series expansion

I have to invert the following matrix in which the functions U[t,x,y,r] and K[t,x,y,r] and all their derivatives are "small"; ...
1
vote
0answers
25 views

Minimizing roots of a transcendental equations [duplicate]

I'm trying to use the solution of FindRoot with parameters for further calculations. Annoyingly enough it always gives me trouble with replacing the parameters. As an example I'm attaching a simple ...
1
vote
1answer
75 views

Selection of the position of the variable

I defined a function funloglogplot to make a loglogplot of a function (function1) depending on several variables ...
0
votes
1answer
76 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 ...
1
vote
0answers
38 views

How can I use the Rules returned by FindFit? [closed]

When I evlauate data = RandomReal[10, {5, 10, 2}]; fit[i_] := FindFit[data[[i]], a Sin[x] + b, {a, b}, x] fit[1] I get something like: ...
0
votes
0answers
52 views

Fold Dynamic Function [duplicate]

I'm making on a demo working with differential equations as functions of two variables (x and y). The demo will have to Fold the differential equation with an initial y-value and a series of x-values. ...
0
votes
0answers
153 views

Calculating the Lyapunov Exponent/Spectrum for the Duffing Oscillator

Some fellow students and I are trying to calculate and plot the Lyapunov spectrum for the Duffing oscillator (currently a test approach). Each of us has Mathematica knowledge based purely on past ...
0
votes
0answers
157 views

A problem with functions and Infinite expression 1/0 encountering

Following code (function) makes integrals and then replace f[x] with Cos functions and calculate the definite parametric ...
0
votes
1answer
112 views

A problem with set values

The following code is just an example to clearly explain my problem. Assume that : ...
3
votes
2answers
186 views

Need to create a function to generate all permutations of Range[$n$] [duplicate]

Basically I need a function that takes a list and gives all the possible permutations of it. The reason I can't use Permutations is that I have to apply another ...
1
vote
1answer
96 views

What is happening in Map[Function[x, x^2], a + b + c] from the Pure Function tutorial

The Pure Function tutorial gives an example: Map[Function[x, x^2], a + b + c]. I would expect the output to be (a + b + c)^2, ...
4
votes
2answers
291 views

Understanding Transpose

It is very likely that it is my lack of math skills that is showing up here. However, I think Transpose is such an important function that I need to master it. So I ...
2
votes
1answer
150 views

Dynamically Updating Function

I use Mathematica 8 and am working with DynamicModule. I'm trying to enter a function in an InputField then later apply it to two values entered in subsequent Input Fields. The function just does not ...
2
votes
0answers
54 views

Can BreadthFirstScan be modified?

I would like to obtain a "slick" implementation of A*-search algorithm on Graph objects, using the built-in BreadthFirstScan (if that is possible at all). I noticed that BreadthFirstScan is static in ...
0
votes
0answers
26 views

JacobiCN inaccuracy

For my calculations I need JacobiCN[s,k] for s near 0 from the left and k near 1 from the ...
8
votes
3answers
339 views

How to protect functions in a Mathematica Package?

I'm writing a Mathematica Package with many functions, but only two can be seen/public. I have: ...
0
votes
1answer
89 views

Is there a function for falling factorial in Mathematica

If I had to construct a function for falling factorial in mathematica I'd do something like that (hope I'm not mistaken): fallfact[x_,k_]:=$\prod_{j=0}^{k-1}(x-j)$ But is there a built-in ...
6
votes
2answers
250 views

Binomial[-1,-1]

According to various sources e.g. http://www.proofwiki.org/wiki/Definition:Binomial_Coefficient and Wolfram themselves http://functions.wolfram.com/GammaBetaErf/Binomial/02/ , the binomial ...
2
votes
1answer
114 views

Symbolically Expanding One-Variable q-hypergeometric Series

In general, how do I get Mathematica to symbolically expand various infinite series to an arbitrary degree of accuracy? I deal with q-hypergeometric series quite frequently, and specifically want to ...
3
votes
1answer
182 views

Put random points into a specific 2D subregion

I want to cover a particular subregion of the x-y plane with a random distribution. As this particular region is not a circle I encounter some problems declaring the permitted zone where to put ...
3
votes
3answers
211 views

Finding a better way to define a matrix

I first defined a 171x171 matrix containing only zeros and then replaced 18 specific rows with nonzero entries. The other $153$ rows will be average of $2$ of the existing $18$ rows. Rows $2$ ...
1
vote
2answers
194 views

Given an equation with one parameter, how do I use NSolve to solve it for many values of the parameter?

I was wondering if there was a way to use the Mathematica NSolve command to solve an equation that has a parameter with various values. An example of which is: ...
1
vote
3answers
180 views

How to update a list in a function in each iteration

There is a list with numbers 1 to 8 ( p1 ) and another list (j) which contains 4 numbers which shows different 4 positions of ...
0
votes
1answer
76 views

NDSolve accuracy related problem

I want to solve this equation: ...
2
votes
1answer
101 views

Problems with BSplineFunction vs. BSplineSurface

Why are those surfaces different? ...
0
votes
0answers
61 views

For loop efficiency [duplicate]

What is a more efficient way of solving this problem? By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms. ...
-1
votes
1answer
94 views

Transformation of a simple logic statement

I'm designing a logic circuit and I was wondering if the following two things are equivalent: (x <= y) and (x < (y + 1)) I can't think of any set of numbers that would make these two things ...
0
votes
1answer
52 views

How to put some values from a list into a function in a Do loop

I want to program a code in MATHEMATICA in order to calculate some values in different iteration. For example, assume this list: list={1,2,3,4,5} Now assume that ...
1
vote
2answers
93 views

Avoid making repeated Random Integer in different iterations

Assume following code : Do[ i1 = RandomInteger[{1, 5}]; i2 = RandomInteger[{1, 5}]; While[i1 == i2, i2 = RandomInteger[{1, 5}]] , {k, 1, 4}];` This ...
7
votes
1answer
366 views

Why won't my function plot?

If I define ...
1
vote
2answers
209 views

How to evaluate Modules in a notebook from another notebook?

I would like to create a notebook populated with several modules and be able to evaluate these modules by running a separate notebook. I have attempted several uses of the ...
1
vote
2answers
165 views

Plot a function which depends on itself

How can I plot a stepwise function like f[a, t] = 10 Exp[-0.1 Sin[t]] for a > t and ...