All Questions

Filter by
Sorted by
Tagged with
1
vote
2answers
571 views

Research positions of lists of varying size

I'm new to the site and I am French, so I ask your indulgence for my future mistakes in English. I would like to optimise the following code : ...
6
votes
5answers
2k views

Distance between two line segments in 3-space

I need to compute the distance between two line segments in a project. After googling, I found this algorithm and used it to implement a Mathematica version: ...
-9
votes
1answer
2k views

Plot The Cornu Parametric Spiral

How do I plot the Cornu parametric spiral in 3D with Mathematica. The 2D is quite easy. For more details, you need to be familiar with the Cornu statement. $$\begin{cases} x(t)=\int_{0}^{t}\cos(u^{2})...
3
votes
1answer
865 views

How to reverse the direction of the y axes on Graphics

Question related to this one, except I need the same for the Graphics. Lets say I have the following drawings: ...
0
votes
1answer
75 views

Why won't Manipulate work with symbols generated by Symbol?

Suppose I am provided with two data lists. (Assume for the moment that they are lists of integers.) I would like a function that generates bar charts that I can manipulate. Here is what I have: <...
5
votes
0answers
167 views

Why does setting $Assumptions make my Fourier transforms slow?

Consider these Fourier transforms ...
4
votes
3answers
236 views

Finding a better way to define a matrix

I first defined a 171x171 matrix containing only zeros and then replaced 18 specific rows with nonzero entries. The other $153$ rows will be average of $2$ of the existing $18$ rows. Rows $2$ ...
2
votes
2answers
2k views

Given an equation with one parameter, how do I use NSolve to solve it for many values of the parameter?

I was wondering if there was a way to use the Mathematica NSolve command to solve an equation that has a parameter with various values. An example of which is: <...
2
votes
1answer
171 views

Replacing powers of $n$-th partial sums in the output of a function with $S[i]$ for $i = 1,\ldots,n$

I've written some simple code that, for various $N \geq 1$ and $k = 1,\ldots,N+1$ computes the $n$-th derivative of $\log S_N$ where $S_N(z) = \sum_{k=0}^N \frac{1}{k!}z^k$ as follows: ...
1
vote
1answer
154 views

Efficient calculation of diagonal matrix elements

I have a matrix $V$ of size $M$ in which each row $i$ is a vector $v_i$. Now I have another matrix $H$ and I would like to calculate as efficiently as possible the list of values $v_i^\dagger\cdot H\...
2
votes
2answers
214 views

Defining conditional Notation rules

I am trying to define a notation rule so that for selected symbols subsripts will be equivalent to function parameters. My understanding of the docs suggests the following ...
0
votes
1answer
142 views

Network graph with lights not working

So I have ...
7
votes
1answer
1k views

Fitting a numerical integral via NonLinearModelFit to magnetic data

I'm new to Mathematica and I'm currently trying to fit $$m_T (H,T) = N_T \int\limits_0^{\infty} \frac{x k_\text{B} T}{\mu_0 H} \mathcal{L}(x) \text{pdf}(D_\text{mag}) \text{d}D_\text{mag}$$ with $x=\...
2
votes
1answer
392 views

How to handle a sparse array of lists

I have data in the form of a sparse array of lists. For example: ...
0
votes
1answer
51 views

Storing solution to x and y [duplicate]

If I do sol=Solve[{2x+2==y,3x+9==y},{x,y}] then Mathematica will tell me {{x -> -7, y -> -12}} But I would like to ...
2
votes
0answers
132 views

Finding undetermined coefficients with boundary conditions

I have 2 equations which are; To[x_] := c1 E^(-a1 x)/2 + c2 E^(a1 x)/2 + a2 Tu[x_] := c3 E^(-a3 x)/2 + c4 E^(a3 x)/2 Tu ...
3
votes
1answer
81 views

Problem with parentheses and ScriptBaselineShifts

Style[ DisplayForm@RowBox[{"(", SubsuperscriptBox[2, 6, 7], ")"}], 18, Bold, ScriptSizeMultipliers -> 1, ScriptBaselineShifts -> {1, 3}] or for ...
2
votes
1answer
239 views

How to solve this numerically?

May I ask what is the best way to evaluate ...
2
votes
1answer
398 views

How to operate with function body without evaluation

I have several functions (let a[x] and b[x]), defined as expressions with integrals and differentiations. I want to perform some ...
1
vote
0answers
64 views

How to find out how Mathematica performed an integration? [duplicate]

In terms of integration, I usually utilize Mathematica 9 to compute scattering amplitudes in quantum field theory. Recently, I employed it to compute a particularly difficult integral, and it ...
1
vote
1answer
294 views

Multiple Simulations of a Markov Chain

I am trying to create a simple series of Bernoulli bits whose probabilities follow a two-state Markov chain. ...
1
vote
1answer
215 views

Make several separate Manipulate controls on a single line?

How do I make several different Manipulate controls appear on a single line? I currently have both a Slider and an ...
1
vote
2answers
395 views

Inverse Z Transform returning complicated expression

I want to study how the Z transform changes with the sampling rate T, in a closed loop system. The command I'm using to do this is: ...
6
votes
3answers
2k views

Fast code to generate large random graph with fixed degree sequence

I'm trying to create a function so to generate large random graph with a fixed degree sequence $\{v_1,v_2,\dots,v_N\}$, where $N$ is the number of vertices in the graph. The Mathematica function that ...
0
votes
1answer
89 views

Running function - updating list - run function etc

I am making a larger program, so I would prefer to give a short example of my problem: ...
0
votes
1answer
552 views

Index of iteration inside NestList [duplicate]

