How can I get the analytical solution for this problem?
古いコメントを表示
I'm new to MATLAB, and was asked to get the analytical soltuion for the following function:
, however, I'm having a really hard time.
, however, I'm having a really hard time. My code was as follows, and I kept recieving an error when I tried to plot:
syms y(x);
ode = diff(y,x) == 2-sqrt(2*x-y+3);
cond = y(0) == 100;
ySol(x) = dsolve(ode,cond);
x = 0:1:100;
plot (x,ySol(x))
In all honestly, I'm not sure if this is the correct method to solving for an analytical soltuion. I would really appreciate any help, and if possible, any guidance on what other resources can help me become more proficient with MATLAB.
採用された回答
その他の回答 (1 件)
madhan ravi
2020 年 6 月 14 日
編集済み: madhan ravi
2020 年 6 月 14 日
1 投票
It is correct approach. I suggest you to do MATLAB Onramp course and watch Cleve Moler's videos about odes.
P.S: MATLAB is not able to find the analytical solution.
5 件のコメント
Danny Allen
2020 年 6 月 14 日
madhan ravi
2020 年 6 月 14 日
See the link in my answer.
Danny Allen
2020 年 6 月 14 日
Walter Roberson
2020 年 6 月 14 日
R2020a does find an analytic solution. two analytic solutions.
madhan ravi
2020 年 6 月 14 日
Interesting in 2018b I didn't.
カテゴリ
ヘルプ センター および File Exchange で Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!