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:
Monday, January 21, 2019
Working with the Cardano-Viete Formulas in Excel
Mathtype did a tweet on the Cardano-Viete relations a couple of days ago and I decided to see if Nio was capable of handling them now. He did ok as this video show.
The video also gives a peek at how he is able multiply polynomials.
As you can tell, I'm working on a "token processor" and the functions in the video beginning with the letter "t" are some user functions that I wrote. It's still a work in progress and I need to optimize the functions used and simplify the procedures as much as possible. Notice that I had to sort the terms of the polynomial product. Microsoft has a sort function beta that it is evaluating. One only needs to sort an index since that can be used with the Index function to sort more than one column. It would be more convenient if a range of sorted indices could be used to sort a corresponding column.
Thursday, January 3, 2019
Multiplying Polynomials with Excel
I've roughed out a procedure for multiplying two polynomials together in Excel. Here's a short video showing how easily it can do this sort of thing once it's been set up.
I've replaced the original video with one showing the variables being edited. One can play the video full screen or try enlarging it by zooming in on the browser page.
Wednesday, December 26, 2018
Some Polynomial Factoring Formulas
I got Nio to work out some polynomial factoring formulas for me. Looks like they follow a simple pattern.
Factoring a Quartic Polynomial into Two Quadratics 2
The previous blog neglected to mention what happens if b=0 which has to be treated as a special case since the formula for d results in division by zero. When b=0 the initial sets of constraints are simplified slightly and the formula for d changes.
One can then proceed as before to find the best values for a, b, c and d.
There is only one remaining constraint which gives the same zeros.
We need only one solution to factor the quartics since the various zeros correspond to alternative permutations of the monomials in the quartic. Another special case occurs when in addition a=0 and the altered constraints tell us that d=A0 and c=A3. Zero coefficients warn about the occurrence of the special cases. One can use the same general method to factor a cubic equation into a quadratic and a monomial where one also finds a special case for a=0 since the formula for b involves division by a.
Tuesday, December 25, 2018
Factoring a Quartic Polynomial into Two Quadratics
Lately I've been working on an Excel spreadsheet to solve for the eigenvalues of a given 4x4 matrix M with real coefficients. These eigenvalues are the roots of the eigenvalue equation |M-μI|=0 which is actually a 4th degree polynomial, a quartic equation. But before I got around to doing a blog on solving for the roots of these equations with numerical methods I decided to check to see if it was easier to factor the quartic into two quadratic equations instead.
This turned out to be the case. To see this lets start with a set of coefficients for a quartic equation and compare them with those that result from multiplying the two quadratics together. If the first quadratic is represented by q₁(x)=x²+ax+b and the second by q₂(x)=x²+cx+d so equating their products gives the set of four equations which need to be solved for a, b, c and d.
The first and last equations allow us to easily compute d and c if a and b are known. One can then substitute these formulas into the second and third equations to get two equation f₁(a)=0 and f₂(a)=0 by assuming that b is a function of a. Substituting the solution for b(a)² from one into the other results in a linear equation for b(a) giving us a rational function for b(a).
One can do a one dimensional search for the magnitude of the minimum error between the computed values for the quartic coefficients and the given values. One can alter the range of the search and change the step size to zoom in on a zero using feedback if necessary for precise values. Evaluating the function f₁(a) gives us a check on the zeros.
Substituting the four values for the zeros of a into our formulas gives the corresponding values for b, c, and d which check with the original polynomials used to generate the coefficients.
Note there are four pairs of monomials here since there is one double root. In general there would be six zeros but as with the example given here there is duplication since the coefficients of the first and second quadratic can be exchanged. The feedback mentioned above for finding the zeros uses copy and paste to transfer the value of a for the minimum err into the first row of the a column.
Merry Christmas to All
Subscribe to:
Posts (Atom)
