On 6/18/19 11:13 PM, shahla yavari wrote:
> (∂(hc_i))/∂t+(∂(〖qc〗_i))/∂x =e_i+e_di+r_i 〖+r〗_ri-d_i,
>
You need a symbolic math package to handle such equations in that form.
The two I'm most familiar with are called Mathematica and Maple. I
haven't used such packages in a long time, so it's entirely possible
that there's more modern symbolic math systems that are much better than
those.
While you can't handle such equations in that form in C++, it's possible
to write C++ code to solve partial differential equations numerically. A
key concept in putting together such solutions is to approximate the
partial derivatives with finite-differences: the partial derivative of
f(x,y) with respect to x at the point x0,y0 can be approximated by
(f(x0+deltax,y0) - f(x0,y0))/deltax, where deltax is the spacing of your
discrete approximation to f in the x direction.
However, you don't have a well-posed problem until you've specified
boundary conditions for the solution - the fact that you didn't mention
any suggests that you're not quite ready to do something like that.
There's lots and lots of subtleties that need to be dealt with. For
instance, it's quite easy to misuse finite-difference approximations to
justify an algorithm for solving the equations that, instead of
converging on a valid solution, diverges exponentially away from a valid
solution. You need to take some courses and/or read some advanced books
on numerical methods before even attempting to do such things.