フィルターのクリア

other variable inside odesolver

1 回表示 (過去 30 日間)
pawan kumar
pawan kumar 2011 年 11 月 8 日
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

採用された回答

Jan
Jan 2011 年 11 月 8 日
What about using "k = (c(:, 1)+c(:, 3))/2" to calculate the value of k afterwards?
  2 件のコメント
pawan kumar
pawan kumar 2011 年 11 月 8 日
sir,this process will add extra step to program,and will increase time, is there not any method so that it can be evaluated directly from the ode solver.
Walter Roberson
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 ExchangeOrdinary Differential Equations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by