Message Boards Message Boards

GROUPS:

Iterate a user defined function to load Table or ParametricPlot function

Posted 26 days ago
280 Views
|
2 Replies
|
1 Total Likes
|

I would like to plot series of points on a graph starting at a given point and continuing to the point of greatest magnitude. This could be accomplished by either creating a Table[] of points and then plotting the points, or embedding ParametricPlot[] in the Show[] function. However using either Table[]or ParametricPlot [] functions would require iterating a user defined gradient function and then using the output of the previous iteration as the input to the subsequent iterations and I am not sure how to do that in Mathematica and would appreciate guidance in performing the iterations (see attached notebook).

Additional if my whole approach is incorrect, I would be open to any and all suggestions because I am always interested it trying a better method to visualize my calculations.

Thank you so much for your assistance.

2 Replies
Posted 26 days ago

Hi Mitchell,

iterating a user defined gradient function and then using the output of the previous iteration as the input to the subsequent iterations

Nest and related functions can do this e.g.

NestList[Normalize@df[Sequence @@ #] &, {3, 4}, 3]
(* {{3, 4}, {7/25, -(24/25)}, {527/625, 336/625}, {-(164833/390625), -(354144/390625)}} *)

In the attached notebook P1, P2, P3, P4 ignore the sign of the previous term. If that is what you want, just add an Abs.

Hi Rohit;

I included your NestList[] iterator into my Graphics[] function replacing the points (P1, P2, P3, and P4) which I had created manually and your code worked great in duplicating what I had created manually.

However, the location of plotted points is still somewhat concerning. What I was expecting was a sequence of points that follow the VectorPlot[] function in somewhat a uniform spacing and approach the greatest temperature, which the points do not.

I am in the process of rewriting my discussion and plan to resubmit it tomorrow for additional comments. Hopefully, I will do a better job explaining my concerns.

Thanks,

Mitch Sandlin

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract