Help, how to replace the values of a ones matrix with vectors in each column
2 ビュー (過去 30 日間)
古いコメントを表示
Hi, i'm resolving a PDE for three components (diffusion problem). The things is, i want to save those values of concentration in the domain of x in the end of the simulation in a 100 x 3 ones matrix (one column for each component). As the concentration values are time dependent, while t<t of simulation, the values varies, but when the time is over, all the values return to one. I'm solving the PDE separately for each component, so i'm using an if sentence to replace the values of the matrix for the concentration values. How can i keep the last concentration values of all the components in the matrix, so they don't return to be one? I hope you can understand my problem
回答 (1 件)
Sreedhar Arumugam
2021 年 9 月 8 日
I am assuming you are solving a PDE in 1 dimension. You can check out MATLAB's PDE solver which returns the solution as a 3-D array sol, where sol(i,j,k) contains the kth component of the solution evaluated at t(i) and x(j).
You can read more about solving one-dimensional PDE's in MATLAB here :
In case your problem is of a higher dimension (such as 2-D or 3-D), I would suggest you to check out the Partial Differential Equation Toolbox.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Eigenvalue Problems についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!