Stack Exchange Network

Stack Exchange network consists of 175 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.

1
vote
2answers
129 views

Eigen value solution of coupled ODEs

I want an eigen value solution of following coupled ODEs: But the code showing errors. ...
1
vote
1answer
49 views

Replace second derivative with product rule

Suppose that after some calculations, I find a[x]*D[g[x],x,x]+b[x]*D[h[x],x,x]+c[x]*D[j[x],x] What sort of operations do I need to do in Mathematica such that ...
9
votes
2answers
262 views

Catmull-Clark and Doo-Sabin Subdivision Implementations

I want to work on subdivision surfaces. Unfortunately, I don’t have any source code to start with. I need some Mathematica codes for applying Catmull-Clark and Doo-Sabin methods. I would like to ...
1
vote
1answer
62 views

Looping a function that requires previous calculations in order to continue

I am trying to solve a system of overdetermined linear equations for 2 unknowns with 3 variables. For a given equation of a line, we can write it as: ax + by = c, which expressed in vector form is ...
1
vote
2answers
43 views

Using FittedModel without clashing symbols

For some FittedModel, the "BestFitParameters" are given in terms of the symbols used to define the model. ...
0
votes
0answers
31 views

Changing the origin of the coordinate system aligned on an image when using the ImageFowardTransformation function

When using the image transformation command ImageFowardTransformation[image, function] the pixels of the image you input are in cartesian coordinates that by ...
0
votes
1answer
109 views

Creating a numerical table of values and using an interpolation of them to transform pixels in an image by the ImageTransformation command

I am trying to carry out point "Implementing Map" on this paper Interstellar wormholes however I am using my own equations not those given (only the same method). I have generated a list of values ...
0
votes
0answers
73 views

How to differentiate with respect to a function

I have some complicated expression, let's call it $X_n$, for which I don't have a closed form, but I do have a recurrence relation. It is given in terms of some functions $u(x,y),$ $v(x,y),$ and ...
2
votes
0answers
82 views

Using Image Transformation to create image sky view of what its like to be near black hole (Not a wormhole) [duplicate]

Question : I am trying to carry out point 3. "Implementing map" on page 13 in the paper Interstellar wormholes using my own equations not those in the paper. however am not 100% sure on how to go ...
0
votes
0answers
32 views

Inverting a matrix when its elements are given by difficult expressions?

I have a matrix which is composed by these elements: $$\mathcal{K}_{11} = \frac{3\alpha^{4/3}(4\mathcal{V} - \xi +6\alpha \sum_{k = 2}^n\lambda_k \tau_k^{3/2})}{4(2\mathcal{V}+\xi)^2(\mathcal{V}+\...
0
votes
1answer
87 views

Integrating Hamiltonian equations using NDSolve

Would someone be able to integrate numerically the equations at the bottom of page 12 in the paper Interstellar Wormholes given some initial conditions of your choice. Reading the first paragraph of ...
5
votes
1answer
252 views

Integrating Hamilton's equations for the Schwarzschild metric

Part 1 I am trying to integrate Hamiltons equations for the Schwarzschild geometry using NDSolve, these equations must all be integrated simultaneously and are nice ODE's. A similar task is done in ...
0
votes
0answers
6 views

Using manipulate in the plot of a function that depens on a FindRoot function [duplicate]

I've the following two codes: FindRoot[Abs[Uin*Sin[2*Pi*fin*T - (Pi/2)]] - 2*Ud == (Uin - 2*Ud)* Exp[-T/(c*Rb)], {T, 1/(4*fin), 1/(2*fin)}] And: ...
0
votes
0answers
80 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
39 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
83 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
358 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 ...
12
votes
1answer
894 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
111 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
83 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
355 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
56 views
0
votes
0answers
41 views
2
votes
1answer
169 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
109 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
124 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
76 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
135 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
52 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
49 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
418 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
547 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
475 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
47 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
68 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
113 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
151 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
216 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
68 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
133 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 ...
2
votes
1answer
131 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
24 views

Extending the runtime of a export .avi file

I've the following code: ...
0
votes
1answer
142 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
28 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
60 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
284 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
61 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
331 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
59 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 ...