PHYS 408 HOMEWORK 5 SOLUTIONS

# X

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % calculate real part part of q, in terms of variable thickness x %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % q = ( M(1)*(-i*z0) + M(2) )/( M(3)*(-i*z0) + M(4) ); % % numerical constants w0 = 2E-1; lambda = 1064E-7; z0 = pi*(w0^2)/lambda; % symbolic calculation and simplification of z = Real(q) in terms of x z = simple( ( M(1,1).*M(2,1).*(z0.^2) + M(1,2).*M(2,2) )./( M(2,2).^2 + (M(2,1).^2).*(z0^2) ) ); % create script to invoke matlab ’solve’ routine to calculate x zchar = char(z); % convert to character class to invoke fprintf fid = fopen(’xsolver.m’,’w’); fprintf(fid,’solve(\’’’); for p = 1:length(zchar); fprintf(fid, ’%s’,zchar(p)); end; fprintf(fid,’=0.9*(-7.5)\’’)’); fclose(fid); 5...
View Full Document

## This document was uploaded on 03/11/2014 for the course PHYS 408 at University of British Columbia.

Ask a homework question - tutors are online