Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [code-request]

Questions on finding existing Mathematica implementations or expertise to address a clearly stated problem.

0
votes
0answers
71 views

Solving a differo-integral equation [duplicate]

I've the following equation for x(t): $$x'(t)\cdot\text{a}+\text{b}\cdot\frac{x'(t)}{x(t)+\text{c}}+\frac{\partial}{\partial t}\left\{\int_0^tx(\tau)\cdot\mathcal{...
0
votes
0answers
26 views

Derive a tangent using the AceGen package

I want to derive the algorithmic tangent of a material model, but all I have given is the potential and the flow function. Are there any exmaple codes or tutorials for the implementation with AceGen? ...
0
votes
1answer
77 views

Solving a difficult differential equation

I've the following DE, describing a physical phenomenon. And the prupose is to solve that DE using Mathematica $$x(t)\cdot r+x'(t)\cdot l+a\cdot\ln\left(1+\frac{x(t)}{b}\right)=0\space\...
4
votes
3answers
339 views

Generate numbers relatively prime with a given number

I am interested in a function such that f[m, i] = n where m, n are positive integers and n ...
11
votes
1answer
651 views

How to make a spiroglyphic?

Some (older) members of this group might remember playing vinyl LP records. Recently, at the Abbey Road studio there was a spiroglyphics coloring book for sale. It looks like a nice programming ...
3
votes
1answer
86 views

Using ImageTransformation to implement relativistic aberration effect

****The desired effect should be images that look like something out of Star Wars like when you are boosting to high speeds in the Millennium Falcon.**** This problem was tackled by Daniel Weiskopf ...
2
votes
0answers
51 views

Exterior products of differential forms

In $ \mathbb{R}^4 $ I have the forms $ \omega_1=z\;\mathrm dx+t\;\mathrm dy+x\;\mathrm dz+y\;\mathrm dt $ and $ \omega_2=t\;\mathrm dx+z\;\mathrm dy+y\;\mathrm dz+x\;\mathrm dt$. I want to compute ...
16
votes
1answer
346 views

Programmatically annotate code?

Is there a known way to programmatically annotate code like workflows (without using boxforms or drawing tools): Minimal example that doesn't work: ...
0
votes
1answer
53 views
0
votes
0answers
36 views
1
vote
1answer
91 views

Computing the Lyuponov exponent for the Duffing system

Does anyone know (simple) Mathematica code for computing the Lyuponov exponent for the Duffing system? ...
8
votes
2answers
108 views

Robust DuplicateFreeQ for numerical data

I am looking for a fast and robust DuplicateFreeQ equivalent for numerical data. Floating point numbers should normally be compared with some tolerance, as ...
1
vote
1answer
79 views

NDEigensystem to find eigenvalues and eigenfunctions of coupled differential equations:

I would like to numerically solve the following system of coupled differential equations: ...
0
votes
1answer
47 views

Font Size in Plot Legends

How can I change the font size of the Legend? I have to plot 5 functions, and I already wrote the code, with the colors and so on. But when I write the final code for the PlotLegends, that is ...
5
votes
2answers
121 views

Simulating a hybrid dynamical system

I am trying to simulate the following hybrid ode $$ \begin{eqnarray} \dot{x}=-\left(x-a+u\right) \end{eqnarray} $$ where $u$ is given by $$ \begin{eqnarray} u(t)=\left\{\begin{matrix} 1 & \text{...
3
votes
1answer
46 views

What is a good way to implement a versatile folder structure checking system?

I'm writing an 'application' (set of *.wl and *.wls files) that requires a given folder structure to function; I am not sure how this structure will eventually look like, because it changes as I ...
2
votes
1answer
46 views

How to manipulate an equation so that it is in terms of a certain variable

For example, I have an equation $$z = \frac{(1+a)}{(1+b)} + 3x + 4y^2$$ I have a new variable where $$R = \frac{(1+a)}{(1+b)}$$ Is there a function or code where I can tell Mathematica to ...
4
votes
3answers
350 views

Drawing the Pursuit curves

I was reading this post on Filling Space with Pursuit Polygons. I didn't really see where the filling was, but found it quite interesting. Then I saw these pursuit ...
16
votes
5answers
1k views

How to visualize the Cremona method for cardioid generation

I saw this on Twitter and found the cardioid drawing quite satisfying. I don't know much mathematical background, and was wondering if I can draw this using Mathematica. And this one apparently take $...
13
votes
3answers
420 views

Convert QR code to a Nonogram puzzle

I remember there was a GCHQ puzzle where Nonogram was created to generate a QR code in 2015. It was a quite popular puzzle. I am wondering if MMA can be used to create a Nonogram from an existing QR ...
5
votes
2answers
448 views

Code for an iteration method

As I am new to writing code for Mathematica, I would really appreciate if someone could provide me the code for the following iteration process. For $x_0\in[1,2]=C$, $$x_{n+1}=(1-\alpha_n)Sx_n+\...
0
votes
2answers
45 views

Plotting a function while varying a variable (on the x-axis) using two formulas [duplicate]

I want to plot the following function, where Rb is the variable (that has to be on the x-axis): ...
0
votes
0answers
60 views

Implementing jacknife method

I need to use a jacknife method in order to find the standard deviation of my data. Howvere, I realise there's no built-in fuction (or maybe I couldn't find it), not even a general bootstrap method. ...
2
votes
1answer
102 views

Kernel forever running with no error message. Solve NDSolve without FEM?

I am trying to solve the following reaction-diffusion equation where R_L represents the reaction rate of L. ...
4
votes
2answers
148 views

Replace solution of NDSolve into another NDSolve

I was wondering if it was possible to replace the solution of L'[x] (which is dependent on r[x], ...
2
votes
1answer
184 views

Receptor/Ligand Diffusion Michaelis Menten Equation

I'm trying to model the diffusion of a ligand that is binding to a receptor (similar to the enzyme substrate model) where the reaction is I tried using this question as a reference. I'm mainly ...
0
votes
0answers
64 views

How to cycle through all my variables

I have the following set of conditions for p[i]'s and defined a function L in terms of the ...
2
votes
3answers
101 views

Coding non-linear least squares (GPS iteration) with steps and solutions showing?

I am trying to code non-linear least squares approximation with its solutions shown in tables like far below, i assume there has to be a 5 by 4 Jacobian matrix (as i deal with 4 unknowns and 5 ...
1
vote
1answer
96 views

Monitoring ParallelTable

Some time ago David published an implementation of a simple monitor for ParallelTable which dynamically displays current values of the iterator for all parallel ...
0
votes
0answers
21 views

Extending the runtime of a export .avi file

I've the following code: ...
0
votes
1answer
99 views

Exporting a manipulate function as a .gif [duplicate]

How can I export this code: Manipulate[Plot[a*Cos[2 Pi*x]*Exp[-(10^2)/x^2], {x, 0, 10}], {a, 1, 10}] As a .gif that walks trough the values for $a$?
0
votes
0answers
26 views

Mathematica code for plotting points of a certain metric space

I am currently graphing balls under a certain metric space. For instance, a ball $B_M(0;1)$ with $M=\mathbb{R}^2$ and the Euclidean metric yields a circle centered at $(0,0)$ with radius $1$. The ...
1
vote
1answer
59 views

How to prevent redundant evaluations over a sample of observations in a dynamic context

I want to create a dynamic calculation (Manipulate) that will display a complex (time consuming) calculation. The gist of the matter is working with a given sample ...
4
votes
0answers
238 views

Wick Contractions; help with a piece of code

An alternative title to this thread could be, understanding another person's code. A few years back there was a workshop on Mathematica and applications to theoretical physics; if you want I can ...
0
votes
0answers
59 views

Computing derivatives (at a point) efficiently

I need to compute all derivatives for a multi-variable expression upto a certain number of derivatives dmax evaluated at a point. So I need say the n-th x and m-th ...
0
votes
1answer
200 views

Making a table of solutions from NSolve or Solve

How can I generate a table of solutions to an equation such as this: Solve[{a^m+b==c,b-m==a+Sqrt[n]},{a,b}] for some given values for $n$ and $m$.
0
votes
1answer
51 views

Plotting eigenvalues depending on their locations

I have a finite chain (say $N$) which can be represented by a matrix(for e.g. a chain of $l$ atoms per unit cell, then it will be $(l\times N)$ $\times$ $(l\times N)$, this matrix depends on some ...
0
votes
2answers
48 views

Getting the error out of a prediction and a measurement

Well, I've the following problem. I need to plot the error that the data gives with the prediction. I've the following code: ...
3
votes
1answer
252 views

Metropolis-Hastings Algorithm Problem

I've been trying to implement the Metropolis-Hastings algorithm for a while but there seems to be something weird going on. This algorithm does not need as much of the statistics to understand, and ...
3
votes
1answer
66 views

Detecting transformation rules and removing them

Is it possible to detect the non-standard transformation rules (DownValues, UpValues, etc) that activate in an evaluation (and ...
-1
votes
1answer
103 views

Visualising the Twelve Days of Christmas in 3D [closed]

On a related topics, here. I am wondering if it is possible to make a better visualisation of this svg file in Mathematica, so I can see it in 3D and rotate it too. Note if you pause your mouse onto ...
3
votes
1answer
334 views

Schwarz-Christoffel maps from unit disk to regular polygons visualization

The function $$F(z)=\int_0^{z}(1-\zeta^n)^{-\frac{2}{n}}d\zeta$$ maps the open unit disk $\Bbb{D}=\{z\in\Bbb{C} : |z|\lt 1\}$ conformally on to the interior of a regular polygon with $n$ sides. How ...
0
votes
2answers
71 views

Code for number of minima below a certain value [closed]

I am having trouble thinking of a code that could do a certain task. I have 101 lists of numbers (100 distance which range in values from 10 to ~100 and 1 time. All have the same number of elements) ...
3
votes
1answer
63 views

Setting some Rows and Entries in a Matrix to 0

How can I set certain entries in a matrix to be 0? Given an $m\times n$ matrix with specified values: mat = Table[1/i, {i, n}, {j, m}] I want to make some ...
0
votes
1answer
68 views

Solving a System with some Row Sum Constraints

My question is about solving a linear solving system with variables $m_{i,j}, 1\le i \le 20, j\le 1\le 10$ with (1) nonnegative entries, (2) zeros in prescribed locations, (3) given row sums. I'd ...
1
vote
2answers
66 views

Force an Im-Re separation in a complex number with parameter

I was doing a computation with Mathematica (summing a series) and a part of the result was the following: $$\frac{\Gamma \left(\frac{1}{4}\right)}{3 \sqrt{2} \sqrt[4]{-\frac{\sqrt[3]{r^3}}{2}-\frac{1}...
0
votes
3answers
99 views

Listing products of prime powers

Given a positive integer $n$, what is the code to list $2^{a_2}3^{a_3}\cdots p^{a_p}$, where $a_i\ge 0$ are integers, with respect to the lexicographic ordering on $(a_2,a_3,\ldots, a_p)$? The only ...
9
votes
5answers
646 views

How to tell Mathematica to do this with decimal part of real number?

My apologies if this was asked here before. My friend and I want to do this: Suppose that we have some real number $a. a_1 a_2...a_n...$ where $a_i$ are digits in the set $\{1,2,3,4,5,6,7,8,9,0\}$ (...
0
votes
1answer
58 views

Rolling covariance matrix of TemporalData with 3 paths

I know how to use MovingMap with TimeSeries, but MovingMap threads over paths. What if I ...