Questions tagged [code-request]

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

This tag should only be used for well-defined problems where the poster presents their efforts into researching existing algorithms. When possible, references to journal articles, or implementations in other languages should be provided.

537 questions
19
votes
2 answers

How to perform fuzzy lookup between lists?

I have two big lists with 10,000 lines each, with product names from different databases. They have a lot of common products (50%), but they are not typed in the same way. For example there is one sample of 20 items that match: List One Refresco em…
Murta
  • 26,275
  • 6
  • 76
  • 166
7
votes
3 answers

Calculating average distance between maxima

I'm having trouble figuring out a way to analyze some simple data. When graphed, the data I have make a somewhat sinusoidal curve. What I want to do is to find the x-values of the maximum peaks of the sinusoidal curve. I then want to subtract each…
Evan Hale
  • 71
  • 3
6
votes
2 answers

Creating a bifurcation diagram of the logistics map

I am brand new to Mathematica so please keep that in mind. I've run into trouble trying to make a bifurcation diagram. Here is what I have done: I have a function $f(x)$ that relies on a value $r$ (The range of $r$ lies between the values…
5
votes
2 answers

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+\alpha_nTy_n,$$ $$y_n=(1-\beta_n)Tx_n+\beta_nSx_n,\quad…
mark haokip
  • 153
  • 8
4
votes
3 answers

Help with coding triangular nodes/elements

I'm trying to write a program where it will shoot out the triangle node numbers. For example, in the picture, if we choose to divide this triangle by 5 points, then the program will return out the following: dat1 = {{0, 1, 6}, {1, 2, 7}, {2, 3,…
Johnny
  • 71
  • 2
4
votes
1 answer

How do I hide some of Input

I have a project with a friend, and we make some work in Mathematica. He is not very good at Mathematica, and I have made some long necessary formulas we need. I would like to show what I've made but only show what's important. Therefore I need to…
Jens Jensen
  • 611
  • 6
  • 19
3
votes
1 answer

How to insert a number in a specific position of a letter in a word

I have about 1000 variable names. Four example are: DPI[1] PXAC[a, c] TRANS PDS[c] I like to insert 0 in a specific position in the given variable names such as: DPI0[1] PXAC0[a, c] TRANS0 PDS0[c] I searched for solutions from the already asked…
Tugrul Temel
  • 6,193
  • 3
  • 12
  • 32
2
votes
2 answers

Lyapunov exponent of a Henon map?

Can anyone help me with calculating Lyapunov exponent of 2D map, for example Henon map? If there is simple code, that would be great!
Gagi
  • 31
  • 1
  • 2
2
votes
6 answers

Setting the elements of a list equal to elements of a different list

A = {a,b,c,d,e,f,g,h} B = {1,2,3,4,5} How would I go about setting some of the elements in list A equal to the elements in list B and then the left over elements in list A will be set to 0. For example, set a=1, c=2, d=3, g=4, h=5 and then the…
Johnny
  • 71
  • 2
2
votes
2 answers

Find centroid point which depends on time and plot it in animation along with curve?

Given a partial differential equation, we can NDSolve for its solution. In my case I got a function of three variables $u(t,x,z)$. I wish to study the case when we restrict $z=0$. Most importantly, I wish to animate how $u(t,x,0)$ changes with time…
Rescy_
  • 53
  • 8
2
votes
1 answer

how to print "output cells" in PDF format on one page each cell

I have a notebook with various output cells including some graphs. I like to print only the output cells in PDF format, but each output cell should be fit into a separate page. Sometimes, pictures are large to print on one page, in which case a…
Tugrul Temel
  • 6,193
  • 3
  • 12
  • 32
2
votes
1 answer

how to create index names

I have file names in the form of "ARG_time.xls", "AUS_time.xls" and so on. I like to create time stamped file name as "ARG_2012.xls", "AUS_2012.xls" and so on. I apply: Table[ {"ARG_time.xls", "AUS_time.xls", "AUT_time.xls", "BEL_time.xls", …
Tugrul Temel
  • 6,193
  • 3
  • 12
  • 32
2
votes
1 answer

How to simplify Binomial expressions?

Binomial[2 n, 2 a]/Binomial[n, a]^2 I come across this expression, but no simplification command is working. Can it be simplified further?
Shamina
  • 633
  • 4
  • 16
1
vote
1 answer

How to inverse matrix equations?

I've never used matematica before so still learning. I'm trying to show that two equations below are equal to one another. To do that, doing an inverse transformation from 3.5-3 to 3.5-4 would accomplish that. The equation in Matrix Form: Any help…
kp2014
  • 19
  • 1
1
vote
1 answer

How to make the code related to line and ellipse more concise?

My needs are shown in the picture is. **1. Calculate the equation after a straight line and an ellipse are simultaneous (eliminate x) The desired result is: (b^2 + a^2 k^2) x^2 + 2 a^2 k m x + (-a^2 b^2 + a^2 m^2) == 0 2.Calculating the discriminant…
csn899
  • 3,953
  • 6
  • 13
1
2