# All Questions

363 views

### Plotting a region with polar axes

I want to plot the region of points who satisfy the following equation: 2 < r <= 5 && 3/4 π < θ <= 5/4 π I have been able to plot region in ...
54 views

### Implementation of Series function

I'm trying to evaluate the partial derivatives of some function F[x,y] at some point, i.e. ...
427 views

### Using Compile Function Options efficiently

While this gives general pointers, I want inputs on ground rules for improved performance of nested/interdependent compiled functions. sample problem: a, ...
117 views

### Passing function as argument

I've been mucking around with passing functions as arguments to other functions and via trial and error seem to have something that works. I was wondering if someone could have a quick look at some ...
200 views

### Why does N[Re@f] give complex result?

Consider this code: ...
87 views

### InterplationOrder, ListPlot3D and using AbsoluteOption to find value used. Slow using InterpolationOrder

What lead to this, is when I noticed that ListPlot3D was much slower when adding a specific InterpolationOrder->n vs. not and ...
435 views

### The correct pattern for Cases

I have a problem that, admittedly, I have already solved using Select instead, but it is irking me that I cannot seem to construct the right pattern to solve it ...
83 views

### Stochastic Approximation and Simulation using Running Median

I have a function $$F(X_{t+1},Y_{t}^{med})= \alpha X_{t+1} + (1-\alpha) Y_{t}^{med},$$ where $$Y_{t}^{med} = Median(Y_1, Y_2,... Y_t).$$ Moreover, $Y_1 = X_1$ and $Y_t = F(X_{t},Y_{t-1}^{med})$ ...
32 views

### different values of integral with/without bogus assumptions

I do not understand why I get different answers for the following two identical integrals. ...
206 views

### How to see abstract syntax tree of Wolfram Language expression

I mean, suppose I have this expression: 2 + 2 I want to get something like this: Plus[2, 2] as an output. I've tried FullForm, but this just evaluates 2+2 and returns 4. Is this even possible?
186 views

### When event and “stop integration”

I am using NDSolve, to solve for an equation. At some point, I want it to stop integrating and keep a constant value for the solution from the point it stopped changing. I tried setting the derivative ...
165 views

### Plot a one-dimensional list of numbers as a column/row of labeled colored squares

I have a list of numbers and a matching list of labels. I want to plot a column of colored squares, with the color of each square matching (in some color scale) the value of the corresponding number. ...
56 views

### On the order of rules specification [duplicate]

I wanted to understand how Mathematica parses function definitions in rules-based programming, so I started with the simple code: ...
350 views

### Alternatives to Append/AppendTo for generating a list in an interactive DynamicModule?

I have a stack of timelapse microscopy images that I am trying to segment frame-by-frame using some of Mathematica's image processing functions. I have created a little interactive DynamicModule with ...
257 views

### Hypergeometric function with a matrix argument

I am looking for the evaluation of a Hypergeometric function with a matrix argument as for example in Koev and Edelman or as showcased in this Wikipedia article. From what I understand from ...
173 views

### Numerical error in Mathieu functions

Consider the MathieuCharacteristicA function, which is a piecewise function according to the documentation. The discontinuity happens at integer number. ...
147 views

### Local variables whose definitions depend on each other [duplicate]

Consider the following (pseudo-)function definition: f[l_] := Let[{ a = Length[l], b = First[l], c = b/a, }, c*10] So for ...
81 views

### ExportString and HTML: where are saved images?

I want to use ExportString to generate HTML expression. Here is an easy example: ExportString[x^3, "HTML", "FullDocument" -> False] gives ...
227 views

### ListPolarPlot: 0 Degree at vertical axis

Is it possible to have ListPolarPlot start plotting at the vertical axis? By Default ListPolarPlot gives this result: ...
1k views

### Numerical value of physical constants Mathematica 10

Is there a way to use the physical constants in calculations and have Mathematica 10 figure out the final unit and numerical magnitude? When I try ...
68 views

### How to set a variable between 1 and 0, and how to check the FOC is greater or small than 0 by assumption?

I have the following notebook: ...
106 views

### How to deal with matrices involved in system of SDEs?

This question is in continuation of the the previous posts Solving Stochastic differential equation and Fast Simulations with Compile. What I want to do is numerically solving the epidemic model which ...
110 views

### Filling dependence on order of points in ListPlot

ListPlot[{{{1, 0}, {0, 0.5}}, {{1, 1}, {0, 1}}}, Filling -> {1 -> {2}}, FillingStyle -> LightGray, Joined -> True, Frame -> True] Results in no ...
76 views

### Some global variables are defined even at the start of a fresh session [duplicate]

In a fresh Mathematica session evaluating Names["Global`*"] doesn't give an empty list. The result is either {rhs, z} ...
100 views

### Problem with general assumptions

