-1

so i want to solve these equation

FullSimplify[DSolve[{iL''[t] + iL[t]/(C*L) == Vc[t]/(C*L*R), 
C*Vc''[t] + Vc'[t]/R + Vc[t]/L == Vin/L}, {iL[t], Vc[t]},t]
{{C, L, R} \[Element] Reals && C >= 0 && L >= 0 && R >= 0}] 

symbolically and i want to assing R,L and C as a positive real integer but the solution always comes with a imaginer part is there any other way do it using dsolve

branyc
  • 1

1 Answers1

0

Assuming a variable is greater than zero implies the variable is also Real. Integer will not help you in this problem.

If R, L and C are greater than zero and less than infinity then multiplying both sides to eliminate denominators will greatly speed up and simplify almost any calculation in Mathematica.

If you had some simple initial conditions it would be even simpler and perhaps faster.

This gets rid of the imaginary parts in Vc and almost all the imaginary parts in iL

Simplify[ExpToTrig[DSolve[{
  iL''[t]*C*L*R + iL[t]*R == Vc[t], 
  Vc''[t]*C*L*R + Vc'[t]*L + Vc[t]*R == Vin*R},
  {iL[t], Vc[t]}, t]],
L > 0 && C > 0 && R > 0]

and it is fairly fast.

FullSimplify is much slower, but if you wait for it then the result is

{{iL[t] -> (E^(-(t/(2 C R))) (L Sqrt[L - 4 C R^2] (C[3] + C R C[4])
 Cosh[(Sqrt[1 - (4 C R^2)/L] t)/(2 C R)] + E^(t/(2 C R)) Sqrt[L - 4 C R^2]
 (L Vin - L (-R C[1] + C[3] + C R C[4]) Cos[t/Sqrt[C L]] + Sqrt[C L] R
 (L C[2] + C[3]) Sin[t/Sqrt[C L]]) + Sqrt[L] ((L - 2 C R^2) C[3] + C L R C[4])
 Sinh[(Sqrt[1 - (4 C R^2)/L] t)/(2 C R)]))/(L R Sqrt[L - 4 C R^2]), 
Vc[t] -> ((L - 4 C R^2) Vin + E^(-(t/(2 C R))) ((L - 4 C R^2) C[3]
 Cosh[(Sqrt[1 - (4 C R^2)/L] t)/(2 C R)] + Sqrt[L (L - 4 C R^2)]
 (C[3] + 2 C R C[4]) Sinh[(Sqrt[1 - (4 C R^2)/L] t)/(2 C R)]))/(L - 4 C R^2)}}

Depending on whether or not L is greater than or equal to 4 C R^2 there are more potential complex values in that result which will then have to be further simplified to get a Real result, one way or the other.

Bill
  • 3,664
  • 1
  • 12
  • 9