# All Questions

90 views

### Multiple scripts run using same kernel

I have an external program that calls Mathematica scripts upon certain events. Each script requires a large Mathematica library to load (takes a while). Is there some way to run an initial script ...
31 views

### RandomReal behavior in Block environment [duplicate]

I ran into an unexpected behavior of RandomReal function inside the Block environment. If I simplify my problem: I wanted to use two random local variables, such that the second one would be less that ...
71 views

### How to simplify or improve my code (or how to Flatten inside the matrix)?

I believe that it may be simplified, but I have no ideas anymore.. I need to flatten inside each element of array. F.ex. {{1}, 128552, 6, 1} ---> {1, 128552, 6, 1} Input data (Z - requests, t - ...
119 views

### NDSolve accuracy related problem

I want to solve this equation: ...
142 views

### Problems with BSplineFunction vs. BSplineSurface

Why are those surfaces different? ...
117 views

### DateList does not output the correct time, but Date does

I noticed a strange thing when trying the new astronomical data functions in Mathematica 10 on my Raspberry Pi. The Sunrise and ...
179 views

### How to combine matrix with array without cycles?

I am new to Mathematica. And I'm sorry for my English. I have created a matrix ($6 \times 4$) and an array ($1 \times 4$). I want to get another matrix that will have the first element from the array ...
116 views

### How to generically produce iterators (to loop over many variables)

A generalization of, for example: Do[(* stuff *), {x, listx},{y, listy},{z, listz}] I can almost do this with Table, but I need a way to flatten the outer ...
147 views

I use Apple's Numbers spreadsheet for a single thing, a double entry accounting model to understand complicated financial transactions. A current model depends on the value of a single initialization ...
102 views

### Ordering for Pattern matching in Subscripts

I have some transformation rules acting on subscripted variables. When I match the a product the order matters. ...
546 views

### Image processing: extracting ordered contour

Continuing the question How to extract the edge from a set of points and its answer by Simon Woods, I would like to ask if there is a way to extract the boundary of obtained as ...
176 views

### Impose an specific Trigonometric expansion with TrigExpand

Is there a way to impose in mathematica an specific trigonometric expansion with TrigExpand? I have various double-angle expressions for cosine and sine in my ...
204 views

### BVP system of nonlinear coupled ODEs

Here I am, trying to solve this system of coupled ODEs (up to a minus sign): $u''=6u^5-(8+4a)u^3+(2+4a)u+\frac{2u((w^2-s)^2+bw)}{(u^2+c)^2}$ $w''=\frac{4w^3-4bw+b}{u^2+c}$ with the boundary ...
176 views

### How to preserve the order of terms in the output

Is there a way in which mathematica can preserve the order of operations while it evaluates an expression?, for instance: In my short example ...
189 views

### show fit information on plot

After performing a fit in Mathematica, I would like to show the fitted parameters in a box on the plot showing the fitted function. How would I go about achieving that? Here is a MWE: ...
67 views

### using deletecases for twittermessages using the timestamp

I have a Excelsheet with tweetsmessages. These tweets are all written in Dutch. I would like to analyse these tweets in relation to the timestamp. ...
547 views

### Plotting 2D function and other 3D functions coincidently

ContourPlot3D[{x^2 + y^2 == z, 2 y == z, x^2 + (y - 1/2)^2 == 1}, {x, -2, 2}, {y, -0.5, 1}, {z, 0, 2}] The above isn't what I'm seeking. I'd like to plot ...
212 views

### How to replace identical positions in two different lists

Assume that I have two lists like : list1={1,2,3,4,5}; list2={a,b,c,d,e}; I want to replace some elements from list1 into ...
421 views

### Reconstructing an image from overlapping patches

The Mathematica function ImagePartition can create overlapping sub-images with the pixel offset options {dw, dh}: ...
224 views

### UnitSimplify returns unexpected non-SI unit combination

I am trying to get units working in mathematica in the following expression for diffusion: $D = {K_B T}/{3 \pi \eta L}$ My code is as follows: ...
101 views

### Difficulty finding Expectation of a special function

I have a special function given as: $${\rm f}\left(r\right) ={1 \over \beta\lambda}\,2^{r/\beta} \exp\left({\left[2^{r/\beta} - 1\right]K \over \lambda}\right)$$ I should find the Expectation of ...
65 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. ...
100 views

### How to input pure function to package?

I would like to input a pure function into a custom written package, but am running into a variety of errors. The package I have created is as follows: ...
338 views

### Covariant derivative for symbolic tensors

I want to define a "prefix" (D_i) covariant derivative operator CD[] for symbolic tensors in form of a function, i.e. for ...
39 views

### Notification when evaluation completes [duplicate]

I thought it would be fun to see a list of ways to have Mathematica notify you when a long evaluation completes. There are a few posts up already that address specific methods, given below, but not ...
115 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 ...
48 views

### Can Mathematica find the discriminant formula? [duplicate]

This question is not really practical, but rather a curiosity question. Can Mathematica solve a quadratic equation without its discriminant? I mean, whenever it see a quadratic equation it tries to ...
125 views

### Correct way to use Notation

I have tried to create some Notation declarations as follows ...
34 views

### I am having a Plot and i need inside a Do loop to export 100 frames (changing the bounds of the plot) [duplicate]

for some reason i was thinking of doing this Do[ Plot[F[x],{x,-i,i}]; Export["name_0" + i + ".jpg", %, "JPEG", ImageSize->{250,250}], {i,5}] but i get an ...
368 views

### Manipulating a piecewise function

A while ago I posted a question regarding differential equations. It was supposed to model heat transfer. We've refined our model a bit (using numerical methods now). Our code now looks like this: ...
270 views

### Loop integrals (quantum field theory)

I am attempting to compute the one loop contribution to the Higgs mass, and the one loop integral is somewhat difficult. I decided to try and get Mathematica to do it, to see if the answer can point ...
203 views

### Discrete sampling of interpolating function returned by NDSolve

When solving an ODE with NDSolve, Mathematica returns an interpolation function. I need a discrete sampling of this function however. Naively, I can write this as (example): ...
213 views

### Do multiple instances of Mathematica run completely independently?

Let me simplify the problem I am trying to solve so that the issue I face is highlighted. Say, I want to generate $n$ samples of a Gaussian random variable. I have a script (say ...
68 views

### Optimization problem test suites

Mathematica provides nonlinear, unconstrained test problems here: Needs["OptimizationUnconstrainedProblems"] and LP test problems here: ...
140 views

### Symbolic derivatives of special functions yield incorrect results

When I evaluate with Mathematica this expression D[ Abs[ Zeta[x + I y]], {x, 2}] + D[ Abs[ Zeta[x + I y]], {y, 2}] 0 the ...
213 views

### What is wrong in my calculation with clebsch-gordan coefficients?

According to theory of angular momentum here must equal one. What's wrong? ...
55 views

### Set Standard Plot Thickness [duplicate]

All of my plots should have the same set styling, that is, for instance, {ImageSize->460, Frame->True, PlotStyle->Thickness[0.004]}. Of course I do not ...
64 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 ...
133 views

### Replacement rules in combination with pure functions to make a change of variables

I have defined my function in this way w = f[r,Θ] ; After some calculations i obtained my results with respect to the previous function. For instance: ...
460 views

### Image fading from one corner to the other

I'm preparing a presentation where I want to place a background image on each slide (for aesthetics). These are extremely color filled images (like photos; lets use "ExampleData/lena.tif" as ...
79 views

### Optimization of vector manipulation

I'm trying to implement an upwind scheme for solving transport equation (at first, I work with no right hand side and the simpliest case possible - velocity is constant, initial data is smooth, etc). ...
147 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 ...
273 views

### Eigenvectors for a large symbolic matrix

I'm trying to compute the eigenvectors for a 42x42 symbolic matrix (with one variable) in Mathematica. I get the following error: Eigenvectors::eivec0: Unable to find all eigenvectors. >> and the ...
62 views

### Needs, Get and << [duplicate]

I think I read somewhere that Needs is the recommended way to import dependencies, but I usually see << used in examples. ...
56 views

### Notation, Format and Interpretation

I am unclear on the exact relationship between Notation, Format and Interpretation. ...
50 views

### Applying Notation rules retroactively to a notebook

Suppose I define a new notation rule like Notation[OverBar[x_] ⟺ mean[x]] If I already have some notebooks that were written using ...
513 views

### Writing a simple application: interactive quiz for multiplication table practice

I am trying to write a very simple application in Mathematica: a quiz that tests a multiplication table(let's use the 9x9 for this example). The app will display a question(e.g. 7x5), and the user has ...
610 views

If I define ...