Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Quartic Equation Solution Help

Status
Not open for further replies.

Dogss

New member
Nov 22, 2006
2
Hi,

I have currently developed a VB script that produces 4 coefficients e.g (A1,A2,A3,A4). These four coefficients make up the constants of a quartic equation.

A1x^4 + A2x^3 + A3x^2 + A4x = 0

Where I need to solve for x.

I am not strong in visual basic and was thinking the Newton Raphson method may be appropriate to solve this. However I am not proficient enough to write this code in vb. Does anyone have a suitable VB script that may solve this equation for me or any advice on an alternative method.

Any help would be greatly appreciated.

Cheers,

M
 
Replies continue below

Recommended for you

Well I love advanced math and programming but the math involved in solving this one may be over my head. I did, however, find a useful description on Wikipedia at ...if you go about two thirds of the way down the page there is a section called [bold]Summary of Ferrari's method[/bold] that looks like it would lend itself very well to adapting into a complex function.

It looks to me as if those equations could be incorporated into a VB function that would also be able to handle the special cases and return some roots for you. It looks like it would take some work and testing but if those equations work for your purposes it should be possible. Otherwise is there any chance you could send those variables to Matlab (or similar) for processing?

I hope that is any help at all, and I'd be happy to help with VB function construction suggestions too.

Eric
 
Do you need only the real roots or real and imaginary roots?
Do you have an estimate of where the roots are that you want to find?
The answers to the above questions will help determine which method to use.

For some reading on numerical methods go to it is the numerical recipies site, they have some useful info and algorithms.
 
I only needed to find the real roots with no estimate of where the roots are.

However, I was able to solve this using a quartic solution formula I found on the web.

For anyone who is interested there is a helpful solution for a quartic polynomial which can be found at


This steps out a process that isn't too bad to put into vb.

Thanks for your help

M.
 
It just happens I've just finished some custom functions to do the same thing (also find complex roots, and solve cubics and quadratics).

Anyone interested can download from:


The file should be self explanatory, but if not please ask.

It's open source, any comments on the code are welcome.

Doug Jenkins
Interactive Design Services
dougjenkins@interactiveds.com.au
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor