Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Hi every one .how can i write a program for differential equation with (x,t)variable?my equation exactly is:(∂(hc_i))/∂t+(∂(〖qc〗_i))/∂x =e_i+e_di+r_i 〖+r〗_ri-d_i,

17 views
Skip to first unread message

shahla yavari

unread,
Jun 18, 2019, 11:13:58 PM6/18/19
to
(∂(hc_i))/∂t+(∂(〖qc〗_i))/∂x =e_i+e_di+r_i 〖+r〗_ri-d_i,

Real Troll

unread,
Jun 19, 2019, 12:32:57 AM6/19/19
to
On 19/06/2019 04:13, shahla yavari wrote:
> (∂(hc_i))/∂t+(∂(〖qc〗_i))/∂x =e_i+e_di+r_i 〖+r〗_ri-d_i,

Please start here first:

<https://www.codeproject.com/Articles/43607/Solving-ordinary-differential-equations-in-C>

You need to learn how to use Google Search Engine as it has most answers
to get started.

Good luck.


James Kuyper

unread,
Jun 19, 2019, 7:53:54 AM6/19/19
to
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.
0 new messages