필터 지우기
필터 지우기

applying conditions in odesolver

조회 수: 1 (최근 30일)
pawan kumar
pawan kumar 2011년 9월 12일
equation of motion of projectile with drag is dvx/dt = -k*v*vx ; dvy/dt = -k*v*vy - g where k = drag coefficient and g = gravitational acceleration i solved this equation with ode solver (ode45) by giving a constant value of k and g. but in real the value of k and g vary with altitude i have the matrix for 'k' for different height interval .and the formula for variation of g with altitude. how to apply this conditional input to odesolver(ode45). so that odesolver(ode45) take different value of k and g at respective height range during steps .
please reply thanks pawan

채택된 답변

Jan
Jan 2011년 9월 12일
Simply insert the formula for g in the ODE equation. For k I'd suggest an interpolation, if the values are read from a table: ODE45 expectes a smooth ODE function, but a naive lookup-table leads to discontinuities.

추가 답변 (0개)

카테고리

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