3
votes
0answers
121 views

Why does Mathematica show 4095/4096 terms in TrigExpand?

Clear[x, n]; expr = Cos[x]^(n - 2) (1 - Cos[x]^2 + Sin[x]); r=TrigExpand[expr] Where do those 4095/4096 comes from? It is correct, but it seems very strange ...
7
votes
0answers
120 views

How to execute code on FrontEnd quit?

I would like to execute a block of code whenever the FrontEnd quits. I know about $Epilog, but it seems that this would execute every time the kernel quits, which ...
-6
votes
1answer
105 views

Plot 2 student T distributions with different center values

Plot 2 student T distributions with different center values µ, but same DOF. The center values,µ has to be 45 and 48, DOF shall be 9.
0
votes
1answer
43 views

Is there a limit for DensityHistogram data amount?

I'm trying Mathematica for first time and while trying to do a Density Histogram with around 300 000 points, I get an error "THE INPUTED DATA is not a valid dataset or list of datasets." Maybe it's ...
1
vote
0answers
136 views

Speed up replacement using Rule Dispatch Associtation

I knew that this has asked many times, but I hope there is something more could be done to speed this up. The expression kappa is here. ...
4
votes
1answer
496 views

Fast matrix multiplication in MMA and GPU

Matlab multiplies two 3000by3000 matrix around 0.18s faster than MMA. While for just a few matrix multiplications the speed difference is not important, it becomes crucial when I want to do those ...
0
votes
0answers
92 views
8
votes
1answer
277 views

Aristic rendering of breaking waves from a Japanese panel

Any insight to model and render the breaking waves in the style of this - likely Japanese or possibly Korean panel? Line drawings are acceptable, not necessary to replicate all the details like ...
2
votes
4answers
1k views

How to create a histogram from a given frequency table

I wanted to draw a histogram as in the photo above, I typed the command: ...
2
votes
0answers
94 views

How do I apply assumptions to a module (or any CompoundExpression)?

Edit: I am looking for a way to apply assumptions to all expressions contained in a compound expression. For example, ...
13
votes
5answers
807 views

Gap in a continuous plot

Why do I get a gap in the plot below and how can I fix it? (If you are interested in it, you can see a new related question: How to plot an implicit value funtion, which is also a little chanlenging) ...
0
votes
0answers
87 views

ViewPoint: Saving coordinates in a text file

How should I save (Export?), all coordinates of the ViewPoint, in a text file when I rotate the ...
6
votes
2answers
111 views

Sum considers RandomInteger[] as a constant

Perhaps this is expected behavior, but I was kind of surprised by the following: ...
0
votes
2answers
134 views

How to fit points in a picture using locators

I've got a problem doing some analysis work on some of my spectra. I am basically looking for features that look like parabolas. In need of a tool to quickly find two parabolas in a spectrum (they are ...
0
votes
2answers
83 views

Solving coefficients of a function having boundary conditions

I have a function F=c+dz, which has particular boundary values, say F(z=1)=2 and F(z=-1)=1, ...
13
votes
1answer
1k views

How to map an image to get an illusion of 3D

I would like to distort or map a given jpg so it looks 3D when viewed from certain angle, as in the following youtube video: http://www.youtube.com/watch?v=IfCCUd8mFtg. The most interesting part of ...
1
vote
1answer
146 views

Polar image plot

I would like to perform the polar plot of an electron microscope contrast transfer function, into a black and white image. I have used the equation ...
0
votes
1answer
54 views

Help for properly writing simple derivative expression

I need help to write the following expression (only 1 iteration): f(x) = ...some basic function... f[X0,...,Xp] = f(p)(x0) / p! What I have so far: ...
8
votes
3answers
712 views
4
votes
1answer
65 views

How to make Association reflect new assignments

How do I get Association to act like List in the following? ...
2
votes
2answers
129 views

FullForm applied to functions

I would have expected FullForm[Cases[{a^2, a^3}, a_^1]] to produce Cases[List[Power[a, 2], Power[a ,3]], Pattern[a, Blank[]]]...
5
votes
2answers
125 views

Why does Rule behave like this?

Why does {x, x^2, x^3, a, b} /. x^n_ -> f[n] result in {x, f[2], f[3], a, b} when ...
10
votes
2answers
855 views

Resolution problem of ContourPlot

I met a tricky problem with ContourPlot, which is when I change the range of my variable, I get a totally new figure. For example: ...
4
votes
4answers
242 views

Extract Specific Dates from DateList

Hopefully this is an easy question but I couldn't find an easy answer anyway. Surely there is some simple way to splice this... I want to take a large datelist in the format of {{2014,12,31}, value} ...
2
votes
2answers
147 views
0
votes
2answers
56 views

