简体   繁体   English

如何在MATLAB中绘制𝛽−𝑤图?

[英]How to plot 𝛽−𝑤 diagram in MATLAB?

I am trying to plot the 𝛽−𝑤 diagrams for the given phase constants using MATLAB , but although I have look at many web pages, there is not a similar example plotting 𝛽−𝑤 diagram in MATLAB.我正在尝试使用MATLAB为给定的相位常数绘制𝛽−𝑤图,但是尽管我查看了很多网页,但在 MATLAB 中没有绘制 𝛽−𝑤 图的类似示例。 Could you please clarify me how to proceed by giving some examples regarding to this problem?您能否通过提供一些有关此问题的示例来阐明如何进行? Any help would really be appreciated.任何帮助将不胜感激。

Plot range: 𝑓=10𝑀ℎ𝑧−10𝐺𝐻𝑧剧情范围: 𝑓=10𝑀ℎ𝑧−10𝐺𝐻𝑧

w : Angular frequency w :角频率

wc : A constant Angular frequency wc :一个恒定的角频率

Parameters for 1st: 𝑤𝑐1=0.2∗𝑤, 𝑤𝑐2=0.4∗𝑤, 𝑤𝑐3=0.6∗𝑤, 𝑤𝑐4=0.8∗𝑤 , ɛ1=1* ɛ0, μ= μ0第一个参数: 𝑤𝑐1=0.2∗𝑤, 𝑤𝑐2=0.4∗𝑤, 𝑤𝑐3=0.6∗𝑤, 𝑤𝑐4=0.8∗𝑤 , ɛ1=1* μɛ1=1* μɛ0

Parameters for 1st: a1=0.08636cm, a2=0.8636cm, a3=2.286cm, a4=29.21cm, ɛ1=1* ɛ0, μ= μ0第一个参数: a1=0.08636cm, a2=0.8636cm, a3=2.286cm, a4=29.21cm, ɛ1=1* ɛ0, μ= μ0

在此处输入图片说明

As the OP asked, this is a sort of Matlab code.正如 OP 所问,这是一种 Matlab 代码。 I assume to map the plot of B with w in range [1,100] (but values can be changed) First case has wc has 3 different cases, 4 different plot of B (B1,B2, B3 and B4) will be mapped in four different colors我假设将 B 的图与范围 [1,100] 中的 w 进行映射(但值可以更改)第一种情况有 wc 有 3 个不同的情况,B 的 4 个不同图(B1、B2、B3 和 B4)将被映射为四个不同的颜色

    %constant inizialization
    mu = 1.2566E-6;
    e = 1;
    start_f = 10000; %10 MHz start frequency range
    end_f = 10000000; %10 GHz end frequency range 
    step = 10 %plot the function every "step" Hz (ONLY INTEGER NUMBERS ALLOWED)
    k = 1;
    % function of B example: B = w*sqrt(mu*e)*sqrt(1-((wc^2)/w));

    %vectors initialization to avoid the "consider preallocation" Matlab not-critical warning
    range_f = ceil((end_f - start_f)/step) + 1;
    w = zeros(range_f);
    B1 = zeros(range_f);
    B2 = zeros(range_f);
    B3 = zeros(range_f);
    B4 = zeros(range_f);

    for i=start_f:step:end_f %from 10 MHz to 10 GHz with steps of 1 Hz
    %store i in the i-cell of vector w
      w(k) = i;
%values that need to be updated every time
      w1 = 0.2*w(i);
      w2 = 0.4*w(i); 
      w3 = 0.6*w(i);
      w4 = 0.8*w(i); 
%four different results of B
      B1(i) = w(i)*sqrt(mu*e)*sqrt(1-((w1^2)/w(i)));
      B2(i) = w(i)*sqrt(mu*e)*sqrt(1-((w2^2)/w(i)));
      B3(i) = w(i)*sqrt(mu*e)*sqrt(1-((w3^2)/w(i)));
      B4(i) = w(i)*sqrt(mu*e)*sqrt(1-((w4^2)/w(i)));

      k = k+1;
    end
%plot the 4 lines    
    plot(w,B1,'r') %red line of B1 = f(w) 
    hold on
    plot(w,B2,'g') %green line of B2 = f(w) 
    hold on
    plot(w,B3,'b') %blue line of B3 = f(w) 
    hold on
    plot(w,B4,'k') %black line of B4 = f(w) 

4 different cases have to be represented with 4 plot (in this example they have been overlayed). 4 个不同的案例必须用 4 个图来表示(在这个例子中,它们被叠加了)。

The last notation can be done in the same way (you have 4 constant parameters a1, a2 etc.) that does not depends from w this time.最后一个符号可以用同样的方式完成(你有 4 个常量参数 a1、a2 等),这次不依赖于 w。 So所以

  B1a(i) = sqrt((w(i)^2)*mu*e - ((pi^2)/a1)));
  B2a(i) = sqrt((w(i)^2)*mu*e - ((pi^2)/a1)));
  B3a(i) = sqrt((w(i)^2)*mu*e - ((pi^2)/a1)));
  B4a(i) = sqrt((w(i)^2)*mu*e - ((pi^2)/a1)));

If some errors (due to "fast" writing) occurs to you, report them in comments and I will correct and update the code如果您遇到一些错误(由于“快速”编写),请在评论中报告,我将更正和更新代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM