Is there a way to set zero rise and fall time in LTspice?

Thread Starter

anhnha

Joined Apr 19, 2012
881
Is there a way to set zero rise and fall time in LTspice? I tried that but LTspice automatically uses a default value for <trise> and <tfall> if these parameters are set to zero.
 

Papabravo

Joined Feb 24, 2006
14,233
It might be that the simulation blows up with derivatives of infinite magnitude. You are actually doing numerical integration of a system of linearized differential equations. If you could set those times to zero you would get meaningless results. Take your pick.
 

crutschow

Joined Mar 14, 2008
25,259
I tried one that is smaller than that above ( 1f (femto) second) but it seems that it still uses the default values.
You must have put the values in wrong.
As shown below, with the pulse rise and fall times set to 1fs in LTspice, 1fs is displayed in the transient plot.

upload_2016-3-9_9-10-56.png
 

WBahn

Joined Mar 31, 2012
26,059
You've got totally different time scales -- 1 fs rise and fall times but a 20 second period?

You've also got eight parameters to the PULSE model. How does that model handle eight parameters?

What happens if you simply use the settings that crutschow used?
 

Thread Starter

anhnha

Joined Apr 19, 2012
881
You've got totally different time scales -- 1 fs rise and fall times but a 20 second period?
20 is the number of cycles which is plotted.
Period is 1 second.
You've also got eight parameters to the PULSE model. How does that model handle eight parameters?
Here is the model parameters:
upload_2016-3-10_1-28-38.png

What happens if you simply use the settings that crutschow used?
With this, I got the same result. However, with the same setting but change the stop time (run time) fro 4fs to 1m second, the result is totally different. Maybe my LTspice is having some problem.

upload_2016-3-10_1-39-44.png
 

Attachments

crutschow

Joined Mar 14, 2008
25,259
The problem is your time scale. LTspice assumes that if you are doing seconds of time you don't need fs resolution (why would you?).
If you want to do seconds of simulation and display a 1fs rise-time then you need to set the maximum time-step in the transient setup to 1fs. But that will require many minutes (or even hours) of simulation time since for each second of simulation the computer now has to do at least a trillion calculations and each calculation likely requires many CPU cycles. :eek:
 
Last edited:

WBahn

Joined Mar 31, 2012
26,059
20 is the number of cycles which is plotted.
Period is 1 second.

Here is the model parameters:
View attachment 102197


With this, I got the same result. However, with the same setting but change the stop time (run time) fro 4fs to 1m second, the result is totally different. Maybe my LTspice is having some problem.

View attachment 102200
You still aren't running the same settings that crutschow used. Look at your .tran statement. You are telling the simulator to run the sim for 5 milliseconds. That's 5,000,000,000,000 femtoseconds!
 

Papabravo

Joined Feb 24, 2006
14,233
Yes, I am aware of this problem. But for some application, I want to use the option.
I can't imagine why you would want to do it and I suspect it won't let you do that for a very good reason. If you don't believe me, then why don't you shoot Mike Englehardt an email and ask him. I'm sure he'd be glad to educate you on the matter
 

Thread Starter

anhnha

Joined Apr 19, 2012
881
You still aren't running the same settings that crutschow used. Look at your .tran statement. You are telling the simulator to run the sim for 5 milliseconds. That's 5,000,000,000,000 femtoseconds!
As I said above, with setting exactly as crutschow, I got the same result. However, I was wondering why run time (4fs, 5m) affects the rise or fall time. That seems strange to me.
 

WBahn

Joined Mar 31, 2012
26,059
I'm pretty sure that the actual simulator is not overriding you values with "defaults", but rather the schematic capture tool. You should be able to simulate a hand written circuit file (or a hand tweaked one) in which you force the values to zero. This may or may not simulate successfully as it may cause convergence problems.
 
Top