Skip to content

Instantly share code, notes, and snippets.

View SoutrikBandyopadhyay's full-sized avatar

Soutrik Bandyopadhyay SoutrikBandyopadhyay

View GitHub Profile
@SoutrikBandyopadhyay
SoutrikBandyopadhyay / ubuntu-iitd.md
Created February 24, 2022 09:25 — forked from rishirdua/ubuntu-iitd.md
Configuring Ubuntu for using IITD internet
x = '''from setuptools import setup
from Cython.Build import cythonize
import numpy
import scipy
setup(
include_dirs=[numpy.get_include(),scipy.get_include()],
ext_modules = cythonize("*.pyx",annotate=True, build_dir= "build", compiler_directives={'language_level' : "3"})
)''',
import matlab.engine
import matplotlib.pyplot as plt
class SimulinkPlant:
def __init__(self,modelName = 'plant'):
self.modelName = modelName #The name of the Simulink Model (To be placed in the same directory as the Python Code)
#Logging the variables
self.yHist = 0
self.tHist = 0
class PIController:
def __init__(self):
#Maintain a History of Variables
self.yHist = []
self.tHist = []
self.uHist = []
self.eSum = 0
def initialize(self):
class SimulinkPlant:
def __init__(self,modelName = 'plant'):
self.modelName = modelName #The name of the Simulink Model (To be placed in the same directory as the Python Code)
#Logging the variables
self.yHist = 0
self.tHist = 0
def setControlAction(self,u):
#Helper Function to set value of control action
@SoutrikBandyopadhyay
SoutrikBandyopadhyay / component.c
Created August 7, 2018 17:38
The Code for Symetrical Analysis of Unsymetric 3 Phase System
#include <stdio.h>
#include <math.h>
#include <malloc.h>
float pi = 3.141592654;
typedef struct _cmp{
float real;
float imag;
} Complex;
import gym
from keras.models import Sequential
from keras.layers import Dense,Dropout,Flatten
from keras.optimizers import Adam
from collections import deque
import numpy as np
import random
EPISODES = 5000
@SoutrikBandyopadhyay
SoutrikBandyopadhyay / MachineDesign.c
Created September 21, 2017 14:33
Machine Design code
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<conio.h>
#define pi 3.141592653589
#define muo 0.000001256
// Object oriented code = best code
print "Hello World !!!"