Code for solving first-order ode with symbolic initial condition
显示 更早的评论
I am very new to MATLAB, and writing MATLAB code for solving the problem #20 of Section 1.1 in Kreyszig (2011).
Problem #20 is as follows:
Exponentialdecay. Subsonicflight. The efficiency of the engines of subsonic airplanes depends on air pressure and is usually maximum near 35,000 ft. Find the air pressure
at this height. Physical information. The rate of change
is proportional to the pressure. At 18,000 ft it is half its value
at sea level.
I wrote the following code for solving the problem, but get a wrong answer.
clear
syms y(t) k
ode = diff(y) == k*y
cond = y(18000) == y(0)/2
ySol(t) = dsolve(ode, cond)
I got a trivial solution.
How to get a non-trivial solution of this problem?
If I solve the problem with pencil and eraser, the non-trivial solution is
.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Equation Solving 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

