Sorry, this is not really algebra but I didn't find a more suitable forum. What I'm in need of is a suitable numerical approximation method for solving the equation system below, a numerical approximation method that I then can implement in javascript for myself.
As you may know from another thread I posted in Calculus recently, but which I found the answer to myself, I'm writing a javascript game about hanging in threads.
Now, when an idealised thread of length L isn't stretched, it will be hanging in an arc between two points of heights H (higher height) and K (lower height).
I found almost all the information I needed to implement such a thread model on this page: http://www.had2know.com/academics/catenary-equation-shape-hanging-chain.html
It tells the following:
The equation for the hanging thread is as follows:
y(x) = a + (1/b)cosh(b(x-c))
where a, b, and c are constants satisfying the following equations:
1. H = a + (ebc + e-bc)/(2b)
2. K = a + (eb(D-c) + e-b(D-c))/(2b)
3. L = (eb(D-c) - e-b(D-c) + ebc - e-bc)/(2b)
and as told, we know the values of H, K and L.
But unfortunately, this equation system is not solvable algebraically, but must be solved numerically. And I know very little about methods for numerical approximation. And I won't be able to plug Matlab or something similar into my code, but I will have to write in computer code some (hopefully simple) approximation function myself, suitable for solving this system with three unknown variables.
There was even a calculator for just this on the page I linked, but as I understand it the code for that calculator seems to reside on the server, so I can't just "be inspired" by that calculator's code...
I checked the Wikipedia page about numerical approximation but it was hard to sort out all the information.
So, do you have a suggestion of which method to use here? Thank you in advance!
As you may know from another thread I posted in Calculus recently, but which I found the answer to myself, I'm writing a javascript game about hanging in threads.
Now, when an idealised thread of length L isn't stretched, it will be hanging in an arc between two points of heights H (higher height) and K (lower height).
I found almost all the information I needed to implement such a thread model on this page: http://www.had2know.com/academics/catenary-equation-shape-hanging-chain.html
It tells the following:
The equation for the hanging thread is as follows:
y(x) = a + (1/b)cosh(b(x-c))
where a, b, and c are constants satisfying the following equations:
1. H = a + (ebc + e-bc)/(2b)
2. K = a + (eb(D-c) + e-b(D-c))/(2b)
3. L = (eb(D-c) - e-b(D-c) + ebc - e-bc)/(2b)
and as told, we know the values of H, K and L.
But unfortunately, this equation system is not solvable algebraically, but must be solved numerically. And I know very little about methods for numerical approximation. And I won't be able to plug Matlab or something similar into my code, but I will have to write in computer code some (hopefully simple) approximation function myself, suitable for solving this system with three unknown variables.
There was even a calculator for just this on the page I linked, but as I understand it the code for that calculator seems to reside on the server, so I can't just "be inspired" by that calculator's code...
I checked the Wikipedia page about numerical approximation but it was hard to sort out all the information.
So, do you have a suggestion of which method to use here? Thank you in advance!