Solving first order differential equation

2 Ansichten (letzte 30 Tage)
Rahal Rodrigo
Rahal Rodrigo am 12 Apr. 2021
Bearbeitet: Abhishek Gupta am 15 Apr. 2021
How is it possible to solve the following differential eqiuation using syms and dsolve? I'm quite confused on how to solve dx/dx on matlab. The condition is x(0)=4. Any help would be greatly appreciated.
  2 Kommentare
James Tursa
James Tursa am 12 Apr. 2021
Bearbeitet: James Tursa am 12 Apr. 2021
Double check your assignment. That is probably supposed to be dx/dt, not dx/dx.
Rahal Rodrigo
Rahal Rodrigo am 12 Apr. 2021
Thanks for your reply and your suggestion. The assignment says dx/dx (only 1 task has it like so), so I'll assume its a typo and take it as dx/dt. Thanks again.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Abhishek Gupta
Abhishek Gupta am 15 Apr. 2021
Bearbeitet: Abhishek Gupta am 15 Apr. 2021
Hi,
You can solve the given ODE as follows: -
syms x(t);
ode = 2*diff(x,t) + 7*x == t;
cond = x(0) == 4;
xSol(t) = dsolve(ode,cond);
For more details, check out the following documentation link: -

Kategorien

Mehr zu Particle & Nuclear Physics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by