I've just started learning matlab and I am trying to solve this differential equation
1 回表示 (過去 30 日間)
古いコメントを表示
I am new to MATLAB and I was trying to solve this differential equation and got the end result
syms y(x)
dy=diff(y);
ode= diff(y,x,2)+3*y==0;
cond1= y(0)==1;
cond2= dy(0)==0;
ysol(x)= dsolve(ode,cond1,cond2)
ysol(x) =
cos(3^(1/2)*x)
now if I want to solve y(1)=? in terms of y(1)=0.99 not cos(3^(1/2)) with 1 deg input argument. how should I do that? Thank you!
0 件のコメント
採用された回答
その他の回答 (1 件)
Dimitris Kalogiros
2018 年 8 月 20 日
you can access the value of y(1) by writting .... y(1)
syms y(x)
%dy=diff(y)
ode= diff(y,x,2)+3*y==0
cond1= y(0)==1
cond2= dy(0)==0
ysol(x)= dsolve(ode,cond1,cond2)
%--------------------------------
% just displaying value of y(1)
disp( ysol(1) )
参考
カテゴリ
Help Center および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!