The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [code-request]

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

Filter by
Sorted by
Tagged with
6
votes
1answer
46 views

Determinant of Gauss (Area of a polygon of n vertices) how to implement

A very useful procedure to find the area of ​​any irregular polygon is through the Gauss determinant. It involves drawing the figure on a Cartesian plane, setting the coordinates of each of the ...
4
votes
3answers
212 views

Writing a program that will filter the integer solutions

I've the following equation: b==(-12 + Sqrt[3] Sqrt[ 3 (-4 + r)^2 + 12 a^2 (-2 + r) - 4 a (-5 + r) (-2 + r) + 4 a^3 (-2 + r)^2] + 3 r)/(6 (-2 + r)) ...
0
votes
1answer
32 views

Encountering error in For-loop, If statement and Print Function [closed]

I am encountering some error while trying to find roots of equation using Bisection method. In this method, you take an interval (a1,b1), here I have taken (0,1). If f(a1)f(b1)<0, then you take p1 =...
2
votes
1answer
35 views

Finding the 3D-model of a function that is rotated around the x-axis

How can I find the 3D model that is created by revolving the function: ...
8
votes
4answers
373 views

How can I automate this tensor computation?

I am doing this work by hand, but it takes a lot of time and I make several calculation errors, so I was thinking to make Mathematica to calculate this for me, but I am stuck at the very beginning. I ...
2
votes
3answers
66 views

Find the number of true's in a TrueQ expression

How can I find how many times the code: Table[TrueQ[FractionalPart[Sqrt[n]] == 0], {n, 1, m, 1}] Gives the value True back for a variable $m$? So, we know that ...
1
vote
1answer
57 views

Calculation of Legrende Polynominals via Rodrigues Formula [closed]

I want to calculate Legendre Polynominals via Rodrigues formula for n=0,...,10 I wrote this down but how can I calculate n = 0,...,10 ? ...
3
votes
3answers
129 views

Mathematica code for Van Wijngaarden transformation?

The Van Wijngaarden adaptation of the Euler transform is used to accelerate convergence of an alternating series. An efficient algorithm for this appears in Numerical Recipes. Unfortunately, that ...
3
votes
0answers
70 views

Mathematica implementations of classical genetic algorithm optimization

Are there any Mathematica implementations of genetic algorithm optimization routines, including third-party and commercial? (DifferentialEvolution isn't quite what ...
5
votes
2answers
206 views

Finding the symbolic expression for the loss function of a basic feed forward network

Is there any basic code available to get the symbolic expression of the cross entropy (and/or mean squared error) loss function for feed-forward neural network with one or more hidden layers in ...
2
votes
1answer
133 views

Monte Carlo Simulation of a Double Well Potential (Edited)

I am looking for a possible way to simulate the temperature effect on a collection of atoms sitting within a double well potential, say something like ...
0
votes
0answers
51 views
1
vote
2answers
146 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
57 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
337 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
63 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
45 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
42 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
121 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
89 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
85 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
115 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
289 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
88 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
56 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
86 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
368 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
1k 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
119 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
114 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
364 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

How to remove the 2 same plot from arrays of plot

...
0
votes
0answers
43 views

Finding the functions that Mathematica plots while using BodePlot

I've the following Mathematica-code: ...
2
votes
1answer
205 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
111 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
157 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
117 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
145 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
56 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
50 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
542 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 ...
17
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
760 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
521 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
50 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
80 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
125 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
160 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], ...