05-28-2012 06:17 AM
Multisim 10.
I don't seem to be able to output any expression in Transient analysis that involves a deriv and something else.
e.g. If the circuit is just a simple ac source with a resistor, where the ac source voltage is V(1), then the expression deriv(V(1)) works fine - it shows what you'd expect.
But if the expression added to the output is 2*deriv(V(1)) then I get the simulation error window, with a whole set of errors:
"Internal error : cx_deriv : bad scale"
I have tried a few different voltage source patterns, and also tried addition instead of multiplication etc, but always get the same error.
Putting the deriv in parentheses doesn't work either - 2*(deriv(V(1)) - but maybe I am getting the formula syntax wrong somehow - though it's not obvious how I can be getting something so simple so wrong.
I'm pretty sure I'm doing something wrong, as there are posts in this forum (about other irrelevant problems) that have expressions that involving derivs.
Googling reveals some C source code for the original Berkely Spice engine that shows this error is returned when the call to the deriv function has improperly set parameters.
I can output expressions including derivs in a different simulator that I also have, so I don't think it's an underlying Spice limitation.
Obviously what I want to do is a bit more purposeful than just multiplying a derivative by 2 - I actually want to multiply it by a resistance and capacitance value in my actual circuit - but this extra complexity is irrelevant to my problem, I think.
Any clues?
05-28-2012 08:50 AM
Hi,
There seems to be an issue with doing this in Multisim 10. The complete expression 2*deriv(V(1)) works fine in the newer versions but it seems that in Multisim 10, you will need to calculate the derivate by itself, so deriv(V(1)) and then go to Simulate -> Postprocessor. Setup the post processor screens as shown in attached screen shots.
You can do other calculations as well in the post processor based on your needs.
Hope this helps.
05-29-2012 03:32 PM
Well, nearly. I will be able to get by with it.
Thank you for confirming there is a problem with derivs in Multisim 10 - that certainly saves me a lot of wasted time trying to get them to work.
Yes, the postprocessor does successfully multiply derivs by 2, and do other calculations on them.
But the postprocessor graphs derivativess differently to the simulator-proper, doesn't it? This seems to show most clearly with square waves (the one I am using actually has rise/fall times of 5ns with a 2ms period, so it's pretty square).
- The output from the simulation successfully shows the sharp increase in the derivative as coinciding with the edge of the square wave (though you can't multiply that by anything, as you have confirmed)
- The postprocessor shows the deriv as starting to increase before the voltage itself changes. This appears to be associated with the max time step that I set in the transient analysis - the smaller that is, the closer the deriv time is to the underlying voltage time. I guess the simulator-proper graphs many more points than it stores, or perhaps it graphs points at the minimum time step plus other points as well, whereas the postprocessor can only join the dots on the number of points defined by the maximum time step.
If you squint and don't zoom too closely it looks close-ish - that seems to be the best that can be done with the software, I suppose.