Hi, I am applying a transfer function on a simple sine wave.
The result is ok when I run it in a model (transfer_no_sub).
But when I put the exact same thing inside a subsystem, the response diverges (transfer_sub).
I can’t figure out why.
Transfer_no_sub.plecs (13.3 KB)
Transfer_sub.plecs (22.3 KB)
[Edit]
One significant difference between the two is the step size: 1e-06 for _no_sub
and 1e-04 for _sub
. If I set _sub
at 1e-06, I get a convergent signal. But I can’t afford this speed on my C2000.
Another oddity (to my eyes): when I set _no_sub
at max step size = 1e-04, I get the same (good) result
[Edit2]
Further investigations make me think that the issue has to do with the precision of the float calculations. Is there any way I can make Plecs generate code with long double
type ?