Group Abstract Group Abstract

Message Boards Message Boards

Setting global precision and decimals

Posted 12 years ago
Attachments:
6 Replies

You could be running into ill conditioned problems. At which point you may need to think through carefully the formulation to see if the results make sense (sometimes they do, even if it seems that error terms are large). Also it might be possible that rescaling of variables will help.

POSTED BY: Daniel Lichtblau

Dear Daniel,

Thank you for looking further at my problem. I have indeed added the precision code for the parameter lists and the ssp calculation. It did indeed resolve the warning I had before. :-) Thank you. An increase in precision has not resulted in any change in my Identity matrix for the larger k values (the result with which I check whether all my calculations are ok). And I have yet also not found any mistake in my code. So still only for the situations where some of the variables are very small and very large (which occurs at the low k values) I do not obtain a perfect Identity matrix. I will continue working on it, simplifying and checking it.

When I have a better readable script I will resubmit and give an update.

Kind regards,

Anne-Claire

You should also try the changes I suggested. I did, and did not run into the problems mentioned in the first post.

The analysis of error propagation will still need to be done, of course. But at least you'll get further along in the computations to the point where that can proceed.

POSTED BY: Daniel Lichtblau

Dear Daniel,

I am sorry for the notebook. We have been thinking very hard to find a way to simplify the model. And this version is already a very simplified and modularized model. In the actual model, there are more reactions, namely 56 in total instead of the 4 I have here.

The thing is that we are modeling a complex metabolic pathway in the rat mitochondria. Mitochondria are the ATP-producing organelles in a rat cell. This metabolic pathway contains a lot of loops and uses of the same enzyme for several different necessary reactions. The pathway contains 11 enzymes. And for instance 5 of the 11 enzymes catalyze 7 reactions. (So in fact 57 + 35 + 13 + 11 + 1*2 = 56 reactions catalyzed by 11 enzymes). For each reaction, other parameters values need to be used, however the reaction rate equation for each enzyme is the same (except one of the enzymes). That is why we have split the definition of the reaction rate equations in A) unique functions and B) the rate equations (RateEqs) for each separate reaction, that calls the corresponding function. In the large model that contains many more reactions per enzyme it will become more understandable why we did this split. But you are right, here this split is not necessary, however this way it is more easy for me to change the parameters I put in each of the RateEqs list.

By giving the parameters a name related to the actual kinetic parameters in question, we can more easily recognize which parameter we need to change its constant value if needed. So for us this makes the notebook more readable.

The colors were just for me to remember what I changed and I am sorry for that.

For the reader I will change the code and resubmit as soon as possible.

Thank you,

Anne-Claire

That notebook is a mess. It's impossible to read some of the colored highlighted code (and imagine if the reader was color blind). Then there are redefeinitions of all sorts of things. If you want serious attention put into your question, you'll need to do a much better job of pruning and isolating the problem(s).

I will recommend three things.

(1) Make the functions R1 etc. only defined on explicit `NumberQ arguments. This would be done (after quitting or at least clearing the current definitions) as

R1[V_?NumberQ, Kms1_?NumberQ, Kms8_?NumberQ, Kmp1_?NumberQ, 
 Kmp7_?NumberQ, Keq_?NumberQ, S1_?NumberQ, S8_?NumberQ, P1_?NumberQ, 
 P7_?NumberQ] := ...

(2) Set the parameters to high precision. For the shorter list this could be done as

Parm2 = SetPrecision[{VR1 -> 0.12, VR2 -> 0.2, VR3 -> 0.2, 
    VR4 -> 0.6}, 100];

(3) Run FindRoot at higher precision than default (which is machine precision). Could be done as in the example below.

ss1 = FindRoot[
  Table[Odes[[i, 2]] == 0, {i, 1, Length[Odes]}] /. RateEqs /. 
     CoAMATX /. Parm /. Parm2, t1, WorkingPrecision -> 50]

If you have further trouble I will advise that you pay serious attention to the first remarks when formulating any follow-up question(s). This notebook is way too long to go through, just to guess at what might be the problematic areas.

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard