other variable inside odesolver
조회 수: 1 (최근 30일)
이전 댓글 표시
i have these set of equation
k = (c(1)+c(3))/2
value = [c(2); -k*(c(2)-w1)^2; c(4); (-k*(c(2)-w1)*(c(4)-w2))-g; c(6); -k*(c(2)-w1)*(c(6)-w3)];
i am solving this equation using ode45
[t,c] = ode45('wind',tspan,c0,w1,w2,w3); at the end of solution it gives value of t and c. but value of k is also changing with c(1)& c(3) at each step .i want the matrix of k also. how to get the matrix of k
thanks pawan kumar
댓글 수: 0
채택된 답변
Jan
2011년 11월 8일
What about using "k = (c(:, 1)+c(:, 3))/2" to calculate the value of k afterwards?
댓글 수: 2
Walter Roberson
2011년 11월 8일
Yes, but the possibilities to do it in the ode solver add extra steps and increase the time and programming bother _far_ more than using Jan's simple computation once after ode45() has returned.
추가 답변 (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!