# All Questions

384 views

### What kinds of uses of SymbolicC (introduced in Mathematica 8) do you foresee? Are there any neat examples already?

Mathematica 8 introduced SymbolicC, a set of Mathematica functions that capture C language constructions in the familiar Mathematica tree-like fashion. Additionally, there are functions to write ...
35k views

### Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
44 views

### Solve linear equations containing complex numbers? [on hold]

The 2 equations are $$xi+y=0$$ $$-x+yi=0$$ where $$i=\sqrt{-1}$$ I am getting $$0=0$$ Any help? Thanks!
104 views

...
77 views

### Solving problems with the floor function

I've got the following problem: If I want to calculate the following equation, ...
50 views

### Finding relations between polynomials

Suppose I have a multivariate polynomial ring $A=\mathbb{R}[x_1,\ldots,x_n]$ and a set of $S=\{p_1, \ldots,p_k\}$ polynomials in $A$. Using this code (which works great) Dimension of an algebraic ...
69 views

I can load my library, but I cannot unload it with LibraryUnload. I do have a ...
97 views

### Discrete inequality plotting

I have an equation like this: $${20 \choose k}\cdot \sum_{i=0}^k {k \choose i}\cdot i \leq 1+f$$. I want to plot this inequality as the dependency between k and ...
88 views

### speed up for computing MatrixExp

My code use two method to computing MatrixExp, I expected the second snippet code will faster than the first one, but in fact it a bit slower than that. How can I ...
46 views

### Backtrack function

I am using Mathematica 9. In the Help help file is the built-in function Backtrack. In order to use it the Help file says: To use Backtrack, you first need to load the Combinatorica Package using ...
154 views

### Plotting equations of motion of a baseball

So I went through the physics of a baseball and I got the exact same equations as shown here on page 8. I input all of the same parameters into my code, and I don't get the same thing. Any idea ...
80 views

### Function derivatives in arbitrary dimension

I have a higher dimensional function: $$f(x,t)=-\ln(t)-\ln(1-\left\|x\right\|^2-t^2)$$ where $x\in\mathbb{R}^n,~t\in\mathbb{R}$. I want to compute the derivatives with the commands ...
51 views

### How to save all variables in the workspace into a file? [duplicate]

I did some time consuming computation and obtained a lot of arrays and variables; however after restart the Mathematica Kernel, all these computational results disappeared. How can I save all these ...
18 views

### Real-Life Application Linear Equation [migrated]

Robot Moe is assembling memory cards for computers. At 9:00 am, 52 cards had been assembled. At 11:00 am, a total of 98 had been made. Assuming the production rate is linear. a. Find the slope of ...
61 views

### Combining Two Manipulated Plots Dependent on Same Variables

I need to combine two plots on the same graph to highlight the intersection of the two while being able to manipulate various parameters that are common to both functions. I need to have the slider ...
43 views

### Object depth different in replacement rule

I access the first part of an expression with head foo without a problem: foo[arg][[1]] arg Then when I try to use this ...
792 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 ...
47 views

### How to find the leaders in order to apply The Meggitt algorithm [on hold]

For example, a generator polynomial g(x) generates a cyclic code with length n=15, dimension k=7 and minimum distance d=5. (p=2) -> p = |(d-1)/2| degree 14 -> r=n-1=15-1 weight <= 2 -> weight ...
55 views

### GraphPlot with black edges no rendering function

Is there any way to make the edges of a GraphPlot black without tediously writing out a long "EdgeRenderingFunction"? I guess you could ask the same kind of question about vertex labeling. For ...
70 views

### Selecting expressions from a sequence that are not subexpressions of earlier elements

I have a While loop that generates and prints an expression on each iteration (there can be thousands of iterations). UPDATE: Some expressions are generated in ...
105 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).) ...
291 views

### Raspberry Pi GPIO operations with Mathematica

I started exploring GPIO operations on the RPi with Mathematica by following this brief tutorial which describes how to use DeviceWrite to cycle an LED on and off. ...
179 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²] ...
73 views

### Code for a Pocket Calculator [on hold]

I need to have a Mathematica simple pocket calculator with press-able buttons, with the ability to disable some of the buttons. I want to use it in "broken calculator" activities in teaching ...
112 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: ...
87 views

### How to highlight overlapping regions in RegionPlot according to the overlapping times?

I want to plot the overlapping regions of several inequalities. For example, ...
130 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 ...
241 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 ...
85 views

### Showing the value a plotted function achieves at the right-most point of the plot domain

I'm plotting results from NDSolve, and I'd like to clip them with their value at the point where the line is clipped. So where the curve ends at the edge of the plot, there would be a number ...
171 views

### Using Element[]

Can the Element[] function only be used for the domains given in the documentation? I am trying to use it to determine if a value is contained in a previously defined list. Thanks!
257 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 ...
41 views

### Multiplot colors [closed]

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 ...
91 views

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

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

### Executing several input cell simultaneously with parallelization

How can I execute more than one input cell simultaneously using different processor. For example consider this two cells ...
96 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 ...
304 views

### Reduce can't reduce an equation without appropriate assumptions

When there are three unknowns (x, y, z), Mathematica can solve it: ...
89 views

### How to calculate expected return, row by row in matrix? [on hold]

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 .... ...
33 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 ...
458 views

### How to pick increasing numbers from the list

How to pick increasing numbers from the list. lst = {5, 3, 6, 2, 7, 4, 8}; out: {5,6,7,8} So many interesting ...
34 views

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

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 ...
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 ...
68 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 ...
60 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 ...
118 views

### PlotStyle with Table

I want to create a plot style with a table and manipulate the variables in the plot style. ...
82 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 ...
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: ...
46 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 ...
72 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 ...