Need some help with solving diff.equ with matlab/simulink

  • Thread starter Thread starter rularn
  • Start date Start date
AI Thread Summary
The discussion revolves around solving the differential equation x'[t] + x[t] = a + Sin[b*t] using MATLAB/Simulink, with specific values for a and b. The user has derived the solution x(t) and the transfer function G(s) from Laplace transforms but is struggling with the initial value condition and the implementation in MATLAB. They express confusion about the initial value representation and the correct use of the transfer function. Ultimately, the user indicates that they have resolved their issue. The conversation highlights common challenges in applying MATLAB/Simulink to differential equations.
rularn
Messages
8
Reaction score
0
Hi!

Homework Statement


I have this x'[t] + x[t] = a + Sin[b*t] diff.equ that I would like to solve with matlab/simulink.
Let set a=1, b=1 and
x(0)=2

Homework Equations


I know that x(t) = 1/2 e^-t (-cos(t) e^t+sin(t) e^t+2 e^t+3) and what it look like (see pic). I aslo got the transfer equ G(s) from Laplace and it should be:

G(s) = (a/s+b/(b^2+s^2))/(s+1),


The Attempt at a Solution



The only thing I don't get right is the initial value as you can see at the pic. It also shows what it should look like. What do I do wrong?

It should be easier to use the transfer equ G(s), but I don't get that right either. Any suggestions?

http://img205.imageshack.us/img205/821/reglerth3.jpg


Thank you!
 
Last edited by a moderator:
Physics news on Phys.org
Ah don't worry guys, I fixed it
 

Similar threads

Back
Top