Combining solve and dsolve to solve equation systems with differential and algebraic equations <p>I am trying to solve equation systems, which contain algebraic as well as differential equations. To do this symbolically I need to combine dsolve and solve (do I?).</p> <p>Consider the following example: We have three base equations</p> <pre><code>a == b + c; % algebraic equation diff(b,1) == 1/C1*y(t); % differential equation 1 diff(c,1) == 1/C2*y(t); % differential equation 2 </code></pre> <p>Solving both differential equations, eliminating int(y,0..t) and then solving for c=f(C1,C2,a) yields</p> <pre><code>C1*b == C2*c or C1*(a-c) == C2*c c = C1/(C1+C2) * a </code></pre> <p>How can I convince Matlab to give me that result? Here is what I tried:</p> <pre><code>syms a b c y C1 C2; Eq1 = a == b + c; % algebraic equation dEq1 = 'Db == 1/C1*y(t)'; % differential equation 1 dEq2 = 'Dc == 1/C2*y(t)'; % differential equation 2 [sol_dEq1, sol_dEq2]=dsolve(dEq1,dEq2,'b(0)==0','c(0)==0'); % this works, but no inclusion of algebraic equation %[sol_dEq1, sol_dEq2]=dsolve(dEq1,dEq2,Eq1,'c'); % does not work %solve(Eq1,dEq1,dEq2,'c') % does not work %solve(Eq1,sol_dEq_C1,sol_dEq_C2,'c') % does not work </code></pre> <p>No combination of solve and/or dsolve with the equations or their solutions I tried gives me a useful result. Any ideas?</p>