Solve differential equation from Matlab
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Sabella Huang
am 27 Mai 2022
Kommentiert: Sabella Huang
am 29 Mai 2022
Hello guys,
I want to ask about, how to solve the differential equation in MATLAB for the equation:
dx/dt = (ka*C(xmax-x)-kd*x)/(1+ka*x)
thx
3 Kommentare
John D'Errico
am 27 Mai 2022
Are ka and kd constants, or is k separate from a and d, so there are three unknown constants. Is xmax known? Is it a value that x may not exceed? Is C a function? Or is C just a known constant?
When you are too vague, you make it impossible for people to help you.
Akzeptierte Antwort
John D'Errico
am 27 Mai 2022
Bearbeitet: John D'Errico
am 27 Mai 2022
Making various assumptions, we see the solution as:
syms ka kd C xmax
syms x(t)
dsolve(diff(x) == (ka*C*(xmax-x)-kd*x)/(1+ka*x))
Where W0 is the Lambert W function. Actually, the zero'th branch thereof, so lambertw(0,u).
help lambertw
2 Kommentare
Weitere Antworten (1)
Bjorn Gustavsson
am 27 Mai 2022
For a numerical integration of this ODE look at the help and documentation for ode45 and its siblings, also look at the examples and demos related to these ODE-solvers, you find these in odeexamples. That is perhaps the best way to get started (maybe it will not make you an expert in DE in general, but it will get you going.) You can also read the code of the different demos and adapt them to suit your problem.
For an analytical solution you might have success with dsolve from the symbolic toolbox if you have access to that.
HTH
0 Kommentare
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!