solving differential equation in Matlab

hi! I would need some help on how to code the following equation in Matlab
when g and T vary with z.
thanks for any input!

回答 (1 件)

Ameer Hamza
Ameer Hamza 2020 年 4 月 15 日
編集済み: Ameer Hamza 2020 年 4 月 15 日

0 投票

Try this. This assumes g(z) = cos(z) as an example. Use your own function.
g = @(z) cos(z); % example function of z
N = 1; % example value
dTdz = @(z,T) N.^2*T./g(z);
ic = 1; % initial condition T(0) = 1
[z, T] = ode45(dTdz, [0 1], ic);
plot(z,T)

カテゴリ

ヘルプ センター および File ExchangeMathematics についてさらに検索

質問済み:

2020 年 4 月 15 日

編集済み:

2020 年 4 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by