# All Questions

18 views

### Plotting two functions against each other

I have two functions which are functions of t. Let's just say x1[t] and x2[t]. I want to ...
45 views

### Solar system simulation (n-body physics) with OpenCL

I would like to simulate a n-body solar system in Mathematica. I have found the following example: ...
28 views

### Multiplot colors [on hold]

If I have a multiplot like for example: ListPlot[{function1, function2},...] the colors of first is blue and the second one is purple. How can I change to have ...
185 views

### How to replace an element in a list based on the value of the next element?

I use Mathematica a little bit. I try to understand it, but it is hard I have a list of 5 numbers selected randomly from 0 and -1. I have to replace a 0 with a 1 when the 0 is followed by -1. My ...
52 views

### Prime factor counting function

Is there any way I can speed up this prime factor counting function? (I am looking for all numbers in a range with 3 prime factors (counted with multiplicity).) ...
66 views

### Does Mathematica know if an integral is convergent or not?

Consider the following integrals that I asked Mathematica to do, ...
22 views

### How should I integrate a function with variable specifically defined already?

I'm going to do a transform in the form of but here, what I have is the y values (discrete), the f(y) values at each y, so I can't choose random y but have to input y values myself. So this is a ...
152 views

### Different results for integration using Mathematica and MATLAB

I have the following integration: $$\text{y}=2 \sqrt{\frac{1}{\pi }} \int_0^{\infty } \frac{e^{-z} \left(1-e^{-\frac{z}{b}} \left(\frac{a}{a+c z}\right)^L\right)}{\sqrt{z}} \, dz$$ I get different ...
72 views

### How to calculate expected return, row by row in matrix?

Please help me, I'm writing my project and dont know how to solve this big matrix: I have to compute return row by row: 1st row: (18.32-17.14)/17.14 ; (19.17-18.32)/18.32 .... ...
18 views

### Repeated ANOVA unbalanced data [migrated]

I am a master's student, and I need your help. I did experiment on one group of rats, the group was tested during 8 days, this is the first stage. The same group was also tested again but this time ...
57 views

### Efficient ways to rotate a ListPlot?

I have a numerical solution from a differential equation that is in the form of a list, in $(x,z)$-plane. I would like to rotate the 2D ListPlot around the $z$-axis ...
48 views

### How do I plot a plane pi/6 along with its path?

The position vector is r[t_]:={Sin[t]+Cos[2t],Cos[2t],Cos[t]} and the plane is ...
139 views

### Finding the square root of a squared number?

Taking the square root of the square of a number Variable set to a real value I'm wondering why these examples a = -4.3; Sqrt@a² Sqrt@(a^2) Sqrt[a^2] Sqrt[a²] ...
28 views

### How to prove the lim sup((an)^2) = c^2 if given limsup(an) = c>0 ? [on hold]

how can I prove that $\limsup((an)^2) = c^2$ if given $\limsup(an) = c > 0$? I think I'm supposed to use the theorem that "if s is finite and $\epsilon > 0$ is given, there exists an $N$ so ...
87 views

### Unexpected dots from Line

I have noticed cases where Line produces dots in a graphics object when I think it shouldn't. The first of these is: ...
20 views

### unexpected behavior of matrix formatting smith waterman [migrated]

it's supposed to be Smith-Waterman algorithm, and I'm getting almost correct output, but not exactly and Id love to understand why, so here's my code: ...
34 views

### Reading Eigenvalue / Eigenfunction result from Reduce

I am trying to find the eigenvalue/eigenfunction solution to: $$\tag 1 y''+3y + \lambda y=0 ; y'(0)=0, y'(\pi)=0$$ I used DSolve and Reduce and they seem to converge, however (embarrassingly) I am ...
43 views

### Pattern-rewriting Pattern triggers error?

I am trying to rewrite patterns. For example, I'd like to rewrite the pattern jFoo_Integer which has FullForm ...
60 views

### Assign clipboard object in mathematica when print screen is pressed (windows)

Mathematica runs behind, while another window is selected. When I press print screen, I want mathematica too detect this and call a function with the picture as argument. ...
16 views

### Solving trigonometry identities by simplifying terms [migrated]

Verify the identity by simplifying the left side. sin^2x-sin^2y=cos^2y-cos^2x
83 views

### Pulling out common terms when simplifying complicated equations

I have a complicated expression where common terms are apparent but Simplify[] and FullSimplify[] don't appear able, even with plenty of assumptions added, to reduce down to a simpler form with common ...
163 views

### Summation with jump indices like 1,4,6,9?

I is easy to enter $\sum_{s=1}^{n}k(s)$ But how can I enter $\sum_{s=1,3}k(s)$ ? When I try it, Mathematica says ...
57 views

### Manipulating the pitch of a sound

After reading Manipulating a continuous stream of sounds I have to ask about controlling the frequency of a Sin sound in a continuous manner, with a ...
83 views

### Ordinary differential equation invloving the function composition

