Author Topic: Moddeling Load Dump Pulse 5a in LTSpice  (Read 17580 times)

0 Members and 1 Guest are viewing this topic.

Offline Jay_Diddy_B

  • Super Contributor
  • ***
  • Posts: 2733
  • Country: ca
Re: Moddeling Load Dump Pulse 5a in LTSpice
« Reply #25 on: October 01, 2022, 08:35:02 am »
Hi,

The .func mod(x,y) {((x/y)-int(x/y))*y}

This is a user-defined function.

The function name is 'mod'

The input parameters are x and y.

{((x/y)-int(x/y))*y}

This mathematical describes the function

in this case it describes the modulo function, it returns the remainder after division.

mod(11,4) = 3

The SPICE variable time is the current simulation time.

so

mod(time,60) would generate a ramp that goes from 0-59.99999




Voltage source

The voltage source is the first time in the expression. In this case the voltage source is 28.



Jay_Diddy_B

« Last Edit: October 01, 2022, 08:43:29 am by Jay_Diddy_B »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf