Solve a equation where I cant isolate the variable.
Show older comments
I want to solve this equation : (w^2)-(g*x*tanh(x*p)=0
where g=9.8 and p=80; and w is a matrix with 345 345 rows and 1 column.
My goal is to know the x's values.
I've used the solve function for one row, and it worked well, but using it for the entire w values, is taking forever! I've waited for 3 hours and it wasnt finished yet.
There must be a better function to solve this case, please help me.
this was what I've tried:
syms x
eq=solve((a(i,j+3)^2)-(g*x*tanh(x*p));
a(i,j+3) corresponds to w.
Accepted Answer
More Answers (1)
Walter Roberson
on 25 Mar 2014
x = (5/49)*w^2 + (10/49)*w^2 / (exp(2*RootOf(-400*exp(2*Z)*w^2 + 49*exp(2*Z)*Z - 400*w^2 - 49*Z,Z))-1)
where Rootof(f(Z),Z) stands for the set of Z such that f(Z) is 0 -- the roots of the equation.
When you use solve() all numeric values are by default converted into rational values. You might not want that: you might want to force them to be floating point so that the numeric root finding routines are used right off. You might want to convert it all to a loop of fzero(), as that would probably be faster.
You might also want to unique abs(w) and work with that sorted order, using the solution of the previous w as the initial search value for the next value.
Categories
Find more on Numeric Solvers in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!