Regarding precision and numerical instability in MATLAB
6 views (last 30 days)
Show older comments
I am working on a numerical problem. There I am solving 10 coupled linear equations (since i am solving in steady state). There are 10 variables and 16 rate parameters. I am solving the system of these equations for random rate parameters. I am generating set of random rate parameters ( for those 16 rate parameters) in the range 1e-8 to 1e+8 and solving the equation. then I am generating random set in the range 1e-16 to 1e+16. How can i check if there is a numerical instability if any? Moreover, since matlab uses double precision, i can do calculations accurately upto 16 digits?
1 Comment
John D'Errico
on 18 Sep 2024
Edited: John D'Errico
on 18 Sep 2024
This vaguely stated question would arguably need courses in numerical analysis and numerical solutions to differential equations to answer at all well, maybe with some focus on stiff ODE systems too. Plus numerical linear algebra. Multiple books writtten, and read. I said vaguely stated, because we are not told what you are actually doing, only given a glimpse, some hints at what you are trying to do.
No, you cannot trust all 16 digits you get there, precisely because of numerical issues. The ranges of those parameters suggests you are likely far exceeding the limits of what you can compute accurately using double precision.
If you want a good answer, then make an appointment with someone with expertise on those matters. Look at your local university math department as a start, though there are some superb mathematicians residing in engineering departments too. Tell your consultant exactly what you are doing, rather than the vague glimpse you have given here.
Answers (1)
Star Strider
on 18 Sep 2024
The problem of 16 parameters with 10 equations is not going to result in unique values for the 16 parameters, regardless of the approach you use to solve the problem. It is simply under-determined. The number of equatiions has to be at least equal to the number of parameters to get a unique solution.
3 Comments
Star Strider
on 18 Sep 2024
@Torsten — There are 10 equations, 10 ‘variables’ (that may be the LHS of the 10 equations), and 16 rate parameters. I’m not certain what is going on here, however on the basis of my experience with kinetics probllems, my analysis is likely correct.
Star Strider
on 18 Sep 2024
@Rupal — I cannot make any sense of this, and I do not have the ‘A_Aoriginal_protein_1.csv’ and ‘sum.csv’ files, so it can’t be run.
If you are solving for the stoichometric exponents, it is not necessary to take the log of the values (although I used that method as an undergraduate several decades ago with a much simpler physical chemistry lab problem). You can use one of the many MATLAB nonlinear regression routines to solve for them directly.
See: Parameter Estimation for a System of Differential Equations for an approach to solving for the rate constants.
See Also
Categories
Find more on Number Theory 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!