I want help solving differential equations

This question
my sol
syms x(t);
eqn = exp(x).*(diff(x,t)+1)==1;x(0)=1;
sol = dsolve(eqn);
problem
Error occurred during use: Indexing
Invalid indexing or function definition. Indexing is
You must follow MATLAB's indexing approach. Function argument is symbol side
Must be a number and the body of the function must be a symbol expression.
Error Occurred: Untitled (Line 2)
eqn = exp(x).*(diff(x,t)+1)==1;x(0)=1;

 採用された回答

Sam Chak
Sam Chak 2022 年 12 月 1 日

1 投票

Follow the example in the dsolve() documentation
syms x(t)
eqn = diff(x,t) == 1/exp(x) - 1; % rearrange the equation
cond = x(0) == 1;
xSol(t) = dsolve(eqn, cond)
xSol(t) = 

1 件のコメント

kubel
kubel 2022 年 12 月 1 日
Thank you very much

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

製品

リリース

R2022a

質問済み:

2022 年 12 月 1 日

コメント済み:

2022 年 12 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by