Solving a Mathematica Function of 2 Variables w/ Nestlist

  • Context: Mathematica 
  • Thread starter Thread starter peter.a
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary

Discussion Overview

The discussion revolves around using Mathematica to create a function of two variables and generating a series of values through the NestList function. Participants explore how to automate the process of generating data for plotting and seek clarification on plotting techniques.

Discussion Character

  • Technical explanation, Homework-related, Exploratory

Main Points Raised

  • One participant introduces a function of two variables and seeks to iterate through a range of values, expressing difficulty in automating the process.
  • Another participant provides a solution using the Table function to generate the desired data set, indicating a method to automate the value generation.
  • A participant expresses appreciation for the quick solution and requests guidance on how to plot the generated data using ListPlot.
  • Another participant suggests that using "ListPlot[data]" is the appropriate method for plotting the data, emphasizing the importance of Tables in Mathematica.

Areas of Agreement / Disagreement

Participants generally agree on the methods for generating data and plotting it, but there is no explicit consensus on the best practices for using these functions in Mathematica.

Contextual Notes

Some assumptions about the familiarity with Mathematica and its functions may not be explicitly stated, and the discussion does not resolve potential complexities in the plotting process.

Who May Find This Useful

Users interested in Mathematica programming, particularly those working with functions of multiple variables and data visualization techniques.

peter.a
Messages
19
Reaction score
0
I have a function of two variables

f[x_][y_]=x^2+y;

d=Take[NestList[f[-2],0,10],-2];

now i want to repeat this process by changing -2 to -1.99, then -1.98 all the way up to 0
and storing values in a table, so i can later make a plot. I can't figure out how to repeat this process.
 
Physics news on Phys.org
data = Table[Take[NestList[f, 0, 10], -2], {i, -2, 0, 0.01}]
 
Thts amazing! I am a bit intimidated by the fact you did in 2 seconds what i have been working on for the better part of an hour.
Thanks.
can you tell me how i can plot this stored data using ListPlot ? to see what the relationship is between x and the y values
 
Whoops hit post 2 times!
 
Is "ListPlot[data]" not what you're looking for?

And don't be intimidated, if you start using Mathematica a lot, Tables are a MAJOR component to using it well.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K