How to solve and insert and plot differential equations ?
显示 更早的评论
回答(1 个)
There are different numerical methods to solve the differential equations , like RK method ( for initial value problem ) , FDM, FEM, ( for boundary value problem) and many others. Which method , you will use it depends on your system with which you are dealing.
For example, If you want to calculate potential distribution of a metal line under a direct current flow , you have a governing equation of electric problem and two boundary conditions for current input output. To solve the problem using finite difference mathod ( FDM ) . First you have to discretize the governing equation and boundary conditions ( FDM discretization, you will find in your numerical books) . Then you will have some algebric equations like p(i+1,j)+p(i-1,j) + p(i, j+1) + p(i, j-1) - 2p(i,j) = constant ( here, p= electric potential of a node (i,j) ) ,and solve these algebric equations using Ax=B , A is a coefficient matrix, x is variable matix and B is constant matrix. We need x. When you have x , you have already solved the governing equation.
Now, you can plot the x to show the potential distribution or for other properties, like electric flux or heat generation per unit volume you can post process the potential distribution and can plot them .
Thank you.
类别
在 帮助中心 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!