I want to solve the following function: DSolve[(A1*Exp[B1*f[x]] + A2*Exp[B2*f[x]])*f'[x] == A1*Exp[B1*x] + A2*Exp[B2*x], f[x], x] And this is what I get as an ...
39 views

### Assigning the answer of Solve to a variable [duplicate]

If I enter Solve[(x-2)(x+2)==0,x] then the answer comes up as {{x -> 2}, {x -> -2}} I want to make two variables ...
104 views

### PlotStyle with Table

I want to create a plot style with a table and manipulate the variables in the plot style. ...
41 views

### Simplify doesn't simplify HypergeometricPFQ with exact arguments

Consider a series: $$\sum_{t=0}^\infty \frac{8^{-11-2t}(22+4t)!}{t!(11+t)!(11+2t)!(32+t)}$$ ...
55 views

### How to get vertices of a polytope given by equalities and inequalities?

I have a polytope given by some equalities and inequalities, how can I get all the vertices of the polytope? If there's a way to deal with the one given by inequalities only, how can I reduce the ...
45 views

Is it possible to start Mathematica kernel from UNIX command line without having the init.m loaded, but not by simply deleting or commenting out it before hand? If this is a Mathematica script, is it ...
70 views

### Problem with strings imported from PDFs

I am currently working with a list containing around 20 strings which contain around 30,000 characters each. The strings are imported from PDFs and the list containing all the strings is assigned to a ...
96 views

### How to create a plot of the volume between three surfaces

I need help creating a plot that I can manipulate the variables for the volume between three surfaces. I am trying to make it look like this example here: ...
73 views

### How to constrain memory usage on HPC?

I found the performance of built-in function MemoryConstrained is very poor. It stops the evaluation after the memory already exceeds greatly than the values I set. ...
44 views

### Fitting data set with series expansion

I have a function given in a form of a list: ScalarField={{$\epsilon$,$y_1$},..{1,$y_{3000}$}} It is defined in the range $(\epsilon,1)$ (spacing between grid points is homogeneous), where ...
34 views

### Transpose a ragged triangular matrix and display as columns rather than rows

I have a triangular list of lists as follows: ...
38 views

### Widget - GUI help

I was wondering if someone could explain me the code written below (example File Dialog from mathematica). Especially the part with returnValueand ...
123 views

### Pure function inside another pure function

I have the following working expression: In[15]:= Length[Select[IntegerPartitions[10],First[#1]==5&]] Out[15]= 7 But, instead of using the constant 5 I want ...
80 views

### How to get back name of the number from Max function? [duplicate]

So I have this question, using a toy example: a={1,"this"}; b={2,"that"}; result=Max[0,a[[1]],b[[1]]] the result will be 2. However what I want to obtain is ...
27 views

### Cannot import a free form MPS file [on hold]

The file was created by Gurobi 5.6. This is a COTS software product specifically for MILP I have tried all variations of Import including setting ...
31 views

### Rearrange cells without cut-paste

When working in a Mathematica notebook, I often want to reorder cells. Most of the time, I am adding cells at the bottom of the notebook, until I realize it may be better to insert this calculation at ...
58 views

### NDSolve`ImplicitRungeKuttaGaussCoefficients doesn't work

I am using Mathematica 9.0 on Ubuntu. I tried the first example from this documentation page, but it returns unevaluated: ...
66 views

### Is there really a bug in the following code, taken from the reference documentation for PetersenGraph?

PetersenGraph[5, 2, EdgeLabels -> {8 \[UndirectedEdge] 9 -> "hello"}] appears to evaluate perfectly, as expected, but in my version 9.0.1.0, the option ...
203 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 as in the following youtube video: http://www.youtube.com/watch?v=IfCCUd8mFtg. I usually use conformal mapping (a complex function) to do my ...
8 views

### About Subspace Iteration for Eigenvalues [migrated]

I heard that subspace iteration plus Ritz acceleration could improve the performance a lot for solving clustered eigenvalues, for the eigenvalues and eigenvectors could converge linearly with ratio ...
47 views

### Aborting from inside a ScheduledTask

If you have an Abort[] inside a ScheduledTask expression, what does it abort? The scheduled task evaluation, or any main kernel ...
46 views

### Trouble avoiding computation in DynamicModule when input field is not defined [duplicate]

I'm having trouble detecting when my InputForm supplied String variable has a value. After looking at: How to compute values only if input fields are filled? I tried a StringQ test: ...
33 views

### Run kernel script in cygwin without window popping up [duplicate]

I'm calling mathematica scripts running kernels through a cygwin terminal, which are again executed from c++ code. When I do this a window pops up, prints warnings and errors if there are any, and ...
51 views

### Dynamic evaluation crashes depending on cell position?

Strangest bug ever. Copy the following piece of code to the same notebook two times, below each other, as two identical cells. Be sure to run a fresh kernel. ...
76 views

### NIntegrate using Boole doesn't work

This doesn't want to work for me - I don't know why not. It usually gives me 0, but sometimes also a different number. I know it should be a small, non-zero number. ...