2

I'm new to Mathematica and I'm trying to use it to solve some equation like:

NDSolve[x'[t]+NIntegrate[x[tau],{tau,0,t}]==20,x,{t,0,10}]

But it keeps giving me some errors like:

tau = t is not a valid limit of integration.

The actual problem is much more complicated and bigger. I would like to prefer not to take derivative on both sides.

Can anyone help? Thank you all in advance!

407PZ
  • 1,441
  • 8
  • 20
  • 3
    As far as I know, NDSolve doesn't solve integro-differential equations. Try taking the derivative of your equation and treating the differential equation as a second-order differential equation in tau, perhaps. – march Aug 06 '15 at 19:59
  • Welcome to Mathematica.SE! I hope you will become a regular contributor. To get started, 1) take the introductory Tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign, and 4) give help too, by answering questions in your areas of expertise. – bbgodfrey Aug 06 '15 at 20:00
  • 1
    In addition to @march 's comment, please remember that NIntegrate is a numerical integration routine. It needs its input to be explicitly a number; see this FAQ for more details on this point. – MarcoB Aug 06 '15 at 20:02
  • @march thank you for your answer. I had that idea too. But the actual equations are much bigger and much more complicated. I don't think it is a great idea to take a derivative of my equations. – 407PZ Aug 06 '15 at 20:02
  • @MarcoB so actually it is not possible to solve this kind of equations with NDSolve? – 407PZ Aug 06 '15 at 20:03
  • I don't have much experience with integro - differential equations, but I suspect that you will have to rig something together yourself. For the numerical issue, in general you can define a function wrapper for your NIntegrate that only evaluates when given a numerical value of t. I don't know how to make that work within NDSolve though. A few examples of integro - differential problems have cropped up on the site already; you might get some inspiration by browsing the integral-equation tag, if you haven't yet. – MarcoB Aug 06 '15 at 20:11
  • @MarcoB Thank you for your advice. I will review them. – 407PZ Aug 06 '15 at 20:21
  • @Jens I've read your post. It does quite good on normal functions. But actually in my equations it contains some interpolated function from a excel data. I'm not quite sure if Mathematica is capable of converting them into Laplace form. – 407PZ Aug 06 '15 at 20:24
  • 1
    If you post the actual problem with some example data, it may be easier to get a solution that is actually useful to you. It looks like you should pursue a discretized solution if your data are discretized to begin with. In particular, perhaps this link is more useful. – Jens Aug 06 '15 at 20:25

0 Answers0