Message Boards Message Boards

GROUPS:

Speed up my numerical calculations in NDSolve?

Posted 8 months ago
1187 Views
|
1 Reply
|
1 Total Likes
|

Hello everyone,

I am trying to perform a calculation that involves an interpolating function generated with NDSolve, as well as multiple NIntegrate solutions. Is there anyway I could speed up the calculation?

Thank you,

Alex

Attachments:
POSTED BY: Alex L
Answer

There are problems with your code. You give no value to g. The integral defining V:

NIntegrate[Exp[-B[t]]*
  ((1 - c*g)*H/K + (1 - c*g)*g*(1 - H/K)),
 {t, 0, v}]

has the variable t only in Exp[-B[t]] and it has v in the other factor. Did you really mean that?

As for speeding repeated integrals, you may try the NDSolve way:

B = NDSolveValue[{y'[v] == 
    b*(1 - c*g)*H/K + b*g*(1 - c*g)*(1 - H/K) - d*x/K,
   y[0] == 0},
  y, {v, 0, 1000}]
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract