how to solve this differential equation system symbolically?
Show older comments
Accepted Answer
More Answers (1)
Walter Roberson
on 1 May 2022
0 votes
Create the symbols and the two equations. dsolve() the pair of equations without boundary conditions, getting out a struct with a definition for x and y. Take the y and substitute t = 0 to get y(0) and equate that to the known value. Take the y and differentiate and substitute t = 0 to get y'(0) and equate that to the known value. You now have a pair of simultaneous equations relating the constants of the differential equations.
6 Comments
John D'Errico
on 1 May 2022
Edited: John D'Errico
on 1 May 2022
You cannot solve the problem if f(t) is unknown. Or perhaps I should say, if at least one of f(t) or x(t) are not known. In fact, dsolve will tell you the problem is insufficiently determined.
You cannot solve the problem if f(t) is unknown
Oh?
syms y(t) x(t) f(t)
dy = diff(y);
E1 = x + dy == f;
E2 = diff(x) + y == diff(f);
sol = dsolve(E1, E2)
you can now proceed as I described to find the values of C1 and C2, leading you to x(t) and y(t) expressions in terms of exp()'s and f(t)
Walter Roberson
on 2 May 2022
dsolve() looks for derivatives. Any function that only occurs "plain", with no derivative of the function, is treated sort of like a constant
Walter Roberson
on 3 May 2022
Good question. I wonder if it used symvar or equivalent and choose the first two. I seem to recall that solve() chooses variables starting from x y z (or X Y Z) first
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!