Question: dsolve dirac and piecewise

Hi.

1- I want to solve the following equation:
eq:=diff(theta(t),t)=-(A[1]*Dirac(t-T[1])+A[2]*Dirac(t-T[2]));

with the boundary conditions:

bcon := theta(0)=-v[1],theta(1)=v[3]:

but the code

dsolve({eq,bcon},theta(t)) assuming T[1]<T[2];
and also

dsolve({eq,bcon},theta(t), method=laplace) assuming T[1]<T[2];

do not work. 

The solution must be:

theta(t)=piecewise(0 <= t and t < T[1], -v[1], T[1] < t and t < T[2], 0, T[2] < t and t <= 1, v[3]);

2-Furthemore, solving the ode:

restart;
eq2 := diff(phi(t),t)=piecewise(0 <= t and t < T[1], -v[1], T[1] < t and t < T[2], 0, T[2] < t and t <= 1, v[3]);

with the similar bc:

bcon2 := phi(0)=-v[2],phi(1)=v[4];

is another problem which I am trying to solve it. but again the code

dsolve({eq2,bcon2},phi(t)) assuming T[1]<T[2];

does not work!! while the solution must be:

phi(t)=piecewise(0 <= t and t < T[1], v[1]*(t-T[1]), T[1] < t and t < T[2], 0, T[2] < t and t <= 1, v[3]*(t-T[2]));

Could you please help me to solve these two problems??

I really appreciate any help you can provide.

 

Please Wait...