Code covered by the BSD License  

Highlights from
Logiciels temps réel

Logiciels temps réel

by

 

Real-time software concerning the domains of the signal processing, feedback and regulation

simulation_ph(R0,C0,R1,R2,RP,CP,C1,C2,A0,FT,S,VCC,RID,RS,normalisation,type_etude)
function simulation_ph(R0,C0,R1,R2,RP,CP,C1,C2,A0,FT,S,VCC,RID,RS,normalisation,type_etude)

simulink;
open_system('etude_filtres.mdl');
nb_etage=length(R1);
if normalisation==0
    nom='schema_filtre';
else
    nom='schema_filtre_normalise';
end;
open_system(nom);
nettoyage;
disposition=[14    94   492   381];
set_param(nom,'location',disposition);
tailleh=0;
taillev=0;
set_param(gcs,'AlgebraicLoopMsg','none','RelTol','1e-4','Solver','ode15s','StopTime','0.1');
VCC_s=num2str(VCC);
S_s=num2str(S);
FT_s=num2str(FT);
A0_s=num2str(A0);
C0_s=num2str(C0);
RID_s=num2str(RID);
RS_s=num2str(RS);
dest=[nom,'/In1'];
add_block('etude_filtres/In1',dest,'position',[15,128,45,142]);
origine='In1/1';
for etage=1:1:nb_etage
    etage_chaine=num2str(etage);
    dest=[nom,'/etage_numero_',etage_chaine];   
    emplacement=[80+350*rem(etage-1,3),15+255*floor((etage-1)/3),395+350*rem(etage-1,3),255+255*floor((etage-1)/3)];
    tailleh=max(tailleh,emplacement(3));
    taillev=max(taillev,emplacement(4));
    if isnan(R1(etage))
        add_block('etude_filtres/Structures_filtres/PH_Ordre1',dest,'position',emplacement);      
        R0_s=num2str(R2(etage));
        chaine=[R0_s,'|',C0_s,'|',A0_s,'|',FT_s,'|',S_s,'|',VCC_s,'|',RID_s,'|',RS_s];
        set_param(gcb,'MaskValueString',chaine);
    else        
        add_block('etude_filtres/Structures_filtres/PH_Sallen_Key',dest,'position',emplacement);
        R1_s=num2str(R1(etage));
        R2_s=num2str(R2(etage));
        C1_s=num2str(C1(etage));
        C2_s=num2str(C2(etage));
        CP_s=num2str(CP(etage));
        chaine=[C1_s,'|',C2_s,'|',CP_s,'|',R1_s,'|',R2_s,'|',A0_s,'|',FT_s,'|',S_s,'|',VCC_s,'|',RID_s,'|',RS_s];
        set_param(gcb,'MaskValueString',chaine);
    end;  
    suivant=['etage_numero_',etage_chaine,'/1']   ;
    add_line(gcs,origine,suivant, 'autorouting','on');
     origine=suivant;
end;
dest=[nom,'/Out1'];
place=[emplacement(3)+40,(emplacement(2)+emplacement(4))/2,emplacement(3)+70,14+(emplacement(2)+emplacement(4))/2];
add_block('etude_filtres/Out1',dest,'position',place);
 add_line(gcs,origine,'Out1/1', 'autorouting','on');
 if type_etude<9
    dest=[nom,'/Bode_filtre'];
    place=[80,place(4)+150,80+268,place(4)+150+69];
    add_block('etude_filtres/Bode_filtre',dest,'position',place);
    disposition(3)=disposition(3)+tailleh;
    disposition(4)=disposition(4)+taillev;
    set_param(gcs,'location',disposition);
 elseif type_etude==9
     dest=[nom,'/MonteCarlo'];
    place=[80,place(4)+150,80+268,place(4)+150+69];
    add_block('etude_filtres/MonteCarlo',dest,'position',place);
    disposition(3)=disposition(3)+tailleh;
    disposition(4)=disposition(4)+taillev;
    set_param(gcs,'location',disposition);
 else
     dest=[nom,'/sensibilite'];
    place=[80,place(4)+150,80+268,place(4)+150+69];
    add_block('etude_filtres/Sensibilite',dest,'position',place);
    disposition(3)=disposition(3)+tailleh;
    disposition(4)=disposition(4)+taillev;
    set_param(gcs,'location',disposition);    
 end;
set_param(gcs,'location',ecran,'zoomfactor','fitsystem')



Contact us