Keyboard Shortcuts
ctrl + shift + ? :
Показати всі комбінації клавіш
ctrl + g :
Не доступний для безкоштовних груп.
ctrl + shift + f :
Знайти
ctrl + / :
Сповіщення
esc to dismiss
Лайки
Пошук
MacOS directive .func does not work
I have circuit which uses: .func myf(nom,tol) (nom+nom*(gauss(tol/5))
and a resistor which has a value {myf(400,0.1)}
Besides these two I have a voltage source and I can simulate this circuit on a PC. However, on MacOS it holds simulation with: Missing model definition for MYF.
On both computers I am using the latest version of LTspice.
Is this a known bug? |
On 07/12/2024 06:33, RomanS. via
groups.io wrote:
I can't verify this as I have no Mac at my disposal, but you could try using the exact specified syntax for .FUNCtions: .func myf(nom,tol) {nom+nom*(gauss(tol/5)} (Note the curly braces.) It seems to make no difference on a PC, but it may be that the Mac version has stricter syntax checking. Are you using the Mac version of LTspice, or are you using the PC version under Wine (or equivalent) on the Mac? Saying "latest version" might be confusing, as there is now a beta version of LTspice available (24.1.x), whereas the current release version is 24.0.12. It's better to be specific about what version(s) you're using on each machine. If that doesn't reveal anything, perhaps you would consider uploading your file(s), so other people could check. We certainly have a few Mac users in this group. -- Regards, Tony |
On 07/12/2024 06:33, RomanS. via
groups.io wrote:
Another thing: since you have no time-varying dependency in your function, you could simply define your component values as .params, which are evaluated before analysis, thus avoiding the need for another .func, e.g.: R1 N001 0 {R1val} .param tol 0.1 .param Rnom 400 .param R1val Rnom*(1+gauss(tol/5)) -- Regards, Tony |
On Sat, Dec 7, 2024 at 02:23 AM, Tony Casey wrote:
It seems to make no difference on a PC, but it may be that the Mac version has stricter syntax checking. Are you using the Mac version of LTspice, or are you using the PC version under Wine (or equivalent) on the Mac? Saying "latest version" might be confusing, as there is now a beta version of LTspice available (24.1.x), whereas the current release version is 24.0.12. It's better to be specific about what version(s) you're using on each machine.I tested the .func directive on macOS LTspice 17.2.4, and it works as expected, using either parentheses or curly braces to enclose the function's expression. I stepped the simulation to verify it was producing different values for the resistance. I uploaded my schematic to mac_func_test.zip
HTH |
On 07/12/2024 17:56, Dennisc via
groups.io wrote:
Right answer! 🙂 I guess it's possible this is a transcription error since the OP says it runs on his PC. One of the reasons it's always best to upload exactly what one's using. -- Regards,
Tony |
Parentheses are a little tricky in SPICE, and by extension, LTspice.
In many cases, parentheses are effectively ignored in SPICE netlist syntax. Yet they are required in some cases. For kicks, I tried a few simulations using the OP's user-defined function, and various combinations of matched and mismatched parentheses, curly braces, etc. Some worked, others failed with the unknown "model" error. I did not see a clear-cut pattern so I concluded that trying to explain it might be an exercise in futility. It appeared that matching parentheses was not a strict requirement in every single case, but sometimes it did make a difference.
Andy
|
Had me at “nom-nom spice…”
From: LTspice@groups.io <LTspice@groups.io> On Behalf Of
Tony Casey
Sent: Saturday, December 07, 2024 9:34 AM To: LTspice@groups.io Subject: EXTERNAL: Re: [LTspice] MacOS directive .func does not work
On 07/12/2024 17:56, Dennisc via groups.io wrote:
Right answer!
🙂 Regards, |
Повідомлення
Більше
Додаткові параметри
Більше
to navigate to use esc to dismiss