3
$\begingroup$

I have been looking everywhere for help on this issue and cannot find a solution that works. Here is the assignment.

Here is the homework assignment

I have figured out how to find the Laplace transform, but I do not know how to graph it. Here is my code:

de1 = 25 x''[t] + 10 x'[t] + 226 x[t] == 901*Cos[3 t];
inits = {x[0] -> 0, x'[0] -> 0};
DE = LaplaceTransform[de1, t, s]
X = Solve[DE, LaplaceTransform[x[t], t, s]]
X = X // Last // Last // Last
X = X /. inits
f1 = InverseLaplaceTransform[X, s, t] // Expand

And here is the resulting inverse Laplace transform, or the solution (I think):

(-(1/2) - (451 I)/30) E^((-(1/5) - 3 I) t) - 
  (1/2 - (451 I)/30) E^((-(1/5) + 3 I) t) + Cos[3 t] + 30 Sin[3 t]

But how do I graph it?

$\endgroup$
7
  • 2
    $\begingroup$ Your link shows that this is a homework assignment. This is not a site for us to do your homework assignments. (Vote to close.) $\endgroup$ Mar 21, 2019 at 18:27
  • $\begingroup$ what's you range for plotting on both axes !? $\endgroup$
    – nufaie
    Mar 21, 2019 at 18:48
  • $\begingroup$ If you can't figure out your homework you can always ask the stack exchange, vote to close :( $\endgroup$
    – olliepower
    Mar 21, 2019 at 18:50
  • $\begingroup$ It's not that I don't know how to do my homework, I just needed help with the Mathematica/coding portion of it. $\endgroup$ Mar 21, 2019 at 19:19
  • 3
    $\begingroup$ @StephanieGreen For what it's worth, I agree: yours was not a "gimme da codez" kind of question. You included your code attempts and showed effort. I hope that this community's initial response did not alienate you, and I am looking forward to further contributions from you! $\endgroup$
    – MarcoB
    Mar 21, 2019 at 20:55

1 Answer 1

8
$\begingroup$

Copying your exact code

de1 = 25*Derivative[2][x][t] + 10*Derivative[1][x][t] + 226*x[t] == 901*Cos[3*t]; 

inits = {x[0] -> 0, Derivative[1][x][0] -> 0}; 

DE = LaplaceTransform[de1, t, s]

X = Solve[DE, LaplaceTransform[x[t], t, s]]

X = Last[Last[Last[X]]]

X = X /. inits

f1 = Simplify[Expand[InverseLaplaceTransform[X, s, t]]]

Now it's easy to plot as range from 0

Plot[f1, {t, 0, 40}]

enter image description here

$\endgroup$
1
  • $\begingroup$ Awesome, thank you so much! $\endgroup$ Mar 21, 2019 at 19:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.