How to solve the dispersion relation in a symbolic expression?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
László Arany
am 14 Apr. 2014
Kommentiert: Mischa Kim
am 14 Apr. 2014
I have a symbolic expression along the lines:
H = @(f) a*k*f;
where a is a constant. f is the rotational frequency and k is the wave number, which are connected through the dispersion relation:
f^2 = g*k*tanh(k*S)
where g = 9.81 is the gravitational constant and S = 20 is the water depth. I would like to plot H(f), how can I evaluate the non-linear expression k=k(f) within the symbolic expression?
Many thanks.
0 Kommentare
Akzeptierte Antwort
Mischa Kim
am 14 Apr. 2014
Bearbeitet: Mischa Kim
am 14 Apr. 2014
Hello László, what about
g = 9.81; S = 20; a = 1;
H = @(k) a*k.*sqrt(g*k.*tanh(k*S));
k = -2:0.1:2;
plot(k,H(k))
Of course, you can first define H and f separately, if you need/want to.
2 Kommentare
Mischa Kim
am 14 Apr. 2014
I don't think I follow. Are you trying to solve a nonlinear equation of the form H(f) = 0 using anonymous functions? If so, simply define H as shown above and then use fsolve(H,f0), where f0 is the starting guess.
Weitere Antworten (0)
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!