필터 지우기
필터 지우기

Solve differential equation from Matlab

조회 수: 5 (최근 30일)
Sabella Huang
Sabella Huang 2022년 5월 27일
댓글: Sabella Huang 2022년 5월 29일
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
Sabella Huang
Sabella Huang 2022년 5월 27일
Hello, thx for your suggestions. I want to solve this just symbolically
John D'Errico
John D'Errico 2022년 5월 27일
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.

댓글을 달려면 로그인하십시오.

채택된 답변

John D'Errico
John D'Errico 2022년 5월 27일
편집: John D'Errico 2022년 5월 27일
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))
ans = 
Where W0 is the Lambert W function. Actually, the zero'th branch thereof, so lambertw(0,u).
help lambertw
LAMBERTW Lambert's W function. W = LAMBERTW(Z) solves W*exp(W) = Z. W = LAMBERTW(K,Z) is the K-th branch of this multi-valued function. References: [1] Robert M. Corless, G. H. Gonnet, D. E. G. Hare, D. J. Jeffrey, and D. E. Knuth, "On the Lambert W Function", Advances in Computational Mathematics, volume 5, 1996, pp. 329-359. [2] Corless, Jeffrey, Knuth, "A Sequence of Series for The Lambert W Function", ISSAC '97 Documentation for lambertw doc lambertw Other functions named lambertw sym/lambertw
  댓글 수: 2
Walter Roberson
Walter Roberson 2022년 5월 27일
note that is two different solutions
Sabella Huang
Sabella Huang 2022년 5월 29일
ok this work... thx

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Bjorn Gustavsson
Bjorn Gustavsson 2022년 5월 27일
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

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by