Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sinusoidal voltage source parameter #166

Open
ghost opened this issue Dec 18, 2022 · 3 comments
Open

Sinusoidal voltage source parameter #166

ghost opened this issue Dec 18, 2022 · 3 comments
Labels
bug UI User interface related stuff

Comments

@ghost
Copy link

ghost commented Dec 18, 2022

Hello,
I am pretty new to LiveSPICE (already accustomed to LT Spice and similar).
I was trying to model a circuit when I encountered a problem right at the start. By instantiating a voltage source, the default parameter for voltage is: "Sin[628,318530717959t] V" which I assume is in the form: Sin[Amplitude, omega * t] V".
So I replaced it by the needed values and it appears that by pressing enter, the order of the parameters changed to: "Sin[t
230,314] V".
When simulating, I get the following error: Exception: Unresolved name " 'Undefined variable '230,314'.'. ".

I am sure there is something trivial that I haven't seen. Could someone help me?

PS. If someone knows a method to import already existing LTSPice schematics, I would be very grateful.

Thanks in advance,
Théo

@dsharlet
Copy link
Owner

I think you are encountering a bug due to EU vs. US style decimals. The default is supposed to be Sin[100*2*Pi*t] V = Sin[628.318 t] V, but something is going wrong and interpreting it incorrectly.

However, I suspect that what you actually want is an "Input", which is a voltage source where the voltage is proportional to an audio input. The general voltage source with a sine wave input is mainly only useful for testing or experiments. I'll have to look and see what is going on with such inputs if that's what you were actually trying to do.

It would help if you can attach the .schx file that is causing problems to the bug, so I can see exactly what the voltage field ended up being set to.

@Federerer
Copy link
Collaborator

I've noticed that too. We should ensure that we are always saving files using NumberFormatInfo.InvariantInfo and accepting any number separator when parsing user input or file (this is a good practice for any kind of interface or API - be specific what you provide and be flexible what you accept).

@Federerer Federerer added bug UI User interface related stuff labels May 8, 2023
@standard-librarian
Copy link

Is there a way to know what are the valid expressions, i mean is there such a thing as Cos[628t], Pulse[628t] or Square[628*t] for example ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug UI User interface related stuff
Projects
None yet
Development

No branches or pull requests

3 participants