Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.

1. ## Algebraic Equation Solver

This code solves algebraic equations with complex coefficients
up to cubic orderview

2. You familiar with Newton's method?

You can approximate (rather accurately though) roots of equations, as long as you know the derivative. (In a pinch, you could try a numerical derivative, but then you're losing accuracy).

Basically, it is a :

function getRoot(guess) {
var old;

do {
old = guess;
guess = guess - f(guess)/fprime(guess);
} while (Math.abs(guess-old) > 0.0005);

return guess;
}

Depending on what you pass guess, it will find a root, or in the case of certain functions (like sinusoidal waves), oscillate forever, among other things. (In theory forever, the floating point arithmetic of a pc will eventually lose enough precision that it will converge somewhere).

3. The algorithm uses the analytic solution to cubic equation and so
is exact. It is an attempt to make use of JavaScript as a development platform on par with say Fortran or C. It is fascinating to put JS in this context. Consider the following.
JS does not have to be HTML "helper", but is used to develop stand-alone desktop applications with internet connectivity (loading functions from remote sites). It can be run locally or delivered via HTML page (distributed computing). It uses HTML
as GUI platform. And it has the enviable priviledge of being the
beneficiary of the latest internet technolgy.

4. doesnt every body pretty much know that dd vuong?? (what you said that javascript is and can be)
you read that in intorductions on information of Javascript

ps. wow!! thats a really complex thing to me, never heard of cubic equation.
p.p.s you can do functions like function abc() {
instead of var abc = function(){

5. Hi Kris,
agree with you that almost all Javascripters are aware of these
issues. But only a tiny development work in JS is being done in this
direction. JS is still pretty much in evolution.

6. Quick question: Why the buttons and not text boxes??

If you want to see my Math based program I am working on, you can see it here:
http://www10.brinkster.com/a1ien51/FEA/

Right now it is only IE, always code in IE first and get testing done, and then do netscape.

A1ien51

7. dd : yeah that would be really cool if other aplications of javascript was more common!.

always code in IE first and get testing done, and then do netscape.
thats what i do, but alot of the times i never get to the point of making it multi browser supported

8. ## Quick question: Why the buttons and not text boxes??

alien: I had problem with multiple user input nodes (prone to
human error). This novel use of buttons allow me to set one input
text field and distribute the input values to different variables.
It's supposed to be a design stepup.
Looked at your site and liked the layout. One comment: you should use scientific notation for your number outputs (it's hard to count many 0's). One question: finite-element-analysis approach uses system of linear equations (emphasis on "linear"), correct?

9. I am going to add that to it later on, I was trying to get out the buigs in my code. I am actually working on a very different approach to solve FEA problems that uses alot of other things. FEA is a linear in a way and other ways not. It is a lot of matrix multiplication and maniplulation. This has become my area of interest of late, trying to get a job in this field.

I have the code done with allowing the user to input 200E9 into a field and have it read as 200000000000. and the same with the output, but with work and my other projects, have not incorporated it into the code yet.

A1ien51

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•