plotting graph using symbolic equation

2 views (last 30 days)
grace lim
grace lim on 19 Mar 2022
Answered: Star Strider on 19 Mar 2022
syms h11 h12 h21 h22 ZL
f=1000 to 1MHz
Zin=h11-(h12*h21)/(h22+(1/ZL)) %equation to plot
simplify(Zin)
pretty(Zin)
Avh=-h21/(Zin*(h22+(1/ZL)))
simplify(Avh)
fplot(f,Avh, 'b-', 'LineWidth', 2)
xlabel('Frequency', 'FontSize', 20);
ylabel('Gain Av', 'FontSize', 20);
title('Gain vs Frequency', 'FontSize', 20);
i need help to plot Av vs frequency symbolically
range of frequency 1KHz to 1MHz,
this is the equation to solve
Zin=h11-(h12*h21)/(h22+(1/ZL)) %equation to plot
simplify(Zin)
pretty(Zin)
Avh=-h21/(Zin*(h22+(1/ZL)))
simplify(Avh)

Answers (2)

Torsten
Torsten on 19 Mar 2022
From what you wrote, there is no relation between f and Avh.
Can you write down Avh as a function of f so that - given numerical values for f - you directly get numerical values for Avh ?

Star Strider
Star Strider on 19 Mar 2022
None of the variables are explicit functions of frequency. They must be functions of frequency and have all the other values defined numerically for this to work.
syms h11 h12 h21 h22 ZL
f=[1000 1E+6];
Zin=h11-(h12*h21)/(h22+(1/ZL)) %equation to plot
Zin = 
simplify(Zin)
ans = 
pretty(Zin)
h12 h21 h11 - -------- 1 h22 + -- ZL
Avh=-h21/(Zin*(h22+(1/ZL)))
Avh = 
simplify(Avh,500)
ans = 
figure
fplot(Avh,f, 'b-', 'LineWidth', 2) % The Frequency Range Vector 'f' Must Be The Second Argument In 'fplot'
Error using fplot>singleFplot
Input must be a function or functions of a single variable.

Error in fplot>@(f)singleFplot(cax,{f},limits,extraOpts,args) (line 200)
hObj = cellfun(@(f) singleFplot(cax,{f},limits,extraOpts,args),fn{1},'UniformOutput',false);

Error in fplot>vectorizeFplot (line 200)
hObj = cellfun(@(f) singleFplot(cax,{f},limits,extraOpts,args),fn{1},'UniformOutput',false);

Error in fplot (line 166)
hObj = vectorizeFplot(cax,fn,limits,extraOpts,args);
xlabel('Frequency', 'FontSize', 20);
ylabel('Gain Av', 'FontSize', 20);
title('Gain vs Frequency', 'FontSize', 20);
% i need help to plot Av vs frequency symbolically
% range of frequency 1KHz to 1MHz,
% this is the equation to solve
Zin=h11-(h12*h21)/(h22+(1/ZL)) %equation to plot
simplify(Zin)
pretty(Zin)
Avh=-h21/(Zin*(h22+(1/ZL)))
simplify(Avh)
.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!