Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [Fp] = Fp_f(t)
- if (t >= 0 && t <= 100) then
- Fp = 100*t;
- elseif (t >= 100 && t <= 600) then
- Fp = 10000;
- elseif (t >= 600 && t <= 1100) then
- Fp = 10000 + 5000*sin(((t-600)*%pi)/100);
- elseif (t >= 1100 && t <= 1200) then
- Fp = (t-1200)^2;
- elseif (t >= 1200 && t <= 1800) then
- Fp = 0;
- end;
- endfunction;
- t=0:1:1800;
- Fp = feval(t,Fp_f);
- plot(t,Fp);
- xtitle("Propulsion Force as a function of time", "Time (s)", "Propulsion Force (N)");
- xs2gif(0,"Propulsion Force.gif");
- clf
- function [Ff] = Ff_f(v)
- if (v >= 0 && v <= 1) then
- Ff = K1*sqrt(v);
- elseif (v > 1) then
- Ff = K2*v^2;
- elseif (v < 0) then
- Ff = 0;
- //Alle voorwaarden voor Ff ifv de snelheid
- end;
- endfunction;
- v=0:1:20; K1 = 100; K2 = 70;
- Ff = feval(v,Ff_f);
- plot(v,Ff);
- xtitle("Friction Force as a function of the ship speed", "Ship Speed (m/s)", "Friction Force (N)");
- xs2gif(0,"Friction Force.gif");
- clf
- fsolve(5000,Ff_f)
- fsolve(12000,Ff_f)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement