fromkandinskyimportdraw_stringasdsfromkandinskyimportfill_rectasfrfromionimportkeydownW=(255,255,255)B=(0,0,0)BL=(0,80,180)V=(0,120,0)GR=(80,80,80)T=(150,0,150)K_UP=1K_DOWN=2K_OK=4K_BACK=5# === DICTIONNAIRE DE COMPRESSION ===
# Les mots frequents sont remplaces par §1, §2, etc.
DIC={"§E":"equation","§D":"differentielle","§S":"solution","§F":"fonction","§X":"derivable","§R":"reelle","§C":"constante","§P":"propriete","§T":"donc","§V":"variable","§L":"lineaire","§O":"ordre","§H":"homogene","§I":"initiale","§K":"coefficient","§U":"unique","§N":"condition","§M":"forme","§A":"admet","§W":"omega","§Y":"y'","§Z":"y''",}defdecomp(s):fork,vinDIC.items():s=s.replace(k,v)returns# === COURS COMPRESSE ===
# Chaque element = 1 ligne
# Prefixes: # = titre, > = important, - = liste, $ = formule, @ = exemple
COURS=["# Equations Differentielles","","#1 INTRODUCTION","","Definition:","Une §E §D est une","relation entre une §V §R x,","une §F f et ses derivees","f', f'', f'''...","","Resoudre = trouver toutes","les §Fs qui satisfont","cette relation.","","@ Exemple: §Y(x) = 3x^2"," §S: y(x) = x^3 + c"," (c = §C §R)","","> Avec §N §I y(0)=1:","> §S §U: y(x) = x^3 + 1","","#2 TYPE §Y + a*y = 0","","§P:","Les §Ss de §Y + a*y = 0","sont de la §M:","","$ f(x) = k*exp(-a*x)","$ ou k est une §C §R","","@ Ex1: §Y - 3y = 0"," §S: f(x) = k*exp(3x)","","@ Ex2: 2*§Y = -5y"," => §Y + 2.5*y = 0"," §S: f(x) = k*exp(-2.5x)","","#3 TYPE §Y + a*y = b","","§P:","Les §Ss de §Y + a*y = b","(avec a different de 0)","sont de la §M:","","$ f(x) = k*exp(-ax) + b/a","","@ Ex: §Y + 2y = 4"," a=2, b=4, b/a=2"," §S: f(x) = k*exp(-2x) + 2","","#4 CAUCHY-LIPSCHITZ","","§P (Unicite):","L'§E §D §Y + a*y = b","§A une §U §S f §X sur R","verifiant f(x0) = y0.","","@ Ex: §Y - 0.5*y = 2"," avec f(0) = 1",""," 1) §S generale:"," f(x) = k*exp(0.5x) - 4",""," 2) §N f(0) = 1:"," k*exp(0) - 4 = 1"," k - 4 = 1"," k = 5",""," 3) §S:"," f(x) = 5*exp(0.5x) - 4","","#5 TYPE §Z + w^2*y = 0","","§P:","Les §Ss de §Z + w^2*y = 0","(w different de 0)","sont de la §M:","","$ f(x) = L*cos(wx) + M*sin(wx)","$ ou L,M sont des §Cs §Rs","","@ Ex1: §Z + 4y = 0"," w^2=4 §T w=2"," §S: f(x) = L*cos(2x)"," + M*sin(2x)","","@ Ex2: 27*§Z + 3y = 0"," §Z + (1/9)y = 0"," w = 1/3"," §S: f(x) = L*cos(x/3)"," + M*sin(x/3)","","#6 FORMULES TRIGO","","Utiles pour transformer:","L*cos(wx)+M*sin(wx)","en A*cos(wx+phi)","ou A*sin(wx+phi)","","$ cos(a+b) = cos(a)cos(b)","$ - sin(a)sin(b)","","$ sin(a+b) = cos(a)sin(b)","$ + sin(a)cos(b)","","#7 UNICITE ORDRE 2","","§P (Cauchy-Lipschitz):","L'§E §Z + w^2*y = 0","§A une §U §S f sur R","avec DEUX §Ns §Is.","","> §Ns possibles:","> { f(x0) = y0","> { f'(x0) = y1","","ou","","> { f(x0) = y0","> { f(x1) = y1","","@ Ex: 4§Z + pi^2*y = 0"," avec f(0.5) = sqrt(2)/2"," et f'(0.5) = 0",""," 1) w = pi/2"," f(x) = L*cos(pi*x/2)"," + M*sin(pi*x/2)",""," 2) f(0.5) = sqrt(2)/2"," L*cos(pi/4)+M*sin(pi/4)"," = sqrt(2)/2*(L+M)"," §T L+M = 1",""," 3) f'(0.5) = 0"," f'(x) = -L*pi/2*sin(..)"," + M*pi/2*cos(..)"," §T -L+M = 0",""," 4) Systeme:"," { L+M = 1"," { -L+M = 0"," => L = M = 0.5",""," 5) §S:"," f(x) = 0.5*cos(pi*x/2)"," + 0.5*sin(pi*x/2)","","=== FIN DU COURS ===",]defget_color(line):ifline.startswith("#"):returnTifline.startswith(">"):returnBLifline.startswith("$"):returnVifline.startswith("@"):return (200,100,0)returnBdefclean(line):iflen(line)>0andline[0]in"#>$@":returnline[1:].strip()returnlinedefshow_cours():lines=[]forlinCOURS:txt=decomp(l)# Couper les lignes trop longues
whilelen(txt)>31:lines.append((txt[:31],get_color(l)))txt=""+txt[31:]lines.append((clean(txt),get_color(l)))total=len(lines)scroll=0maxl=11whileTrue:fr(0,0,320,222,W)# Header
fr(0,0,320,20,(50,50,150))ds("COURS: Eq. Diff.",80,2,W,(50,50,150))# Lignes
y=24foriinrange(scroll,min(scroll+maxl,total)):txt,col=lines[i]ds(txt,5,y,col,W)y+=18# Scrollbar visuelle
iftotal>maxl:sbh=180*maxl//totalsby=22+180*scroll//totalfr(315,22,4,180,(220,220,220),W)fr(315,sby,4,sbh,(100,100,200),W)# Footer
fr(0,205,320,17,(240,240,240))pg=str(scroll//maxl+1)+"/"+str((total-1)//maxl+1)ds("[^v]scroll [<]quit "+pg,5,207,GR,(240,240,240))# Input
whileTrue:ifkeydown(K_UP):ifscroll>0:scroll-=1whilekeydown(K_UP):passbreakifkeydown(K_DOWN):ifscroll+maxl<total:scroll+=1whilekeydown(K_DOWN):passbreakifkeydown(K_BACK):returnifkeydown(K_OK):# Page down rapide
scroll=min(scroll+maxl,total-maxl)ifscroll<0:scroll=0whilekeydown(K_OK):passbreakdefmenu():whileTrue:fr(0,0,320,222,W)ds("COURS MATHS",100,20,(50,50,150),W)ds("Terminale STI2D",90,45,GR,W)ds("1. Eq. Differentielles",30,90,B,W)ds(" [OK] pour ouvrir",30,110,BL,W)ds("Taille: "+str(len(COURS))+" lignes",30,150,GR,W)ds("[BACK] quitter",30,190,GR,W)whileTrue:ifkeydown(K_OK):whilekeydown(K_OK):passshow_cours()breakifkeydown(K_BACK):returnmenu()
During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:
Ensure the proper functioning of the site (essential cookies); and
Track your browsing to send you personalized communications if you have created a professional account on the site and can be contacted (audience measurement cookies).
With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.