Loulita
Hello everybody
I have the following problem
I'm looking for the equation y (t) (which is unknown and this equation can also y (t) 2 high or high 3 ..). I need to calculate the minimum and ploten, the curve is to run at X-axis [0 to t_end] and Y-axis [0 to 5].
I have tried the following but unfortunately always comes "ERROR" out. Can anybody help me.
Thanks in advance.
xdel();
t= linspace(0,0.05,50);
k=10; // t- Achse in 10 Teile zerlegen
//y(k)*(t(k)-t(k-1): meine Gleichung: Unbekannt
//y(k=0)*(t(k)-t(k-1)=0; // Zweite Randbedingung y(t=0)=0
S=y(k=10)*(t(k)-t(k-1)=5; // Erste Randbedingung y(t=t_end)=5
for k=10:-1:1; // Rückwärt zählen
sum=S+y(k)*(t(k)-t(k-1);
end
//Optimierung: minimum suchen
y=@(k)sum;
[k,fval]= fminbnd(y,5,0);
I have the following problem
I'm looking for the equation y (t) (which is unknown and this equation can also y (t) 2 high or high 3 ..). I need to calculate the minimum and ploten, the curve is to run at X-axis [0 to t_end] and Y-axis [0 to 5].
I have tried the following but unfortunately always comes "ERROR" out. Can anybody help me.
Thanks in advance.
xdel();
t= linspace(0,0.05,50);
k=10; // t- Achse in 10 Teile zerlegen
//y(k)*(t(k)-t(k-1): meine Gleichung: Unbekannt
//y(k=0)*(t(k)-t(k-1)=0; // Zweite Randbedingung y(t=0)=0
S=y(k=10)*(t(k)-t(k-1)=5; // Erste Randbedingung y(t=t_end)=5
for k=10:-1:1; // Rückwärt zählen
sum=S+y(k)*(t(k)-t(k-1);
end
//Optimierung: minimum suchen
y=@(k)sum;
[k,fval]= fminbnd(y,5,0);