2
votes
0answers
66 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. ...
-2
votes
1answer
194 views

How to solve a non-linear equation?

I am trying to solve the following non-linear equation: $\frac{i e^{-x^2} \sqrt{\pi } x}{K^2}+\left(-0.131251-0.0379031 x^2-0.0151154 x^4-0.0100462 x^6+0.5 \left(0.00273859 +0.0400003 K^2\right) ...
0
votes
1answer
87 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 ...
0
votes
1answer
579 views

Solving a large system of non-linear equations

I am new to Mathematica, and I am currently trying to use it to solve a large symbolic system of non-linear equations. I began the code below about 30 hrs ago, and the Mathematica Kernal has been ...
4
votes
1answer
105 views

Pattern matching and HoldForm

Create rules based on data. I have a system that picks out on date,based on some rules. I then want to generate a new rule based on this date and apply the rule to a new dataset. ...
2
votes
1answer
98 views

What is the proper way to the pattern form Repeated in my code?

I'm matching a pattern with Repeated (..) How can I use the repeat count in the replacement rule? Example: ...
2
votes
1answer
397 views

Truncate High order terms

Suppose I want to compute this : Series[Sin[1/f], {f, Infinity, 10}] but finally I prefer Sin[1/f] up to the fourth order in ...
0
votes
2answers
178 views

Fraction of fibers that have failed

I have the following to set into mathematica. Assume a stress(sigma) applied on a specimen which has a number of fibers within it. All fibers that have a strength less than the applied stress should ...
2
votes
1answer
130 views

Histogram scale error when using DistributionChart

I'm a novice Mathematica user that is having some problems using the HistogramDensity function in a DistributionChart. My observations are heavily skewed to one category and the height of the other ...
7
votes
2answers
902 views

Solving the Helmholtz equation in polar coordinates

I'm trying to (as a simple starter) find the solution to Helmholtz equation in polar coordinates -- I already know what it is and can derive it by hand, but just want to start here before asking ...
0
votes
0answers
65 views

Using NSolve in a function, selecting one indexed result and using it to plot another function containing a function containing the indexed result

I have a problem using the result pcvar[g] g e (0,1) in the plot cvar1. In the plot cvar I can use it. It must be somehow connected to clearing p in the definition of pcvar[g]. I am gratefull for any ...
13
votes
1answer
3k views

How to request financial data from Yahoo's YQL and Quandl?

How can I download historical data from Yahoo ? Although Mathematica's FinancialData function uses Yahoo it could be useful to have more control on how to retrieve data from Yahoo's YQL. Edit ...
0
votes
1answer
100 views

Graphing the sequence {$p_k$} = $\frac{c - a + dp_{k-1}}{b}$ [duplicate]

Graphing the sequence {$p_k$} = $\frac{c - a + dp_{k-1}}{b}$ I need to know how to graph this function where it automatically plugs in the previous term for $p_{k-1}$, the coefficients are of my ...
3
votes
2answers
418 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 ...
12
votes
1answer
964 views

Creating a Mathieu stability diagram

I am attempting to re-create a Mathieu stability diagram like the one shown here: I expected that I could use MathieuC to generate this graph by assuming that ...
5
votes
1answer
85 views

MapIndexed stops at levelspec 1 if only the index is passed?

If the function passed to MapIndexed references the first (or data) argument, the following performs as expected: ...
4
votes
1answer
135 views

Strange ImageFilter results

I am trying to perform some neighborhood analysis on an image, but ImageFilter seems to be interfering with the results outputted by the provided filtering function. Initialization Given the hue ...
15
votes
2answers
402 views

Is there a better way to add elements to a Graphics expression repeatedly?

Consider simple example where a set of points is generated and some are displayed. ...
3
votes
2answers
148 views

Using MousePosition on the entire screen - Screencast with Linux

In order to record animations more easily while using Mathematica on Linux, I would need to know how to get the position of three clicks. The following picture (main part generated by ...
6
votes
1answer
141 views

Path construction using `Nearest` shows ill behavior?

I have a dataSet that I'm trying to sort choosing a starting point and going to its nearest neighbor, and then to its nearest neighbor and so on. To do so, I've ...
1
vote
1answer
95 views

How to create list of delayed rules? [duplicate]

I am trying to make a ButtonBar that prints the name of the card in question. What I have so far is as follows: ...
3
votes
0answers
285 views

Function with a sharp resonance which Mathematica fails to integrate. Why?

I'm a new user of Mathematica and I'm trying to use it to calculate the collisional cross-section as a function of energy for a given potential and decay rate. I know that the resulting function ...
-3
votes
1answer
133 views

How to show a general graphic (not a Plot) inside a Manipulate

I'm building a little interface, which consists only of a button, as you can see here: ...
0
votes
1answer
237 views

NMinimize holding problem

I have a function that I want to minimize numerically through an NMinimize command (because it's very complicated analytically). The minimizer call looks as follows: ...
0
votes
0answers
43 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 ...
0
votes
1answer
154 views

Notebook keeps running when Solve for variable

This might be a simple question for the most of you, but I am very new to mathematica so please bear with me. I'll refer to the code below: ...
1
vote
2answers
77 views

List operation on specific elements [duplicate]

Let's consider two tables given by T1 = Table[{i,j,f1[i,j]},{i,0,2},{j,0,3}]; T2 = Table[{i,j,f2[i,j]},{i,0,2},{j,0,3}]; The functions ...
4
votes
2answers
990 views

What is the efficient way to code Successive Over-relaxation (SOR) method in Mathematica?

I have written a SOR method (SOR is this method) code using C-style procedural loops. However, I think there might be (much) better ways to achieve the same end in Mma avoiding these loops. So my ...
5
votes
1answer
500 views

Apply color function to matrix plot

I want to apply the following color rules to a large table of numbers. I have extracted a part of the table to use as an example. I would like to assign 5 different colors to 5 different ranges of ...
2
votes
1answer
99 views

Dynamic Syntax - Evaluate AppendTo as the second argument

I am attempting to Append a new value into my list paramMonitor whenever the value for B ...
1
vote
1answer
197 views

Simple subtraction question [duplicate]

I have two lists. a = {{2, 2}, {3, 3}, {4, 4}, {5, 5}}; b = {1, 1}; I want to subtract a from ...
3
votes
2answers
451 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 ...
2
votes
2answers
166 views

NIntegrate - WorkingPrecision

I am trying to NIntegrate this expression. It is very close to zero, and so gives all possible types of errors. More precisely, ...
5
votes
1answer
171 views

NDSolve - sampling for result during the computation

I am using NDSolve for a Langevin dynamics problem. I want to the know long term behaviour of my system ($t>1$) but it has to be simulated with very small time steps ($dt\sim 10^{-9}$). An example ...
2
votes
2answers
111 views

Ordered indices of a multiple product or sum

Given a summation like $$\sum_{1 \leq i_1 < i_2 < \dotsc < i_k \leq n} f(i_1, i_2, \dotsc , i_k)$$ how can the lists of indices be enumerated? For example, if $n=4$ then the possible lists ...
2
votes
1answer
56 views

Using SetDelayed wih SQLExecute

I want to create a reusable line of code that I can send a column, table name and criteria to match using the WHERE clause. ...
1
vote
1answer
181 views

Expressing a joint distribution for use in ContourPlot

I have $$X_1=T + W$$ $$X_2=2 T + 3 W$$ where $$W \sim N(3,5) \,\text{;}\,\, T \sim N(1,2)$$ and $$P(X=X_1)=P(X=X_2)=\tfrac{1}{2}$$ which I have awkwardly expressed as ...
2
votes
1answer
104 views

What is “ (Dialog) Input [ ] := ” after evaluating a cell?

I have done a time-consuming run and calculation. After many hours ( about 7 hours!), the black color which shows that the cell is evaluating, turn into gray and a strange text appears like this : ...
10
votes
3answers
382 views

Riffle and Partition

At some point I noticed that I was using Riffle and Partition together a lot. I would do things like ...
5
votes
1answer
165 views

Prevent package from being opened in a notebook interface

I have a package which I need to deploy in a client's environment. It has proprietary code and solutions that I need to protect from prying eyes and inquisitive minds. The forum has discussed much ...
1
vote
1answer
125 views

Scope of variables within a Manipulate expression [duplicate]

I have a problem in defining the local variables. I have this code: ...
-1
votes
1answer
100 views

How do I count a number of primes(say smaller than N) that does not contain 5?

Title says it all. How do I count a number of primes(say smaller than N) that does not contain 5?
0
votes
1answer
81 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"; ...
0
votes
2answers
227 views

Kronecker delta notation

Is there an easier way to enter KroneckerDelta[n,m] in Mathematica? When I use the notation $ \delta_{n,m} $, it won't work.
0
votes
0answers
106 views

Plotting the solutions of a system of differential equations on a simplex

I want to solve and plot the solutions of the following system on the triangle simplex: x'[t] == x[t]*(2*x[t] - 2) y'[t] == y[t]*(2*x[t]) z'[t] == z[t]*(2*x[t]) ...
0
votes
1answer
54 views

Substituting a function in the output

I have to calculate the derivatives of the function K defined in the code: ...
0
votes
1answer
108 views

Is there a way to use pause in Manipulate?

Is there a way to do any similar to Do[Print["Iteration...", j]; Pause[1], {j, 1, 6}] with Manipulate? (to show the ...
9
votes
0answers
162 views

Is there a PrimeQ whose accuracy guarantee you can adjust?

Say I have a list of a million integers each with a million digits, and I want a crude sieve to see which have a chance at being prime. Mathematica has a PrimeQ function, which appears to be slow ...
4
votes
0answers
129 views

Given two samples, how does LocationTest select its AutomaticTest?

How does LocationTest select its "AutomaticTest" when testing two samples? Background: A previous post poses a similar question ...
21
votes
4answers
1k views

Detecting patterns of black and white stones on a 2D board

I'm writing a program to play a game of Pente, and I'm struggling with the following question: What's the best way to detect patterns on a two-dimensional board? For example, in Pente a pair of ...

15 30 50 per page