Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

4th Order Polynomial in Excel

Status
Not open for further replies.

dk18

Mechanical
Jul 9, 2004
3
I am looking to solve a 4th order polynomial in an Excel spread sheet. I am currently using an add-in function I found on the web however this add-in is password protected and the spread sheet that I created can not be shared with anyone with out this add in. I am looking to create a function that I can call out in the spread sheet and be able to share this spread sheet with others. This spread sheet is only to share among colleagues for informational purposes.

Is there code I can cut and paste into a VB module that could achieve this?
 
Replies continue below

Recommended for you

How about excel solver?

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
Solver will work, but (1) you need to give it a starting approximate solution that is adequately close to the correct solution, and (2) you need to invoke it each time unless you trigger its operation with an event handler. Since it seems that you intend to distribute your finished spreadsheet to other people, these requirements might be a drawback.

There is a non-iterative algorithm for the solution of the general quartic equation, but it's not all that easy. I have never attempted to code it.

This is an engineering forum, and with most engineering problems the engineer has a rough idea of the answer to a problem before beginning to solve it. If this applies to your case, you could devise your own iterative algorithm tailored to the general characteristics of the problem. You could then code that in VBA as a user-defined function. Finally, test it to the very limits of your likely range of actual problems, or slightly beyond those limits, then build in some traps for problems that exceed your tested limits.

HTH
 
You're right Denial. Your comments bring to mind a warning to the OP - a 4th order polynomial will likely have several solutions... some attention is needed somewhere to make sure you get the right one.

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
In this case we can give a definitive value for "several"!

Four

although some may be imaginary and/or repeated.



Cheers

Greg Locock
 
Since we are now delving into the theory of complex roots to polynomials, I suspect that the "imaginary and/or repeated" above should more correctly be "imaginary or repeated (but not both)". :)
 
(x+b)2*(x2+b2)
imaginary and repeated roots?

TTFN
 
My comment referred to an individual root being both imaginary and repeated, not to an equation having some imaginary roots and some repeated roots. His equation has the solutions -b, -b, +bî and -bî, so it is the non-imaginary solution that is repeated.
 
I KNOW what you meant, but the sentence was semantically vague. ;-)

TTFN
 
English can be beautifully and brilliantly vague.
Mathematics should be beautifully and brilliantly precise.
Problems always arise when we intermingle the two.

To express the same sentiment in a bad haiku:
Words show shades of grey.
Maths is all ways black and white.
Take care when you mix.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor