Programme Matlab
Répondre à la discussion
Affichage des résultats 1 à 5 sur 5

Programme Matlab



  1. #1
    Mathieu37000

    Programme Matlab


    ------

    Bonjour,

    Je cherche à résoudre deux problèmes via le logiciel Matlab,

    Nom : Capture d’écran 2020-06-17 à 14.08.57.jpg
Affichages : 87
Taille : 123,2 Ko

    Débutant en Matlab, je ne sais pas trop par ou me lancer, je pensais à un fichier springb

    Auriez vous des idées ?

    Merci d'avance,

    cordialement,

    Mathieu

    -----

  2. #2
    umfred

    Re : Programme Matlab

    déjà, on te propose la fonction ode23, commence par regarder ça. Ensuite, l'utilisation de plot pour tracer les courbes devrait suffire dans un premier temps.

  3. #3
    Mathieu37000

    Re : Programme Matlab

    Avec l'aide de Matlab, j'ai quelque chose comme ça pour l'exo 1 :


    function yp=springb(t,w) ;


    yp(1)*=(2-0,01*y(2))*y(1)
    yp(2) =(-1+0,01*y(1))*y(2)



    t0*=0*;
    tfinal=25*;
    y0=[100,400]*;
    [t,y]=ode23(@lokta,[t0,tfinal],y0)*;

    plot(t,y)*
    title(‘Lapin/Renard Population Over Time’)
    xlabel(‘t’)*;
    ylabel(‘Population’)
    legend(‘lapin’,’renard’)


    lokta.m
    function yp=lokta(t,y)
    yp=diag([2-0,01*y(2), -1+ .01*y(1)])*y;

    Mais ce n'est apparemment pas encore ça ^^

  4. #4
    Mathieu37000

    Re : Programme Matlab

    Pour le premier, j'ai cela :


    t0 =0 ;
    tfinal=25 ;
    y0=[100,400] ;
    [t,y]=ode23(@springb,[t0,tfinal],y0)
    plot(t,y);
    title('Lapin/Renard Population Over Time')
    xlabel('t')*
    ylabel('Population');
    legend('lapin','renard','Locat ion','North');
    *
    *
    Fichier lokta *:
    *
    function yp = springb(t,y);
    alpha = 0.01;
    yp = zeros(size(y));
    *
    yp(1) =(2-alpha*y(2))*y(1);
    yp(2) =(-1+alpha*y(1))*y(2);
    end


    Ca a l'air de bien fonctionner cette fois-ci.

    Cependant, pour le deuxième exercice, je ne sais pas trop par où commencer ?

  5. A voir en vidéo sur Futura
  6. #5
    Mathieu37000

    Re : Programme Matlab

    x_z_vac=dsolve('D2x=0', 'D2z=-g', 'x(0)=0', 'Dx(0)=v0*cos(theta*pi/180)', 'z(0)=h', 'Dz(0‡=v0*sin(theta*pi/180)', 't');
    xt=x_z_vac.x
    zt=x_z_vac.z
    g=9.8;
    h=1;
    theta=15;
    v0=25;
    xt=vectorioze(xt);
    zt=(vectorize(zt));
    t=linspace(0,1.5,200);
    xt=eval(xt);
    zt=eval(zt);
    z_i=find(zt==min(abs(zt)));
    touch_gr=xt(z_i);
    t_touch=t(z_i);
    plot(xt, zt), grid on xlim([0, touch, gr])†;


    Pour le deuxième pour l'instant, mais je suis bloqué, si quelqu'un a une idée ?

Discussions similaires

  1. Programme E-HOG matlab
    Par invite19a934ea dans le forum Logiciel - Software - Open Source
    Réponses: 0
    Dernier message: 29/10/2014, 12h46
  2. programme matlab
    Par said76 dans le forum Technologies
    Réponses: 0
    Dernier message: 22/02/2011, 18h39
  3. programme matlab
    Par invitea5ac09f5 dans le forum Logiciel - Software - Open Source
    Réponses: 2
    Dernier message: 30/06/2008, 19h31
  4. Programme Matlab
    Par invite473739cb dans le forum Logiciel - Software - Open Source
    Réponses: 1
    Dernier message: 15/04/2008, 14h13
  5. programme matlab
    Par invite33b8bd7f dans le forum Logiciel - Software - Open Source
    Réponses: 2
    Dernier message: 18/08/2007, 16h13