Wednesday, February 20, 2019

Variation on a Theme


  Finding a mathematical equation that fits a certain shape can be a little challenging but I was able to find another one whose solution is a heart-shaped curve.


Friday, February 15, 2019

Solving and Plotting a Complicated Equation in Excel


  MATLAB tweeted the solution to a complicated mathematical equation earlier today and I thought it would be nice to see how to solve it with Excel. We start by modifying the equation so we can use the Newton's method to find a series of roots.


So, given r and θ one can compute f(r) and search for a nearby zero with feedback of the r values using copy and paste. The initial value for each θ was r=1. The formula for the corrected value of r on the first row was "=IF(H18=0,G18,G18-H18/I18)" which only changed the value of r if f(r) was not equal to zero. This was dragged to fill in the remaining rows of r.


The feedback process gave some negative solutions for r but these were corrected by interpolating the neighboring values of r and a little more feedback of the r column gave better results.


The plot of the x,y values for a 5 degree step in θ had straight line links which didn't appear accurate enough so I tried interpolating these solutions using the index function and doing a little more feedback with the r column. The extra column is an index value used to simplify the linear interpolation formula.


The plot for θ ranging from 0 to 360 degrees is with smoothing: