TransWikia.com

DSolve with initial conditions

Mathematica Asked by Frigo on December 4, 2020

I am having trouble solving differential equations with initial conditions, and unfortunately the answers given in similar questions in this forum don’t seem to work for me.

My final goal is to solve an integro-differential equation of a function $p(x,t)$ with an initial distribution $p(0,t)$. But even in a very simple trial example, I am not able to specify initial conditions if my function has two arguments.

So what I tried is the following:

sol = 
  DSolveValue[{D[f[a, b], a]  == a + b, D[f[a, b], b]  == a + b}, f[a, b], {a, b}]

which returns the correct solution a^2/2 + a b + b^2/2 + C[1].

Now I simply tried to fix the value of C by adding f[0,0] == 0 to my list of equations; but from this answer (DSolve not finding solution I expected) I gather this does not work due to the genericity of the problem.

However, trying to implement the suggested solution by implementing the initial condition in a general symbolic way by writing

sol[a_, b_, c_] = 
  f[a, b] /. 
    DSolveValue[
      {D[f[a, b], a]  == a + b, D[f[a, b], b]  == a + b, f[0, 0] == c}, 
      f[a, b], {a, b}]

Even though I have to admit that I don’t really understand how this ReplaceAll command is supposed to work in the above expression, it doesn’t work at all for me. I have no idea what to try next.

Any help would be greatly appreciated!

Also, I think that since I am not really interested in an exact symbolic solution, I should use NDSolve instead, right?

P.S. : This is my first question here, so any comments on how I should change questions and formatting in the future are very welcome!

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP