Skip to content

Instantly share code, notes, and snippets.

View arthurafarias's full-sized avatar

Arthur de Araújo Farias arthurafarias

  • Campina Grande, Brasil
View GitHub Profile
@arthurafarias
arthurafarias / load_mega_instances.sh
Last active July 28, 2023 07:31
Simple example script to load multiples instances of mega.co.nz client on linux.
#!/bin/sh
for d in */ ; do
HOME=$(pwd)/$d;
echo $d;
# Remove the comment by your need
# megasync # first run (configure client by client at once)
# megasync 2> /dev/null & # load all clients at non blocking way
done
@arthurafarias
arthurafarias / routh.m
Last active November 5, 2015 12:29
Function do Create Routh Matrix from any Polynomial in Vector Form
function [ routhm, characteristic, n_unstable_poles ] = routh(pol)
try
assert( all( size(pol,1) == 1 ) );
catch ERR
rethrow(ERR)
end
pol_order = size(pol,2)-1;
% Original code available to download in: https://docs.google.com/document/d/1zQxnDVBOtXf0OEUH-vTztGY1Dbm72WlglKVueo0TqgU/edit
% This code was shared by Brian Douglas in youtube.com link: https://www.youtube.com/watch?v=sof3meN96MA
% -------------------------------------------------
% A small interative demonstration of Cauchy Argument Principle
% -------------------------------------------------
function Interact(Pos)
if nargin == 0
@arthurafarias
arthurafarias / bode_a4.svg
Last active November 18, 2015 04:03
A4 Paper to Bode Plot Diagrams
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@arthurafarias
arthurafarias / signal_analysis.svg
Created November 18, 2015 03:54
A4 paper to Signal Comparison and Analysis
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@arthurafarias
arthurafarias / ufcg-ee-lpc-p03q01.m
Last active March 29, 2016 03:02
UFCG - EE - LPC - P03 Q01
h = @(n,wc,ws) 2*wc/ws*sinc(n*2*wc/ws); % impulse response of a lowpass filter in discrete domain, ws sampling angular frequency, wc cutoff frequency
h_causal = @(n,wc,ws,N) h(n-(N-1)/2,wc,ws); % causal version of impulse response
N = 33; % given in question
wc = 2*pi*500; % given in question
ws = 2*pi*8000; % given in question
i = 0:(N-1); % indexer, vector length is N-1.
bi = h_causal(i,wc,ws,length(i)); % FIR gains
@arthurafarias
arthurafarias / ufcg-ee-lca-exp03-2.m
Created April 7, 2016 19:27 — forked from anonymous/ufcg-ee-lca-exp03-2.m
Controle Analógico EXP03-2
Jm=1.5;
Ra=60e-3;
La=1.8e-3;
Ke=0.8;
Fm=0.01;
oe=1;
Ka=(Ke*oe)/(Ke^2*oe^2+Ra*Fm);
Km=(Ra)/(Ke^2*oe^2+Ra*Fm);
Ta=La/Ra;
Tm=Jm/Fm;
@arthurafarias
arthurafarias / ufcg-ee-lca-e03p02.m
Created April 7, 2016 19:29
Laboratório de Controle Analógico Experimento 03 Parte 02 (Código Matlab)
Jm = 1.5;
Ra = 60e-3;
La = 1.8e-3;
Ke = 0.8;
Fm = 0.01;
oe = 1;
Ka = (Ke*oe)/(Ke^2*oe^2+Ra*Fm);
Km = (Ra)/(Ke^2^oe^2 + Ra*Fm);
Ta = La/Ra;
Tm = Jm/Fm;
@arthurafarias
arthurafarias / ucg-ee-lca-e03p02.mdl
Created April 7, 2016 19:33
Laboratório de Controle Analógico Experimento 03 Parte 02 (Código Simulink)
Model {
Name "PID"
Version 7.3
MdlSubVersion 0
GraphicalInterface {
NumRootInports 0
NumRootOutports 0
ParameterArgumentNames ""
ComputedModelVersion "1.2"
NumModelReferences 0
@arthurafarias
arthurafarias / ufcg-ee-ie-p20151-p1e.md
Last active April 11, 2016 06:22
UFCG - Engenharia Elétrica - Instalações Elétricas - Período 2015.1 - Prova - 1º Estágio

Questão 01

  1. Uma edificação individual é aquela reconhecida pelos poderes públicos, podendo constituir-se de uma única ou de várias unidades consumidoras (NDU001 Item 3.10).

  2. Uma edificação agrupada constitui-se de um conjunto de edificações reconhecida pelos poderes públicos, constituída por duas ou mais unidades consumidoras construídas em um único terreno ou em terrenos