I have a list of RandomReal: delta = RandomReal[{-0.01, 0.01}, 1000] I want to add each element of the list to the ...
3
votes
1answer
455 views

Why IntegerPart[x/(x/2)]=1?

Consider this code x = 0.109354682484; IntegerPart[x/(x/2)] (* 1 *) Precision[x] (* MachinePrecision *) Why does it give 1 ? Version number: 9.0 on Mac 10.9.2 ...
1
vote
1answer
85 views

Variable location for intial value in ParametericNDSolve

I am trying to figure out if Mathematica allows a variable location for a known initial value for ParametricNDSolve. I haven't been able to find an example where ...
2
votes
1answer
219 views

Determining sample size with no replacement for a given confidence and reliability when there are x failures observed during sampling?

I am trying to follow the procedure of a Sandia Labs report found here to determine the required sample size, for various population sizes, with no replacement for a given confidence and reliability. ...
1
vote
1answer
172 views

2D Plotting of triplet data set with third axis as variation of thickness of curve

I have similar question like mentioned at representing triplet data set with color on 2d plot but this time instead of color I need to represent variation of third axis with the thickness of the curve
1
vote
1answer
190 views

Customize TableForm behavior for a single function

I have a function of this form Garch[a,b,c....] that gives me a list as an output,where the first column collects names of output variables. Is it possible ...
2
votes
0answers
141 views

Locate Blow-up in NDSolve with Whenevent

At some point I get this error: ...
3
votes
1answer
125 views

.NET link - index of property

I have a property in .NET Type, which is actually a generic list of objects. When I try access the property using numeric index e.g. 10, this works. However when I iterate through indices using ...
2
votes
2answers
501 views

Plot Wiener Process and its running maximum

I want to plot a Wiener process $B=(B_{t})_{t≥0}$ and its running maximum $S_{1}=\max_{0\leq t\leq1}B_{t}$ on Mathematica. Can anybody help? I only know how to generate a Wiener process using ...
9
votes
1answer
1k views

How to restrict the mouse cursor to stay within a box?

I'm trying to use Mathematica to write small games, and I find that it would help to restrict the player's mouse into the game window (just like other games do). Is there any way to achieve this? I'...
8
votes
0answers
247 views

Incorrect evaluation for Thue-Morse signed harmonic series

I would like to evaluate $$s = 1 - \frac{1}{2} - \frac{1}{3} + \frac{1}{4} - \frac{1}{5} + \frac{1}{6}+\frac{1}{7}-\frac{1}{8} - ... + \frac{(-1)^{\textrm{binary digit sum}(n-1)}}{n} + ... $$ where ...
3
votes
1answer
242 views

ListContourPlot memory problems?

I have a simple 3d dataset (size 7035 x 3, I put it on my site if you want to check) which I want to plot with ListContourPlot: ...
2
votes
1answer
414 views

Problem with Label in a Do loop, “nolabel”

Can someone tell me why this code doesn't work and how to fix it ? Thanks. ...
1
vote
0answers
84 views

Sending a command to an already opened frontend

I'm trying to pipe low-level notebook commands to work through terminal and I've tried various ways, but I can't really get to the frontend that's already open. For example Opening a notebook from ...
3
votes
1answer
148 views

How can I add a logo to a presentation?

I am trying to make a presentation with Mathematica and would like to know if there is a way to add a logo that will show in every slide. I have not found any settings that would allow me to do that ...
1
vote
2answers
221 views

`Slot` (#) interfering with evaluation

In the following I am using one function makeFunc to assemble two functions a[t] and b[t] to ...
1
vote
3answers
281 views

How to update a list in a function in each iteration

There is a list with numbers 1 to 8 ( p1 ) and another list (j) which contains 4 numbers which shows different 4 positions of ...
3
votes
1answer
125 views

Identifying and isolating sections of overlap in a set of integer intervals

I have a very large array like the following: {{1,10},{8,9},{9,20},{34,40},{41,42},{43,50},{47,53},...}; Now, imagine that every element in the array corresponds ...
10
votes
2answers
2k views

Monte Carlo integration with random numbers generated from a Gaussian distribution

I want to do numerical integration of some functions using the Monte Carlo method. The default setting for the Monte Carlo method is to use a uniform distribution as far as I know. How can I change ...
3
votes
2answers
562 views

Highlighting or coloring certain words / substrings appearing in a larger string

I have one longer string, longString, and a set $S$ of shorter strings {ss1,ss2,ss3,...}. I'd like to print out ...
1
vote
2answers
969 views

Deleting all characters in a string that do not belong to a small set of elements

Say I have a string {100 aa bbc%j%b%wa ajjcj11j0%2wj fc} with a lot of undesired characters or spaces in it, for example: {" ", "%", "w", "j"}. I'd like to strip the string of these characters, with ...
5
votes
1answer
745 views

Display a labeled multigraph

Introduced in version 9, fixed in version 10. Thanks Szabolcs for providing this screenshot showing that the bug is fixed. Despite the integration of graphs and networks, multigraphs are not ...
6
votes
1answer
425 views

What is the mathematical meaning behind D[f]?

y = a + b x; I can understand this output of the ordinary differentiation of y w.r.t. x <...
11
votes
3answers
1k views

Finding All Chordless Simple Cycles In A Graph

I am doing a research on networks which consists of polygons with different number of sides. I am trying to find all simple cycles in a network which are chordless. As an example, consider the ...
3
votes
1answer
89 views

Manipulate AnimationRunning equivalent?

I have a Manipulate function with two variables. I would like one of them to begin autorunning immediately once the function is evaluated, but the other to remain ...

15 30 50 per page