Needing help using ode15s to solve an equation.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Ryan Marsh
el 6 de Mayo de 2022
Comentada: Star Strider
el 6 de Mayo de 2022
Hi there just needing some help using ode15s. I've never used this built-in function, but i need to use it to solve the equation below using ode15s:

I have the choice of what values to give the parameters, but i just dont know how to start coding. Has anyone got any tips to help me get started and complete this. Any suggestions or help is appreciated.
0 comentarios
Respuesta aceptada
Star Strider
el 6 de Mayo de 2022
I find it easiest to let the Symbolic Math Toolbox do all the heavy lifting —
syms C(t) C_in C_0 Q_in Q_out t V_0 Y
DE = (V_0 + (Q_in - Q_out)*t) * diff(C) + Q_in * C == Q_in * C_in
DE = isolate(DE, diff(C))
VF = odeToVectorField(DE)
DEfcn = matlabFunction(VF, 'Vars',{t,Y,C_in,Q_in,Q_out,V_0}) % Use This Result With The Numeric ODE Solvers
C(t) = dsolve(DE, C(0) == C_0) % Analytic Solution
You can use matlabFunction with the right-hand-side of ‘C(t)’ to check the result of the numerical integration. Remember to include ‘C_0’ in the 'Vars' list.
.
6 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Ordinary Differential Equations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


