Using ode45 application to solve a problem involving salt concentration levels.
Mostrar comentarios más antiguos
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 comentarios
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
el 27 de Jun. de 2017
Respuestas (0)
Categorías
Más información sobre Ordinary Differential Equations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!