How to solve an ODE with three equation that are dependent on each other
    조회 수: 7 (최근 30일)
  
       이전 댓글 표시
    
I have these equations that are supposed to tell me how the concentration of C changes over time. I am trying to use ODE 45 but I keep getting error
v1=0.3;
k2 = 0.3; %constant
C = v1-dpdt; %ODE for network
dpdt = k2*C; %Rate of equation
for tspan = 0:100
    dpdt = @(PEP,t) (k2*C*t)
    [PEP, t] = ode45(dpdt,tspan,0)
end
댓글 수: 1
답변 (1개)
  Star Strider
      
      
 2022년 10월 19일
        Some of this is difficult to interpret.  
My best guess at a solution — 
v1=0.3;
k2 = 0.3; %constant
C = v1;
% C = v1-dpdt; %ODE for network
% dpdt = k2*C; %Rate of equation
tspan = 0:100;
dpdt = @(PEP,t) (k2*C*t);
[t,PEP] = ode45(dpdt,tspan,k2);
figure
plot(t,PEP)
grid
xlabel('t')
ylabel('PEP')
Make appropriate changes in case my guess is in error.  
.
댓글 수: 0
참고 항목
카테고리
				Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
