Skip to content
Snippets Groups Projects
Commit 914cf14a authored by corentin.cotture's avatar corentin.cotture
Browse files

WHO THE FUCK CAME UP WITH MAKE?

parent 0a0d0092
No related branches found
No related tags found
No related merge requests found
File added
#include "circuit_rc.h"
float vc_t(float t) {
return Vo - exp(-t / (R * C));
}
float circuit_rc(float v, float t)
{
return vc_t(t) + delta_t * (v - vc_t(t)) / (R * C);
}
int main() {
// int main(int argc, char *argv[]) {
printf("Circuit RC\n");
return 0;
}
\ No newline at end of file
#include <stdio.h>
#include <math.h>
#define delta_t 0.000001
#define R 1000
#define C 0.000001
#define Vo 12
/// @brief
/// @param t
/// @return
float vc_t(float t);
/// @brief Dérive de l'équation de la conservation de l'énergie
/// @param v
/// @param t
/// @return
float circuit_rc(float v, float t);
\ No newline at end of file
File added
main 0 → 100755
File added
makefile 0 → 100644
#The compiler
CC:=gcc
#The flags passed to the compiler
CFLAGS:=-g -Wall -Wextra -pedantic -fsanitize=leak -fsanitize=undefined -fsanitize=address
#The flags passed to the linker
LDFLAGS:=-lm
#Path to libs
VPATH:=circuit_rc
main: circuit_rc.o
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
# circuit_rc : circuit_rc.o
# $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
circuit_rc.o: circuit_rc.h
start: main
./main
clean:
rm -f *.o main
rebuild: clean main
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment