0

I have to solve this equation

(tan(qh))/(tan(ph))=-(4k^2 pq)/(q^2-k^2)^2 

here

d = 6.35;
h = d/2;
ct = 3076.4;
cl = 6207.7;

I want to give k values and each k value I get many omega (w) values. Just like sin(x)=0 means x values are nπ I tried in this way.

syms w
d = 0.0065;
h = d/2;
ct = 3.0764;
cl = 6.2077;
k = 1:50:1000;
for i=1:length(k)
    p = sqrt((w/cl)^2-k(i)^2);  % p
    q = sqrt((w/ct)^2-k(i)^2);  % q

    f = (tan(q*h)*(q^2-k(i)^2)^2)==-(4*k(i)^2*p*q*tan(p*h));

z = zeros(1,30);
    for j=1:30
        z(j) = vpasolve(f,w,[0 1000],'Random',true);
    end
    z=z(z>=0);
    b = double(z);
    c = unique(b);
    cp = c/k(i);  %phase velocity
    f = c/(2*pi); %frequency
    plot(f,cp,'bo')
    hold on
end

In my case, answers are not matching with this image. My answers are in 10^-18 that is too small.

enter image description here

citation for this image. pg#7-9

https://smartech.gatech.edu/handle/1853/37158

Raza Mehdi
  • 35
  • 7
  • 3
    Would you please [edit] your question to include the error you get? – SecretAgentMan Jan 31 '20 at 13:55
  • I would reduce the example in your question to a [minimal](https://stackoverflow.com/help/minimal-reproducible-example) one. Perhaps in the process you will discover why you ran into the error. As well, a minimal example attracts answer more and quicker. – Argyll Feb 03 '20 at 09:36
  • What is `z`, where is it declared? What is the return format of `vpasolve`? Is it just a number, or a tuple, or something completely different? – Lutz Lehmann Feb 03 '20 at 17:43
  • z will be a number or array that we'll get after solving equation and I think we don't need return function for vpasolve because I see matlab documentation and we write in this way. @LutzLehmann – Raza Mehdi Feb 04 '20 at 01:03
  • What happens if vpasolve does not find a solution? – Lutz Lehmann Feb 04 '20 at 08:58
  • Thanks @LutzLehmann. I have fixed this error by fixing brackets but now new problem has occurred, my answers don't match with original graph. My answers are in 10^-20 but actual answers are not small. So if you can do that please tell me that my strategy to solve above equation by built-in function is right or wrong? Otherwise I try something different. – Raza Mehdi Feb 05 '20 at 09:28
  • 1
    Could you add a section to the answer on what exactly you changed to get this progress? It is considered bad form to change the original question substantially, that is, apart from fixing spelling errors and the like, so it is better to extend the text. – Lutz Lehmann Feb 05 '20 at 09:34
  • 2
    Could you then also please cite the source of the image, or at least also add an image of the equations from that source so that the formulas here can be checked for typos? // Why do you use the symbolic toolkit, and not a normal function with `fsolve`? With that I get some more roots close to 3 and 5, but nothing close to the diagram. – Lutz Lehmann Feb 06 '20 at 10:41
  • Since I have used vpasolve for numerical equation but not fsolve. In matlab documentation fsolve is used for system of equations but in my case it's a single equation. So can you share your fsolve code in which you are getting answers close 3 and 5 because in my case, I am not even close to that numbers. – Raza Mehdi Feb 07 '20 at 03:32

0 Answers0