Skip to content

Resistor Tolerance #190

Discussion options

You must be logged in to vote

I hope I'm not misleading you, but as far as I've checked there is no tolerance parameter in models for resistor in SpiceSharp.
So I think you would need to handle it yourself by setting some random value for resistor based on initial value.

Below is code to generate resistances with some tolerance.

using System;
					
public class Program
{
	public static void Main()
	{	
		Random r = new Random(Environment.TickCount);

		for (var i = 0; i < 100; i++)
		{	
			var tolerance = 0.01; // 1% of tolerance	
			var resistance = 1000; // initial resistance

			Console.WriteLine(ComputeRandomResitance(r, resistance, tolerance));
		}
	}
	
	public static double ComputeRandomResitance(Random r, double…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Abbas111977
Comment options

Answer selected by Abbas111977
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants