How to use Input method in fMBT

Best Python code snippet using fMBT_python

BeforeInputEventPlugin-test.js

Source:BeforeInputEventPlugin-test.js Github

copy

Full Screen

...698 const node = ReactDOM.render(699 <input700 type="text"701 onBeforeInput={({type, data}) => {702 spyOnBeforeInput();703 beforeInputEvent = {type, data};704 }}705 onCompositionStart={({type, data}) => {706 spyOnCompositionStart();707 compositionStartEvent = {type, data};708 }}709 onCompositionUpdate={({type, data}) => {710 spyOnCompositionUpdate();711 compositionUpdateEvent = {type, data};712 }}713 />,714 container,715 );716 scenes.forEach((s, id) => {717 beforeInputEvent = null;718 compositionStartEvent = null;719 compositionUpdateEvent = null;720 spyOnBeforeInput = jest.fn();721 spyOnCompositionStart = jest.fn();722 spyOnCompositionUpdate = jest.fn();723 s.eventSimulator.apply(null, [node, ...s.eventSimulatorArgs]);724 env.assertions[id].run({725 beforeInputEvent,726 compositionStartEvent,727 compositionUpdateEvent,728 spyOnBeforeInput,729 spyOnCompositionStart,730 spyOnCompositionUpdate,731 });732 });733 };734 const testContentEditableComponent = (env, scenes) => {735 let beforeInputEvent;736 let compositionStartEvent;737 let compositionUpdateEvent;738 let spyOnBeforeInput;739 let spyOnCompositionStart;740 let spyOnCompositionUpdate;741 ReactDOM = loadReactDOM(env.emulator);742 const node = ReactDOM.render(743 <div744 contentEditable={true}745 onBeforeInput={({type, data}) => {746 spyOnBeforeInput();747 beforeInputEvent = {type, data};748 }}749 onCompositionStart={({type, data}) => {750 spyOnCompositionStart();751 compositionStartEvent = {type, data};752 }}753 onCompositionUpdate={({type, data}) => {754 spyOnCompositionUpdate();755 compositionUpdateEvent = {type, data};756 }}757 />,758 container,759 );760 scenes.forEach((s, id) => {...

Full Screen

Full Screen

Microsoft.py

Source:Microsoft.py Github

copy

Full Screen

1from ReadInput import getClosingPrices2from Input_Variables import exponentialMovingAverage,inputRdp,trainingOutputRdp_5,changeInPrice,scale3from sklearn import svm,preprocessing4import numpy as np5from Output_Variables import calculateCorrectPredictions6pathOfMicrosoft = '/home/Documents/dataset/MS'7datePriceDictionary = getClosingPrices(pathOfMicrosoft,'MicrosoftTraining.xlsx')8initialPriceDictionary = getClosingPrices(pathOfMicrosoft,'Training.xlsx')9last5PriceDictionary = getClosingPrices(pathOfMicrosoft,'Last5Days.xlsx')10dateList = datePriceDictionary.keys()11closingPriceList = datePriceDictionary.values()12initialPriceValues = initialPriceDictionary.values()13SVM_trainingInput = []14SVM_trainingOutputValues = []15SVM_trainingOutputClasses = []16SVM_trainingOutputClasses.append(1)17last5List = last5PriceDictionary.values()18changeInPrice(closingPriceList,SVM_trainingOutputClasses)19sumClosingPrices = 0.020for iter in xrange(5,20):21 sumClosingPrices = sumClosingPrices+float(initialPriceValues[iter])22simpleMovingAverage = sumClosingPrices/float(15)23emaYesterDay = simpleMovingAverage24emaList = []25for i in xrange(0,closingPriceList.__len__()):26 ema_15 = exponentialMovingAverage(closingPriceList[i],15,emaYesterDay)27 emaList.append(ema_15)28 emaYesterDay= ema_1529emaLastList = []30for j in xrange(0,5):31 ema_15Last = exponentialMovingAverage(last5List[j],15,emaYesterDay)32 emaLastList.append(ema_15Last)33ema_15_Input_List = []34rdp_5_Input_List = []35rdp_10_Input_List = []36rdp_15_Input_List = []37rdp_20_Input_List = []38for iterator in xrange(0,closingPriceList.__len__()):39 ema15Input = closingPriceList[iterator] - emaList[iterator]40 ema_15_Input_List.append(ema15Input)41 if iterator<5:42 rdp_5_Input = inputRdp(closingPriceList[iterator],initialPriceValues[iterator+15])43 rdp_5_Input_List.append(rdp_5_Input)44 rdp_10_Input = inputRdp(closingPriceList[iterator],initialPriceValues[iterator+10])45 rdp_10_Input_List.append(rdp_10_Input)46 rdp_15_Input = inputRdp(closingPriceList[iterator],initialPriceValues[iterator+5])47 rdp_15_Input_List.append(rdp_15_Input)48 rdp_20_Input = inputRdp(closingPriceList[iterator],initialPriceValues[iterator])49 rdp_20_Input_List.append(rdp_20_Input)50 elif iterator<10:51 rdp_5_Input = inputRdp(closingPriceList[iterator],closingPriceList[iterator-5])52 rdp_5_Input_List.append(rdp_5_Input)53 rdp_10_Input = inputRdp(closingPriceList[iterator],initialPriceValues[iterator+10])54 rdp_10_Input_List.append(rdp_10_Input)55 rdp_15_Input = inputRdp(closingPriceList[iterator],initialPriceValues[iterator+5])56 rdp_15_Input_List.append(rdp_15_Input)57 rdp_20_Input = inputRdp(closingPriceList[iterator],initialPriceValues[iterator])58 rdp_20_Input_List.append(rdp_20_Input)59 elif iterator<15:60 rdp_5_Input = inputRdp(closingPriceList[iterator],closingPriceList[iterator-5])61 rdp_5_Input_List.append(rdp_5_Input)62 rdp_10_Input = inputRdp(closingPriceList[iterator],closingPriceList[iterator-10])63 rdp_10_Input_List.append(rdp_10_Input)64 rdp_15_Input = inputRdp(closingPriceList[iterator],initialPriceValues[iterator+5])65 rdp_15_Input_List.append(rdp_15_Input)66 rdp_20_Input = inputRdp(closingPriceList[iterator],initialPriceValues[iterator])67 rdp_20_Input_List.append(rdp_20_Input)68 elif iterator<20:69 rdp_5_Input = inputRdp(closingPriceList[iterator],closingPriceList[iterator-5])70 rdp_5_Input_List.append(rdp_5_Input)71 rdp_10_Input = inputRdp(closingPriceList[iterator],closingPriceList[iterator-10])72 rdp_10_Input_List.append(rdp_10_Input)73 rdp_15_Input = inputRdp(closingPriceList[iterator],closingPriceList[iterator-15])74 rdp_15_Input_List.append(rdp_15_Input)75 rdp_20_Input = inputRdp(closingPriceList[iterator],initialPriceValues[iterator])76 rdp_20_Input_List.append(rdp_20_Input)77 else:78 rdp_5_Input = inputRdp(closingPriceList[iterator],closingPriceList[iterator-5])79 rdp_5_Input_List.append(rdp_5_Input)80 rdp_10_Input = inputRdp(closingPriceList[iterator],closingPriceList[iterator-10])81 rdp_10_Input_List.append(rdp_10_Input)82 rdp_15_Input = inputRdp(closingPriceList[iterator],closingPriceList[iterator-15])83 rdp_15_Input_List.append(rdp_15_Input)84 rdp_20_Input = inputRdp(closingPriceList[iterator],closingPriceList[iterator-20])85 rdp_20_Input_List.append(rdp_20_Input)86closingPriceListLength = closingPriceList.__len__()87for itr1 in xrange(0,closingPriceListLength):88 if itr1 == 0:89 rdp_5_Output = trainingOutputRdp_5(closingPriceList[itr1],closingPriceList[itr1+5],simpleMovingAverage,emaList[itr1+4])90 SVM_trainingOutputValues.append(rdp_5_Output)91 elif itr1 < (closingPriceListLength-5):92 rdp_5_Output = trainingOutputRdp_5(closingPriceList[itr1],closingPriceList[itr1+5],emaList[itr1-1],emaList[itr1+4])93 SVM_trainingOutputValues.append(rdp_5_Output)94 else:95 rdp_5_Output = trainingOutputRdp_5(closingPriceList[itr1],last5List[abs(closingPriceListLength-iterator-5)],emaList[itr1-1],emaLastList[abs(closingPriceListLength-iterator-5)])96 SVM_trainingOutputValues.append(rdp_5_Output)97print 'DEBUGGING:',ema_15_Input_List.__len__()98'''preprocessing.scale(ema_15_Input_List)99preprocessing.scale(rdp_5_Input_List)100preprocessing.scale(rdp_10_Input_List)101preprocessing.scale(rdp_15_Input_List)102preprocessing.scale(rdp_20_Input_List)'''103for count in xrange(0,ema_15_Input_List.__len__()):104 rowWiseInputList = []105 rowWiseInputList.append(ema_15_Input_List[count])106 rowWiseInputList.append(rdp_5_Input_List[count])107 rowWiseInputList.append(rdp_10_Input_List[count])108 rowWiseInputList.append(rdp_15_Input_List[count])109 rowWiseInputList.append(rdp_20_Input_List[count])110 SVM_trainingInput.append(rowWiseInputList)111testingDictionary = getClosingPrices(pathOfMicrosoft,'MicrosoftTesting.xlsx')112testingInputValues = testingDictionary.values()113emaTestList = []114emaOld=emaList[emaList.__len__()-1]115for it in xrange(0,testingInputValues.__len__()):116 emaTest = exponentialMovingAverage(testingInputValues[it],15,emaOld)117 emaTestList.append(emaTest)118 emaOld=emaTest119ema_15_Test_List = []120rdp_5_Test_List = []121rdp_10_Test_List = []122rdp_15_Test_List = []123rdp_20_Test_List = []124closingPricesLast_20_daysList = []125for itr2 in xrange(closingPriceList.__len__()-20,closingPriceList.__len__()):126 closingPricesLast_20_daysList.append(closingPriceList[itr2])127for iterator_1 in xrange(0,testingInputValues.__len__()):128 ema_15TestInput = testingInputValues[iterator_1] - emaTestList[iterator_1]129 ema_15_Test_List.append(ema_15TestInput)130 if iterator_1 < 5:131 rdp_5_test = inputRdp(testingInputValues[iterator_1],closingPricesLast_20_daysList[iterator_1+15])132 rdp_5_Test_List.append(rdp_5_test)133 rdp_10_test = inputRdp(testingInputValues[iterator_1],closingPricesLast_20_daysList[iterator_1+10])134 rdp_10_Test_List.append(rdp_10_test)135 rdp_15_test = inputRdp(testingInputValues[iterator_1],closingPricesLast_20_daysList[iterator_1+5])136 rdp_15_Test_List.append(rdp_15_test)137 rdp_20_Test = inputRdp(testingInputValues[iterator_1],closingPricesLast_20_daysList[iterator_1])138 rdp_20_Test_List.append(rdp_20_Test)139 elif iterator_1<10:140 rdp_5_test = inputRdp(testingInputValues[iterator_1],testingInputValues[iterator_1-5])141 rdp_5_Test_List.append(rdp_5_test)142 rdp_10_test = inputRdp(testingInputValues[iterator_1],closingPricesLast_20_daysList[iterator_1+10])143 rdp_10_Test_List.append(rdp_10_test)144 rdp_15_test = inputRdp(testingInputValues[iterator_1],closingPricesLast_20_daysList[iterator_1+5])145 rdp_15_Test_List.append(rdp_15_test)146 rdp_20_Test = inputRdp(testingInputValues[iterator_1],closingPricesLast_20_daysList[iterator_1])147 rdp_20_Test_List.append(rdp_20_Test)148 elif iterator_1<15:149 rdp_5_test = inputRdp(testingInputValues[iterator_1],testingInputValues[iterator_1-5])150 rdp_5_Test_List.append(rdp_5_test)151 rdp_10_test = inputRdp(testingInputValues[iterator_1],testingInputValues[iterator_1-10])152 rdp_10_Test_List.append(rdp_10_test)153 rdp_15_test = inputRdp(testingInputValues[iterator_1],closingPricesLast_20_daysList[iterator_1+5])154 rdp_15_Test_List.append(rdp_15_test)155 rdp_20_Test = inputRdp(testingInputValues[iterator_1],closingPricesLast_20_daysList[iterator_1])156 rdp_20_Test_List.append(rdp_20_Test)157 elif iterator_1<20:158 rdp_5_test = inputRdp(testingInputValues[iterator_1],testingInputValues[iterator_1-5])159 rdp_5_Test_List.append(rdp_5_test)160 rdp_10_test = inputRdp(testingInputValues[iterator_1],testingInputValues[iterator_1-10])161 rdp_10_Test_List.append(rdp_10_test)162 rdp_15_test = inputRdp(testingInputValues[iterator_1],testingInputValues[iterator_1-15])163 rdp_15_Test_List.append(rdp_15_test)164 rdp_20_Test = inputRdp(testingInputValues[iterator_1],closingPricesLast_20_daysList[iterator_1])165 rdp_20_Test_List.append(rdp_20_Test)166 else:167 rdp_5_test = inputRdp(testingInputValues[iterator_1],testingInputValues[iterator_1-5])168 rdp_5_Test_List.append(rdp_5_test)169 rdp_10_test = inputRdp(testingInputValues[iterator_1],testingInputValues[iterator_1-10])170 rdp_10_Test_List.append(rdp_10_test)171 rdp_15_test = inputRdp(testingInputValues[iterator_1],testingInputValues[iterator_1-15])172 rdp_15_Test_List.append(rdp_15_test)173 rdp_20_Test = inputRdp(testingInputValues[iterator_1],testingInputValues[iterator_1-20])174 rdp_20_Test_List.append(rdp_20_Test)175'''preprocessing.scale(ema_15_Test_List)176preprocessing.scale(rdp_5_Test_List)177preprocessing.scale(rdp_10_Test_List)178preprocessing.scale(rdp_15_Test_List)179preprocessing.scale(rdp_20_Test_List)'''180#-------------------------------------------------------181minMaxScaler = preprocessing.MinMaxScaler(feature_range=(-0.9,0.9))182minMaxScaler.fit(SVM_trainingInput)183SVM_trainingInputScaled = minMaxScaler.transform(SVM_trainingInput)184print 'SVM_trainingInputScaled' ,SVM_trainingInputScaled185#--------------------------------------------------------186SVR_TestList = []187for count1 in xrange(0,ema_15_Test_List.__len__()):188 rowWiseTestList = []189 rowWiseTestList.append(ema_15_Test_List[count1])190 rowWiseTestList.append(rdp_5_Test_List[count1])191 rowWiseTestList.append(rdp_10_Test_List[count1])192 rowWiseTestList.append(rdp_15_Test_List[count1])193 rowWiseTestList.append(rdp_20_Test_List[count1])194 SVR_TestList.append(rowWiseTestList)195SVR_TestListExpectedOutput = []196SVR_TestListExpectedOutput.append(1)197changeInPrice(testingInputValues,SVR_TestListExpectedOutput)198#----------------------------------------------Classification----------------------------------------------199#temp = np.array(SVM_trainingInput)200#myGamma = 1/float(np.power(np.var(SVM_trainingInput),2))201#------------------------------------------------------------202minMaxScaler.fit(SVR_TestList)203SVR_TestListScaled = minMaxScaler.transform(SVR_TestList)204#------------------------------------------------------------205classifier = svm.SVC(kernel='rbf',gamma=1/10.0)206classifier.fit(SVM_trainingInputScaled,SVM_trainingOutputClasses)207y = classifier.predict(SVR_TestList)208regression = svm.SVR(kernel='poly',coef0=3,degree=1)#(kernel='rbf',gamma=1/1000.0)209scale(SVM_trainingOutputValues)210regression.fit(SVM_trainingInput,SVM_trainingOutputValues)211print 'SVROUTPUTTRAINING::',SVM_trainingOutputValues212print 'SVRTEST::',SVR_TestList213z = regression.predict(SVR_TestList)214z = np.array(z).tolist()215print z216predictedList = []217predictedList.append(1)218changeInPrice(z,predictedList)219print 'SVR_TestListLength:',SVR_TestList.__len__()220print 'Expected Value:',SVR_TestListExpectedOutput221print 'Predicted::',predictedList222numberOfCorrectPredictions,probabiltyOfCorrectPredictions = calculateCorrectPredictions(SVR_TestListExpectedOutput,predictedList)223print 'NUMBER OF CORRECT CLASSIFICATIONS::',numberOfCorrectPredictions...

Full Screen

Full Screen

input.js

Source:input.js Github

copy

Full Screen

...202 e.preventDefault();203 app.input.validate($inputEl);204 }205 }206 function clearInput() {207 const $clicked = $(this);208 const $inputEl = $clicked.siblings('input, textarea').eq(0);209 const previousValue = $inputEl.val();210 $inputEl211 .val('')212 .trigger('input change')213 .focus()214 .trigger('input:clear', previousValue);215 }216 $(document).on('click', '.input-clear-button', clearInput);217 $(document).on('change input', 'input, textarea, select', onChange, true);218 $(document).on('focus', 'input, textarea, select', onFocus, true);219 $(document).on('blur', 'input, textarea, select', onBlur, true);220 $(document).on('invalid', 'input, textarea, select', onInvalid, true);...

Full Screen

Full Screen

t.py

Source:t.py Github

copy

Full Screen

1import math2from tkinter import *3from PIL import ImageTk, Image4import matplotlib.pyplot as plt5from scipy. integrate import odeint6import numpy as np7mu0 = 4 * math.pi * (10 ** (-7))8tau = 1.7759l = 3.510wc = 1411wr = 2412delta = 0.06513Rc = 114Rr = 215Lcs = 0.0012616Lrs = 0.00126*217J = 0.118p = 219D = 2*tau/math.pi*p20pi = math.pi21kcc = p*(4*wc*wc*tau*l*mu0)/(pi*delta*pi)22krc = p*(4*wr*wc*tau*l*mu0)/(pi*delta*pi)23krr = p*(4*wr*wr*tau*l*mu0)/(pi*delta*pi)24t_max = 425t_del = 50000026t = np.linspace(0, t_max, t_del)27y0 = [0, 0, 0, 0, 0, 0, 0, 0]28Uc = 40029fc = 5030phic = 031def B_delta(Ica, Icb, Icc, Ira, Irb, Irc, x, phi):32 return (2*mu0/(math.pi*delta)*(wc*Ica*math.cos(math.pi/tau*x)+wc*Icb*math.cos(math.pi/tau*x-2*math.pi/3)+wc*Icc*math.cos(math.pi/tau*x+2*math.pi/3)+wr*Ira*math.cos(math.pi/tau*x-phi*p)+wr*Irb*math.cos(math.pi/tau*x-phi*p-2*math.pi/3)+wr*Irc*math.cos(math.pi/tau*x-phi*p+2*math.pi/3)))33def f(input_variable, t):34 main_det = [[-kcc*(math.sin(pi/2) - (-1)*math.sin(pi/6)) - Lcs, -kcc*(math.sin(pi/2 + 2*pi/3) - (-1)*math.sin(pi/6 - 2*pi/3)) + Lcs, -kcc*(math.sin(pi/2 - 2*pi/3) - (-1)*math.sin(pi/6 + 2*pi/3)), -krc*(math.sin(pi/2 + input_variable[7]*p) - (-1)*math.sin(pi/6 - input_variable[7]*p)), -krc*(math.sin(pi/2 + input_variable[7]*p + 2*pi/3) - (-1)*math.sin(pi/6 - input_variable[7]*p - 2*pi/3)), -krc*(math.sin(pi/2 + input_variable[7]*p - 2*pi/3) - (-1)*math.sin(pi/6 - input_variable[7]*p + 2*pi/3))],35 [-kcc*((-1)*math.sin(pi/6) - math.sin(-pi/6)), -kcc*((-1)*math.sin(pi/6 - 2*pi/3) - math.sin(-pi/6 - 2*pi/3)) - Lcs, -kcc*((-1)*math.sin(pi/6 + 2*pi/3) - math.sin(-pi/6 + 2*pi/3)) + Lcs, -krc*((-1)*math.sin(pi/6 - input_variable[7]*p) - math.sin(-pi/6 - input_variable[7]*p)), -krc*((-1)*math.sin(pi/6 - input_variable[7]*p - 2*pi/3) - math.sin(-pi/6 - input_variable[7]*p - 2*pi/3)), -krc*((-1)*math.sin(pi/6 - input_variable[7]*p + 2*pi/3) - math.sin(-pi/6 - input_variable[7]*p + 2*pi/3))],36 [-kcc*math.sin(-pi/6), -kcc*math.sin(-pi/6 - 2*pi/3), -kcc*math.sin(-pi/6 + 2*pi/3) - Lcs, -krc*math.sin(-pi/6 - input_variable[7]*p), -krc*math.sin(-pi/6 - input_variable[7]*p - 2*pi/3), -krc*math.sin(-pi/6 - input_variable[7]*p + 2*pi/3)],37 [-krc*math.sin(pi/2-input_variable[7]*p-0), -krc*math.sin(pi/2-input_variable[7]*p+2*pi/3), -krc*math.sin(pi/2-input_variable[7]*p-2*pi/3), -krr*math.sin(pi/2-0) - Lrs, -krr*math.sin(pi/2+2*pi/3), -krr*math.sin(pi/2-2*pi/3)],38 [-krc*(-1)*math.sin(pi/6+input_variable[7]*p-0), -krc*(-1)*math.sin(pi/6+input_variable[7]*p-2*pi/3), -krc*(-1)*math.sin(pi/6+input_variable[7]*p+2*pi/3), -krr*(-1)*math.sin(pi/6+0), -krr*(-1)*math.sin(pi/6-2*pi/3) - Lrs, -krr*(-1)*math.sin(pi/6+2*pi/3)],39 [-krc*math.sin(-pi/6+input_variable[7]*p-0), -krc*math.sin(-pi/6+input_variable[7]*p-2*pi/3), -krc*math.sin(-pi/6+input_variable[7]*p+2*pi/3), -krr*math.sin(-pi/6+0), -krr*math.sin(-pi/6-2*pi/3), -krr*math.sin(-pi/6+2*pi/3) - Lrs]40 ]41 own_matrix = [input_variable[0]*Rc + Uc*(math.sin(2*math.pi*fc*t + phic) - math.sin(2*math.pi*fc*t + phic - 2*pi/3)) - input_variable[1]*Rc + krc*p*input_variable[6]*(input_variable[3]*math.cos(pi/2 + input_variable[7]*p) + input_variable[4]*math.cos(pi/2 + input_variable[7]*p + 2*pi/3) + input_variable[5]*math.cos(pi/2 + input_variable[7]*p - 2*pi/3) + (-1)*input_variable[3]*math.cos(pi/6 - input_variable[7]*p) + (-1)*input_variable[4]*math.cos(pi/6 - input_variable[7]*p - 2*pi/3) + (-1)*input_variable[5]*math.cos(pi/6 - input_variable[7]*p + 2*pi/3)),42 input_variable[1]*Rc + Uc*(math.sin(2*math.pi*fc*t + phic - 2*pi/3) - math.sin(2*math.pi*fc*t + phic + 2*pi/3)) - input_variable[2]*Rc + krc*p*input_variable[6]*(input_variable[3]*math.cos(pi/6 - input_variable[7]*p) + input_variable[4]*math.cos(pi/6 - input_variable[7]*p - 2*pi/3) + input_variable[5]*math.cos(pi/6 - input_variable[7]*p + 2*pi/3) + input_variable[3]*math.cos(-pi/6 - input_variable[7]*p) + input_variable[4]*math.cos(-pi/6 - input_variable[7]*p - 2*pi/3) + input_variable[5]*math.cos(-pi/6 - input_variable[7]*p + 2*pi/3)),43 input_variable[2]*Rc + Uc*math.sin(2*math.pi*fc*t + phic + 2*pi/3) - krc*p*input_variable[6]*(input_variable[3]*math.cos(-pi/6 - input_variable[7]*p) + input_variable[4]*math.cos(-pi/6 - input_variable[7]*p - 2*pi/3) + input_variable[5]*math.cos(-pi/6 - input_variable[7]*p + 2*pi/3)),44 input_variable[3]*Rr-input_variable[6]*krc*p*(input_variable[0]*math.cos(pi/2-input_variable[7]*p)+input_variable[1]*math.cos(pi/2-input_variable[7]*p+2*pi/3)+input_variable[2]*math.cos(pi/2-input_variable[7]*p-2*pi/3)),45 input_variable[4]*Rr+input_variable[6]*krc*p*(-1)*(input_variable[0]*math.cos(pi/6+input_variable[7]*p)+input_variable[1]*math.cos(pi/6+input_variable[7]*p-2*pi/3)+input_variable[2]*math.cos(pi/6+input_variable[7]*p+2*pi/3)),46 input_variable[5]*Rr+input_variable[6]*krc*p*(input_variable[0]*math.cos(-pi/6+input_variable[7]*p)+input_variable[1]*math.cos(-pi/6+input_variable[7]*p-2*pi/3)+input_variable[2]*math.cos(-pi/6+input_variable[7]*p+2*pi/3))47 ]48 49 Melmag = D*l*wr*(input_variable[3]*B_delta(input_variable[0], input_variable[1], input_variable[2], input_variable[3], input_variable[4], input_variable[5], tau/pi*input_variable[7]*p-tau/2, input_variable[7])+input_variable[4]*B_delta(input_variable[0], input_variable[1], input_variable[2], input_variable[3], input_variable[4], input_variable[5], tau/pi*input_variable[7]*p+tau/6, input_variable[7])+input_variable[5]*B_delta(input_variable[0], input_variable[1], input_variable[2], input_variable[3], input_variable[4], input_variable[5], tau/pi*input_variable[7]*p-7*tau/6, input_variable[7]))50 derw = (-0*math.tanh(input_variable[6]) - p*Melmag)/J51 solve_matrix = np.linalg.solve(main_det, own_matrix)52 print(t/t_max*100)53 return [solve_matrix[0],54 solve_matrix[1],55 solve_matrix[2],56 solve_matrix[3],57 solve_matrix[4],58 solve_matrix[5],59 derw,60 input_variable[6]]61ww = odeint(f, y0, t)62m_f = []63for i in range(len(t)):64 m_f.append(ww[:, 6][i]/2/pi)65plt.subplot(3, 1, 1)66plt.plot(t, ww[:, 0], linewidth=1, color='red')67plt.xlabel('Время, с', fontsize=12, color='black')68plt.ylabel('Ток статора, А', fontsize=12, color='black')69plt.grid(True)70plt.subplot(3, 1, 2)71plt.plot(t, ww[:, 3], linewidth=1, color='red')72plt.xlabel('Время, с', fontsize=12, color='black')73plt.ylabel('Ток ротора, А', fontsize=12, color='black')74plt.grid(True)75plt.subplot(3, 1, 3)76plt.plot(t, m_f, linewidth=1, color='red')77plt.xlabel('Время, с', fontsize=12, color='black')78plt.ylabel('Частота, Гц', fontsize=12, color='black')79plt.grid(True)80plt.show()81[-kcc*(math.sin(pi/2)-(-1)*math.sin(pi/6)-math.sin(pi/2-2*pi/3)+(-1)*math.sin(pi/6+2*pi/3))-Lcs, -kcc*(math.sin(pi/2+2*pi/3)-(-1)*math.sin(pi/6-2*pi/3)-math.sin(pi/2-2*pi/3)+(-1)*math.sin(pi/6+2*pi/3))+Lcs, -krc*(math.sin(pi/2 + input_variable[6]*p) - (-1)*math.sin(pi/6 - input_variable[6]*p)), -krc*(math.sin(pi/2 + input_variable[6]*p + 2*pi/3) - (-1)*math.sin(pi/6 - input_variable[6]*p - 2*pi/3)), -krc*(math.sin(pi/2 + input_variable[6]*p - 2*pi/3) - (-1)*math.sin(pi/6 - input_variable[6]*p + 2*pi/3))],82[-kcc*((-1)*math.sin(pi/6)-math.sin(-pi/6)-(-1)*math.sin(pi/6+2*pi/3)+math.sin(-pi/6+2*pi/3))-Lcs, -kcc*((-1)*math.sin(pi/6-2*pi/3)-math.sin(-pi/6-2*pi/3)-(-1)*math.sin(pi/6+2*pi/3)+math.sin(-pi/6+2*pi/3))-Lcs-Lcs, -krc*((-1)*math.sin(pi/6 - input_variable[6]*p) - math.sin(-pi/6 - input_variable[6]*p)), -krc*((-1)*math.sin(pi/6 - input_variable[6]*p - 2*pi/3) - math.sin(-pi/6 - input_variable[6]*p - 2*pi/3)), -krc*((-1)*math.sin(pi/6 - input_variable[6]*p + 2*pi/3) - math.sin(-pi/6 - input_variable[6]*p + 2*pi/3))],83[-krc*(math.sin(pi/2-input_variable[6]*p-0)-math.sin(pi/2-input_variable[6]*p-2*pi/3)), -krc*(math.sin(pi/2-input_variable[6]*p+2*pi/3)-math.sin(pi/2-input_variable[6]*p-2*pi/3)), -krr*math.sin(pi/2-0) - Lrs, -krr*math.sin(pi/2+2*pi/3), -krr*math.sin(pi/2-2*pi/3)],84[-krc*((-1)*math.sin(pi/6+input_variable[6]*p-0)-(-1)*math.sin(pi/6+input_variable[6]*p+2*pi/3)), -krc*((-1)*math.sin(pi/6+input_variable[6]*p-2*pi/3)-(-1)*math.sin(pi/6+input_variable[6]*p+2*pi/3)), -krr*(-1)*math.sin(pi/6+0), -krr*(-1)*math.sin(pi/6-2*pi/3) - Lrs, -krr*(-1)*math.sin(pi/6+2*pi/3)],85[-krc*(math.sin(-pi/6+input_variable[6]*p-0)-math.sin(-pi/6+input_variable[6]*p+2*pi/3)), -krc*(math.sin(-pi/6+input_variable[6]*p-2*pi/3)-math.sin(-pi/6+input_variable[6]*p+2*pi/3)), -krr*math.sin(-pi/6+0), -krr*math.sin(-pi/6-2*pi/3), -krr*math.sin(-pi/6+2*pi/3) - Lrs]86[input_variable[0]*Rc - input_variable[1]*Rc + krc*p*input_variable[5]*(input_variable[2]*math.cos(pi/2 + input_variable[6]*p) + input_variable[3]*math.cos(pi/2 + input_variable[6]*p + 2*pi/3) + input_variable[4]*math.cos(pi/2 + input_variable[6]*p - 2*pi/3) + (-1)*input_variable[2]*math.cos(pi/6 - input_variable[6]*p) + (-1)*input_variable[3]*math.cos(pi/6 - input_variable[6]*p - 2*pi/3) + (-1)*input_variable[4]*math.cos(pi/6 - input_variable[6]*p + 2*pi/3)),87input_variable[1]*Rc - (-input_variable[0]-input_variable[1])*Rc + krc*p*input_variable[5]*(input_variable[2]*math.cos(pi/6 - input_variable[6]*p) + input_variable[3]*math.cos(pi/6 - input_variable[6]*p - 2*pi/3) + input_variable[4]*math.cos(pi/6 - input_variable[6]*p + 2*pi/3) + input_variable[2]*math.cos(-pi/6 - input_variable[6]*p) + input_variable[3]*math.cos(-pi/6 - input_variable[6]*p - 2*pi/3) + input_variable[4]*math.cos(-pi/6 - input_variable[6]*p + 2*pi/3)),88input_variable[2]*Rr-input_variable[5]*krc*p*(input_variable[0]*math.cos(pi/2-input_variable[6]*p)+input_variable[1]*math.cos(pi/2-input_variable[6]*p+2*pi/3)+(-input_variable[0]-input_variable[1])*math.cos(pi/2-input_variable[6]*p-2*pi/3)),89input_variable[3]*Rr+input_variable[5]*krc*p*(-1)*(input_variable[0]*math.cos(pi/6+input_variable[6]*p)+input_variable[1]*math.cos(pi/6+input_variable[6]*p-2*pi/3)+(-input_variable[0]-input_variable[1])*math.cos(pi/6+input_variable[6]*p+2*pi/3)),90input_variable[4]*Rr+input_variable[5]*krc*p*(input_variable[0]*math.cos(-pi/6+input_variable[6]*p)+input_variable[1]*math.cos(-pi/6+input_variable[6]*p-2*pi/3)+(-input_variable[0]-input_variable[1])*math.cos(-pi/6+input_variable[6]*p+2*pi/3))...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run fMBT automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful