Using ode45 application to solve a problem involving salt concentration levels.
古いコメントを表示
I am working on a problem in MATLAB in which I need to determine specific values of time and flow rate from the following DE problem.

I have a function coded for the given dQ/dt equation:
function saltrate=salt_level(t,Q);
saltrate=r/4-(r*Q)/100;
end
I am lost though as to how to apply the function to find the specific values the problem is asking for. Any help would be most appreciated!
Thanks in advance, Ryan
2 件のコメント
The ode45 documentation is pretty helpful. https://www.mathworks.com/help/matlab/ref/ode45.html
tspan = [0 5];
Q0 = 0;
[t,Q] = ode45(@salt_level, tspan, Q0);
plot(t,Q);
You are just going to use this same code (I modified the variables) except set your time span and initial conditions appropriately.
Just make sure you define all constants like r and Q_l in the function salt_level. Also, I think your differential equation is wrong. It just gives a line.
Ryan Kerby
2017 年 6 月 27 日
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!