Download presentation
Presentation is loading. Please wait.
Published byEliseo Gillam Modified over 9 years ago
1
MATLAB: toolboxes, technical calculations
2
Numeric integration (1) Evaluating integral: computing a surface below a curve
3
function y = sinc( x, a) % the function has to return a vector of functional values y % for the vector of input numbers x y = log( x+a).* sin( x)./( x+0.1); 1.Creating m-file, which contains the integrated function Numeric integration (2)
4
function out = integ( low, up) out = quadl( 'sinc', low, up, 1e-5, [], 0.5); 2.Performing integration by standard m-function quadl Numeric integration (3)
5
syms x a l u y = int( log( x+a).* sin( x)./( x+0.1), x, l, u) y = simple( y) pretty ( y) Symbolic integration Symbolic Math Toolbox: m-function int
6
h = 0.01; % sampling step y = sinc( 0:h:1, 0.5); y1 = diff( y) / h; y2a = diff( y1) / h; y2b = diff( y, 2) / h^2; Numeric differencing (1) Differencing performed by standard m-function diff
7
Numeric differencing (2)
8
syms x a y1 = diff( log( x+a).* sin( x)./( x+0.1), 'x', 1) y1 = simple( y1) pretty ( y1) y2 = diff( log( x+a).* sin( x)./( x+0.1), 'x', 2) y2 = simple( y2) pretty( y2) Symbolic differencing Symbolic Math Toolbox: m-function diff
9
Optimization Toolbox (1) Searching for such A, B, h, r so that the input impedance is Z = (200 + j 0) on the frequency f = 30 GHz
10
Optimization Toolbox (2) 1.Formulating fitness function: how does the optimized structure fit demands
11
Optimization Toolbox (3) 2.Creating m-file, which contains the fitness function function out = mstrip( x) global net Tmax Rd Xd Z = Tmax * sim( net, x); % input impedance of the dipole out = ((Rd-Z(1,:)).*(Rd-Z(1,:)) + (Xd-Z(2,:)).*(Xd-Z(2,:)))';
12
Optimization Toolbox (4) 3.Performing optimization by Optimization Toolbox m-function fminunc function x = toolbox global net Tmax Rd Xd load dip_616; % loading the antenna model Rd = 200; % desired value of input resistance Xd = 0; % desired value of input reactance x0 = [ 5.00; 0.05; 2.00; 1.25]; % A, B, eps, h x = fminunc('mstrip', x0)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.