## 5 Reputation

4 years, 216 days

## @kippendorf I dont knowwhy that did...

@kippendorf I dont knowwhy that didnt come

the new piecewise fu nction is

## @Carl Love  No, the new g piecewise...

No, the new g piecewise function would be like this

g(t) that is.

ill need a solution to y(t) with the new g, and g(t) on the same axes.

## @Carl Love Thanks very much. I did ...

@Carl Love Thanks very much. I did get that plot but your method looks better. How would I plot both g and the solution on the same axes? I m a little confused

## @tomleslie I am now trying to solve...

@tomleslie I am now trying to solve the solution when g(t) is a piecewise function. How would I do it using maple

I also need to plot g(t) and the solution on the same axes as well

## @tomleslie  v1 := int(cos(tau)*g(ta...

v1 := int(cos(tau)*g(tau), tau = t0 .. t);
v2 := int(-sin(tau)*g(tau), tau = t0 .. t); y2 := cos(t); y1 := sin(t);
soln := C1*y1+C2*y2+v1*y1+v2*y2;
soln := combine(soln);
Eqs := eval(soln, t = t0) = 0, eval(diff(soln, t), t = t0);
solve({Eqs}, {C1, C2});
soln := eval(soln, %);

soln := eval(soln, t0 = 0);
solnb := unapply(eval(soln, g(tau) = 3*cos(omega*tau)), omega);
plot({solnb(.7), solnb(.8), solnb(.9)}, t = 0 .. 40*Pi);

## @tomleslie i found my problem, i sw...

@tomleslie i found my problem, i swapped y2 and y1 and it worked

## @tomleslie    It is   sol...

It is

solnb := unapply(eval(soln, g(tau) = 3*cos(omega*tau)), omega);

## @tomleslie @Carl Love   Thanks...

@tomleslie @Carl Love

Thanks so much guys

I think i found my problem. I didnt initialise y1=cos(t) and y2=cos(t)

but now I have another problem with the plotting. Could you take a look  ?

v1 := int(cos(tau)*g(tau), tau = t0 .. t);
v2 := int(-sin(tau)*g(tau), tau = t0 .. t); y1 := cos(t); y2 := sin(t);
soln := C1*y1+C2*y2+v1*y1+v2*y2;
soln := combine(soln);
Eqs := eval(soln, t = t0) = 0, eval(diff(soln, t), t = t0);
solve({Eqs}, {C1, C2});
soln := eval(soln, %);
soln := eval(soln, t0 = 0);
solnb := unapply(eval(soln, g(tau) = 3*cos(omega*tau)), omega);
plot({solnb(.7), solnb(.8), solnb(.9)}, t = 0 .. 40*Pi);

 Page 1 of 1
﻿