Ömodel 0 0 library_path 'F:\bond graph'; type Mainmodel end; implementation bg submodels omega 270 195 library_path 'Bond Graph'; knot OneJunction ports rotation knot duplicatable none p [1]; signal knot out flow [1]; restrictions causality constraint one_out p; end; icon bg bottom figures text '1' 270 195 18 bold; end; implementation eq equations sum (direct (p.e)) = 0; equal (collect (p.f)); flow = first (p.f); implementation_end; Debit_pompe 480 195 library_path 'Bond Graph'; knot OneJunction ports hydraulic knot duplicatable none p [1]; signal knot out flow [1]; restrictions causality constraint one_out p; end; icon bg bottom figures text '1' 480 195 18 bold; end; implementation eq equations sum (direct (p.e)) = 0; equal (collect (p.f)); flow = first (p.f); implementation_end; Debit_total 675 195 library_path 'Bond Graph'; knot OneJunction ports hydraulic knot duplicatable none p [1]; signal knot out flow [1]; restrictions causality constraint one_out p; end; icon bg bottom figures text '1' 675 195 18 bold; end; implementation eq equations sum (direct (p.e)) = 0; equal (collect (p.f)); flow = first (p.f); implementation_end; Pression 585 195 library_path 'Bond Graph'; knot ZeroJunction ports hydraulic knot duplicatable none p [1]; signal knot out effort [1]; restrictions causality constraint one_in p; end; icon bg bottom figures text '0' 585 195 18 bold; end; implementation eq equations sum (direct (p.f)) = 0; equal (collect (p.e)); effort = first (p.e); implementation_end; pertes_chambres 480 97.5 library_path 'Bond Graph'; type R ports hydraulic in p; parameters real r = 0.1; end; icon bg top figures text 'R' 480 97.5 18 bold; end; implementation eq equations p.e = r * p.f; implementation_end; fuites 585 97.5 library_path 'Bond Graph'; type R ports hydraulic in p; parameters real r = 0.01; end; icon bg top figures text 'R' 585 97.5 18 bold; end; implementation eq equations p.e = r * p.f; implementation_end; pertes_orifices 675 97.5 library_path 'Bond Graph'; type R ports hydraulic in p; parameters real r = 0.1; end; icon bg top figures text 'R' 675 97.5 18 bold; end; implementation eq equations p.e = r * p.f; implementation_end; frottement_engrenages 270 97.5 library_path 'Bond Graph'; type R ports rotation in p; parameters real r = 0.1; end; icon bg top figures text 'R' 270 97.5 18 bold; end; implementation eq equations p.e = r * p.f; implementation_end; K 375 195 library_path 'Bond Graph'; type TF ports power in p1; power out p2; restrictions causality constraint not_equal p1 p2; parameters real r = 0.0002; end; icon bg bottom figures text 'TF' 375 195 18 bold; end; implementation eq equations p1.e = r * p2.e; p2.f = r * p1.f; implementation_end; inertie 270 307.5 library_path 'Bond Graph'; type I ports rotation in p; signal out state; restrictions causality preferred in p; parameters real i = 0.01; end; icon bg bottom figures text 'I' 270 307.5 18 bold; end; implementation eq equations state = int(p.e); p.f = state / i; implementation_end; pression_sortie 757.5 135 library_path 'Bond Graph'; knot ZeroJunction ports hydraulic knot duplicatable none p [1]; signal knot out effort [1]; restrictions causality constraint one_in p; end; icon bg top figures text '0' 757.5 135 18 bold; end; implementation eq equations sum (direct (p.f)) = 0; equal (collect (p.e)); effort = first (p.e); implementation_end; Pe 855 247.5 library_path 'Bond Graph'; type Se ports hydraulic out p; restrictions causality fixed out p; parameters real effort = 100000.0; end; icon bg bottom figures text 'Se' 855 247.5 18 bold; end; implementation eq variables real flow; equations p.e = effort; flow = p.f; implementation_end; pression_entree 757.5 247.5 library_path 'Bond Graph'; knot ZeroJunction ports hydraulic knot duplicatable none p [1]; signal knot out effort [1]; restrictions causality constraint one_in p; end; icon bg bottom figures text '0' 757.5 247.5 18 bold; end; implementation eq equations sum (direct (p.f)) = 0; equal (collect (p.e)); effort = first (p.e); implementation_end; couple 157.5 195 library_path 'Bond Graph'; type Se ports rotation out p; restrictions causality fixed out p; parameters real effort = 50.0; end; icon bg bottom figures text 'Se' 157.5 195 18 bold; end; implementation eq variables real flow; equations p.e = effort; flow = p.f; implementation_end; Ps 855 135 library_path 'Bond Graph'; type MSe ports power out p; signal in effort; restrictions causality fixed out p; end; icon bg bottom figures text 'MSe' 855 135 18 bold; end; implementation eq variables real flow; equations p.e = effort; flow = p.f; implementation_end; variation_pression 952.5 135 library_path 'Signal\Sources'; type 'WaveGenerator-Square' ports signal out output; parameters real amplitude = 500000.0; real omega = 10.0 {rad/s}; end; icon bg bottom figures rectangle 937.6 120 967.4 150 fill 15132390; line 941.3 123.7 941.2 148.3 fill 0; line 939.3 146.3 963.7 146.3 fill 0; line 941.3 146.3 945 146.3 945 135 color 16711680 fill 0; line 952.5 135 945 135 952.5 135 color 16711680 fill 0; line 952.5 146.3 952.5 135 952.5 146.3 color 16711680 fill 0; line 960 135 960 146.3 960 135 color 16711680 fill 0; line 963.7 135.1 959.7 135.1 color 16711680 fill 0; line 952.5 146.3 960 146.3 color 16711680 fill 0; end; implementation eq variables real hidden s, half; boolean hidden change; equations "calculate at least 2 points per period (just after the change in sign)" half = pi / omega; change = frequencyevent (half, 1e-15); "calculate the square wave" s = sign (sin (omega * time)); output = if( s == 0 ) then amplitude else (amplitude / 2) * (s + 1) end; implementation_end; end; connections omega\p => frottement_engrenages\p; omega\p => inertie\p; omega\p => K\p1; K\p2 => Debit_pompe\p; Debit_pompe\p => pertes_chambres\p; Debit_pompe\p => Pression\p; Pression\p => fuites\p; Pression\p => Debit_total\p; Debit_total\p => pertes_orifices\p; Pe\p => pression_entree\p; pression_entree\p => Debit_total\p; Debit_total\p => pression_sortie\p; couple\p => omega\p; Ps\p => pression_sortie\p; variation_pression\output -> Ps\effort; end; figures image 'F:\bond graph\php15.jpg' 356 244 246 292; text 'Pompe Haute Pression à engrenage' 472.5 22.5 color 255 'Comic Sans MS' 26 bold; image 'F:\bond graph\php15_2.jpg' 644 301 180 235; implementation_end;