'''
Created on 09-Jan-2024

@author: bthakur
'''

import os
import sys
import re

import codecs
import inspect
import traceback

from xv.util import convertToUtf8, locatePath, Repository
from xv.util.data import NamedProcessor

from xv.util import is_list_tuple_set
from xv.util import UtilClass

from xv.km.entities import NamedEntity, NamedEntityFactory, NamedEntities

# _capacitance_entities
# CapacitanceEntities

class CapacitanceEntities(NamedEntities):
    
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self._init_default_entities()
        pass
    
    def _init_default_entities(self):
        from sympy import (Symbol, 
                           Integral, Derivative, 
                           Eq, 
                           simplify, )
        E = Symbol('E') #electric field
        sigma = Symbol('sigma') #surface charge density
        epsilon = Symbol('epsilon') #electric permitivity
        
        latex_expr = f"""
        
        \\oiint_S \\overrightarrow{{\\mathbf{{E}}}} \\cdot d \\overrightarrow{{\\mathbf{{A}}}}=\\frac{{q_{{\\mathrm{{enc}}}}}}{{\\varepsilon_0}}
        
        
        """
        desc = "Gauss Theorem for Electric Flux"
        named_entity = NamedEntity(latex_expr = latex_expr,
                                   desc = desc,
                                   verbose = self.verbose)
        self.add_entity(named_entity)
        

        eq = Eq(E, sigma / epsilon)
        desc = "Electric field inside a parallel plate capacitor derived from Gauss Theorem"
        named_entity = NamedEntity(expr = eq,
                                   desc = desc,
                                   verbose = self.verbose)
        self.add_entity(named_entity)
        
        pass
    
            
    pass
#class CapacitanceEntities:
