cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Pulse function

mlernst
6-Contributor

Pulse function

I need a "forcing function" that will be continuous (not piece wise). It needs to be a rectangular function with amplitude "A", Period "P", and duty cycle "D" (40%) that is a function of y(t) for some time period "t".

 

Can anyone help me out with this? 

 

Thanks,

Mike

 

38 REPLIES 38
mlernst
6-Contributor
(To:Werner_E)

I am stumped with the attached sheet. It tells me I have too many initial conditions. If I delete one then it tells me I have too few. I have the feeling that is not the real issue, but I do not know what is. I don't feel like the help files are much help on odesolve. Can someone help out on this one?

You sure messed up badly with the parenthesis - check them in the first and third equation!! The outer one in the third equation is unnecessary and they sure are quite wrong (and a closing one missing) in the first one.

After you correct this you have to add a fifth initial condition, something like v1(0)=???

Furthermore you have to switch the sides in your third equation as Mathcad prefers the derivatives at the LHS.

 

To speed up the calculation you should pre-calculate the first derivative of y(t), otherwise its calculated from anew for every iteration step. You may let the symbolic do the job by writing y1(t):=d/dt y(t) -> (symbolic evaluation) or you do the derivation yourself and define y1(t):= as the appropriate sum. Then use y1(t) instead of d/dt y(t).

But in your case y(t) should be a rectangular signal, so the derivation is zero anyway! (Apart from some single Dirac's. So you may replace d/dty(t) by zero.

Is there any reason why you are using that time consuming and inexact Fourier series instead of the pulse function which Luc provided? In your first post you showed a function where the duty cycle starts at t=0 and now you use another one where it starts at t=0.025. It would be easy to change Lucs function to do the same!

 

I did some changes (see picture below) but the first equation sure should read differently as with the function I came up with we get very high values at the end of the interval (10^13) which probably is not as expected.

 

BTW, your range definitions for t still are wrong!!

The first one (note the red dots) because the dots (..) are interpreted as unknown variable and the second one because you still use the unit s.

B.png

 

-MFra-
21-Topaz II
(To:mlernst)

Hi,

elliptic pulse train.jpg

mlernst
6-Contributor
(To:-MFra-)

Thank you for this interesting idea. However, I need it to be rectangular (as proposed by Luc), not elliptical.

-MFra-
21-Topaz II
(To:mlernst)

Ok!

that's better?

Square pulse train.jpg

mlernst
6-Contributor
(To:-MFra-)

That is definitely better. Now my next question - how do I turn that into an equation of the form y(t)? 

 

I have a lot of other equations on down the Mathcad program that are using y(t) in their evaluation. This program is using this pulse as a "description" of a road surface that is then being used to evaluate the suspension on a vehicle that is driving over it.

-MFra-
21-Topaz II
(To:mlernst)

it is very simple:

Square pulse train1.jpg

mlernst
6-Contributor
(To:-MFra-)

Could you possibly send me this as a Mathcad file? I must be entering something incorrectly. It is not working for me.

 

Thanks very much,

Mike

-MFra-
21-Topaz II
(To:mlernst)

I've attached the file.

Top Tags