I hope I am not to redundant with my questions. As part of solving a physical problem, I want to assume once and for all that all my variables and parameters are real, positive and finite. Is it ...
537 views

### Object separation from a 2.5D surface

I'm trying to identify the shape and the boundaries of objects. The data was generated with a laser scanner and represent the surface of an area in which many boulders lay on the ground and making up ...
144 views

### Specifying initial conditions for a PDE

I have simple diffusion equation with point source at c(0, t) = 1 and initial condition c(elsewhere, 0) = 0. How should I apply ...
307 views

### Tuples without self-loop

I have a simple question coincerning the Mathematica function Tuple. Currently, I apply the following code ...
82 views

### Efficient processing of Special Ordered Sets with LinearProgramming

I'm playing with integer linear programming, especially problems involving lots of constraints which would appear to be special ordered sets. Below is a toy example, three last rows of the matrix ...
187 views

### How to solve three equations with four unknowns iteratively?

I have three equations of the form $\quad \eta = f(N1L, N2L)$ $\quad N1L = g(\eta, R)$ $\quad N2L = h(\eta, R)$ I want to eliminate $\eta$, so that I can get $N1L$ and $N2L$ for a range of $R$. I ...
56 views

### Program file deleted while running

I have a program running for some time at one computer. Today, unintentionally, I edited the program file from another computer (I use Dropbox), and the program kept running. Trying to correct my ...
1k views

### Find maximum value of interpolation function - obviously wrong result

Minimizing and maximizing interpolation function has already been asked and answered, see here for example. Yet, I observe a strange behaviour. Well, I can understand that the wrong guess of ...
333 views

### Export MatrixPlot graphics to PDF

I am trying to export a plot generated by MatrixPlot to PDF but am having problems with the way the exported PDF is rendered. ...
150 views

### Solving determinant of a Kronecker product of matrices gives a numerical error - why?

I am doing the following steps (code at the end of the post): I start with a 2x2 matrix (smatrix), which is a function of a single variable (u2). I want to set the determinant of this matrix ...
316 views

### Transformation of Derivatives under change of coordinates [duplicate]

I have an expression depending on the two variables z and t, and the derivative of a known function $f(t,z)$. Something like: $$myexp \ =\ t\ z\ \partial_z\ f(t,z)$$ Now I want to make a change of ...
128 views

### How to do a region plot with many functions [duplicate]

Hello i am trying to compare many function, i want to see witch one as the lowest value depending on 2 variables. My solution so far is something like this: I have 7 function: P1 P2 P3 P4 P5 P6 P7, ...
669 views

### UnFlatten an array into a ragged matrix

Trying to unflatten an array that was part of ragged array of sub matrices. As input we have flattened array: ...
120 views

### Recursive function with array of variables

I am trying to create a recursive function which works with an increasing array of variables. Since the formula is quite complex, i will try to simplify my example to the core of my problem. The ...
51 views

### Conditions for proper integrals with DSolve on Mathematica

DSolve[{RCS'[s] == SNPH[s] - Sqrt[R2[s] - RCS[s]^2]/b,SNPH'[s] == RCS[s]/a^2, R2'[s] == 2 RCS[s] SNPH[s], RCS[0] == 0., SNPH[0] == snal, R2[0] == ri2}, {RCS, SNPH, R2}, s ]; Here {a,b,snal,r12} are ...
582 views

### Ordering the Boundary points of a Polygon

I feel like this should be simple, but I keep running into walls. Say someone gives you the coordinates of the vertices of a pentagon and the center point of the hexagon. Is there any way to get an ...
254 views

### Interpolation of 4D data

To create a table and an interpolation function of 3D data T=f(X,Y) I have the answer here: interpolation of 3D data How to create a table/interpolation function of 4D data T=f(X,Y,R)? If I do ...
418 views

### Problems running Mathematica 10 with Workbench 2 Windows 7 64 bit

My Workbench runs perfectly using Mathematica 9, however simple things which run just using the Mathematica 10 front end won't run when using Mathematica 10 and Workbench 2. These simple two lines of ...
47 views

Let ...
225 views

### How to do DateDifference on table items containing dates

I have a Table with data in form {{date}, value}: ...
366 views

### How to create a 'shortest-path link matrix'?

I am currently struggling with a problem in Mathematica. I have a randomly generated weighted Barabasi-Albert graph and a corresponding demand matrix of the same size. I'm generating the graph with ...
163 views

### Wrong values at the boundary of differential equation solution

I have a second order ordinary differential equation and want to solve it numerically. Although I have specified values at the boundary, Mathematica solution does not match with boundary conditions. ...
355 views

### Can I check if an expression is positive using assumptions?

I have the following notebook: ...
177 views

### How to make Epilog render behind the main plot [duplicate]

Consider this example: ...