Matching exponents using Cases[]

I have a question regarding pattern matching. Can anyone explain the results i get ? Cases[Table[x^n, {n, 1, 10}], a_^1] Which gives the following result. {x, ...
0
votes
2answers
74 views

trouble with adding a legend to a plot

I am having trouble with adding a legend to a plot. this is my code,I tryed to use serval things,like ...
1
vote
1answer
185 views

How effectively Mathematica calculates Sum[Sum[a_k k^m, {m, 0, n}], {k, 1, p}] as a function of n?

Suppose that I have a polynomial of order $n$ $$ f_n(k)=\sum_{m=0}^n a_k k^m, $$ where $k$ is an integer and $a_k$ are arbitrary real numbers. Now I want to use Mathemtica to calculate $$ \sum_{k=1}^p ...
3
votes
2answers
470 views

Plotting boundary of piecewise function in ContourPlot

I am trying to do a ContourPlot of the following function: $$\psi=\begin{cases}\left(\sqrt{x^{2}+y^{2}}-\frac{0.25^{2}}{\sqrt{x^{2}+y^{2}}}\right)\frac{y}{\sqrt{x^{...
4
votes
2answers
245 views

How to plot this region?

Consider the $2\times 2$ matrices \begin{align} A=\begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix} \end{align} and \begin{align} B=\begin{bmatrix} b_{11} & b_{12} \\ b_{...
5
votes
1answer
175 views

Ruth-Aaron quadruple challenge

This a computational challenge, to find an efficient algorithm to discover a quadruple $(n,n+1,n+2,n+3)$ with the same sum of prime factors as described in the MO question, "Ruth-Aaron triples, etc." ...
1
vote
1answer
134 views

Write 7. as 7.0 and .7 as 0.7 [closed]

i would like to know how to do in order to transform using a function .7 in 0.7 and 7 in 7.0. I need that the values in the list will really change because i must print them in a text file. Thank you....
1
vote
2answers
701 views

NDSolve with Explicit, Implicit Euler and Trapezoidal method

I am using Mathematica 9.0 both on Linux and Windows and I would like to integrate the Van der Pol equation numerically using various techniques such as Explicit and Implicit Euler and Trapezoidal ...
10
votes
1answer
658 views

Moving polygon on path curve to create 3D shape

How can I move some polygon list = {{0, 0}, {0, 15}, {7, 13}, {2, 13}, {2, 5}, {5, 5}, {5, 3}, {2,3}, {2, 0}}; Graphics[{Black, Polygon[list]}] so it follow some ...
10
votes
1answer
280 views

Max element of a list with a custom ordering function

I need a function to find max element of a list according to some custom ordering function, assuming that the function implements a total order (elements being compared might not even be numbers). ...
0
votes
1answer
225 views

NSolve super slow for a parameter scan

I am using NSolve to solve two equations for two variables while scanning through several values of angles. The strange thing is that when I manual enter a value for the angle and Nsolve the answer is ...
1
vote
2answers
162 views

How to center LegendLabel in BarLegend

BarLegend leaves a white region at the other end of the legend (the "0 end"), which is best seen by plotting a frame around the legend: ...
12
votes
8answers
605 views

Find the minimum integer r such that $(10^r - 1)/37$ is an integer

I know Element[(10^r - 1)/37, Integers] tests the condition. So what is the command that gives me the minimum integer value r ...
4
votes
2answers
494 views

Fast Trial Division

I'm going to write a custom Trial Division primality test. I know that PrimeQ will first try trial division and then switches to ...
7
votes
3answers
459 views
2
votes
1answer
253 views

Wavelet transform of data with sliders

I saw a beautiful application of wavelets applied to a randomly created data series of about 500 data points. It used the Haar wavelet and had two sliders. The first slider allowed the user to view a ...
7
votes
3answers
406 views

Generating a polynomial that's accurate to within an error of no more than 1/10^5

I'm currently stuck on a question for class that asks... "Find a polynomial p[x] that you can use to calculate 6 ArcTan[x] to ...
7
votes
1answer
3k views

Hilbert-Huang transform package

I am trying to learn Hilbert-Huang transform (HHT) and its applications (especially in ECG signal processing). There are several HHT packages (scripts) HHT for R and Matlab. Is there any known ...
9
votes
6answers
338 views

Adding list of list to a list

Hello I need some help on how to add a list to a list of list. The program would have to do as below: {{0,0}, {0}, {0,0,0}}+{1,2,3,4,5,6} will give ...
1
vote
2answers
188 views

Pattern Matching in Lists

I have a UN voting dataset – taken from a CSV file – where each row is in following format: ...

15 30 50 per page