Questions tagged [code-request]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
58 views

How to solve first order complex differential equation?

I want to solve these differential equations and want to get the value of 'a1'. I used this code given below but it is not showing any result. If anyone can resolve this will be appreciated. ...
1
vote
1answer
40 views

How to use output of NSolve for further calculation and than plot?

I am trying to plot the output using these linear equations but finding some difficulty. Here I am using the output of these linear equations and after that using them in another formula and after ...
0
votes
0answers
38 views

What is the programming code for this fucntion? [closed]

Could anyone please help me find the programming codes for the function SpherePoints? Many thanks!
0
votes
0answers
47 views

I want to plot root of the following complex equation

I am trying to plot the roots of the following equation as mentioned in the code below But it is not giving me output. If anyone can resolve this problem for me is most welcome. ...
3
votes
2answers
98 views

How can I map edgeweights from a matrix onto edges along the paths generated by another matrix

Suppose that we have two matrices with identical dimensions: matA and matB. I want to identify a set of pathways using ...
0
votes
1answer
72 views

Phase transitions graph [closed]

I have temperature T in terms of r as T = 1/(4 Pi r) + 2 P r^2 and ...
4
votes
1answer
136 views

How to combine a lists of two lists with a list of two lists of lists of varying length?

This is probably asked before but I don't know how to begin searching for it. Some context: I'm using TemporalData objects that share a number of common features ...
2
votes
1answer
59 views

How can I plot a 2D `LayeredGraph` on a 3D plane with a MMA function

In my previous question, I wanted to plot a 2-dimensional MMA LayeredGraph[...] on a 3-dimensional surface (or plane), and @KGLR answered the question in the ...
6
votes
3answers
170 views

Calculating the integral points of an elliptic curve

I asked this question on Math stachexchange. The question I have is: Can I use Mathematica to find the (integral points on the following elliptic curve) or can I find when the number $\text{n}$ is a ...
0
votes
0answers
62 views

Obtaining the results of tagged cells in a notebook from another notebook

My objective is to read the results of several tagged cells in a notebook NB1 from another notebook NB2. Following the ...
0
votes
1answer
53 views

Retrieving the evaluation result of an Initialization Cell in a notebook `nb1` from another notebook `nb2`

I have a very long code in a notebook nb1 in which all the initialization cells are tagged. I have another notebook nb2 where I ...
0
votes
1answer
55 views

Possible way to plot the solution density of diophantine equations

Well, I'm trying to investigate the density of solutions to Diophantine equations. What is a general method to describe that density? I've two functions: $$\varphi\left(\text{a},\text{b},\text{c}\...
3
votes
1answer
196 views

How can I generate a tailor-made directed graph from a given matrix

Given a matrix mat: mat = {{1, 5, 2, 6}, {4, 3, 4, 1}, {0, 1, 4, 0}, {2, 1, 3, 4}}; I want to apply the following conditions ...
2
votes
2answers
118 views

Finding a program that can find integer solutions for large values of a variable

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

How this equation is solved in reals

I have tried to solve this equation $2^{-2 ^{2^{-x}}}=2$ using FindInstance[2^(-2^(2^(-x))) == 2, x, Reals] The result is ...
5
votes
2answers
199 views

Plot problems: vertical lines and letters [closed]

In few words, I would make this graph: My many problems are the following: How do I plot a vertical line? What's the equation? How do I add the letters on the lines? How to make the Ticks like $...
6
votes
1answer
83 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
231 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
34 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
38 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: ...
9
votes
4answers
393 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
67 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 ...
3
votes
3answers
160 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
126 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
218 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
168 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
52 views
1
vote
2answers
151 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
59 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 ...
8
votes
2answers
483 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
66 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
52 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
55 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
156 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
214 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
91 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
34 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}+\...
1
vote
1answer
169 views

Integrating Hamiltonian equations using NDSolve [closed]

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
325 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
60 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
89 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
430 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 ...
13
votes
1answer
5k 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
133 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
143 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
379 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

...
2
votes
1answer
296 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
114 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
194 views

NDEigensystem to find eigenvalues and eigenfunctions of coupled differential equations:

I would like to numerically solve the following system of coupled differential equations: ...

1
2 3 4 5 6