close all; clc; clear all; %% calculated Z with equation V = [6:-0.07:-3]; f=10.^V; w=f*2*pi; %Parameter definition R1=10; R2=7; R3=12; R4=8; C2=1000*10^-6; C3=5*10^-6; C4=75*10^-6; Z=R1+(1./(1i.*w.*C2+(1./(R2+(1./(1i.*w.*C3+(1./(R3+(1./((1./R4)+1i.*w.*C4)))))))))); Zreal=real(Z); Zim=imag(Z); Zk= 1./(1./(Z-R1)-1i.*C2.*w); Zkre=real(Zk); Zkim=imag(Zk); Zkabs=abs(Zk); %% imported Z from txt data_import2; Z0=Zreal0+1i.*Zimag0; w0=f0*2*pi; f01=f0.'; w01=f01*2*pi; Z01=Z0.'; Zk00= 1./(1./(Z01-R1)-1i.*C2.*w01);% Zk00re=real(Zk00); Zk00im=imag(Zk00); Zk00abs=abs(Zk00); %% comparison M=[f;f01;Z;Z01;Zk;Zk00]; comp=f-f01; comp2=Z-Z01; Mcomp=[f;f01;comp]; Mcomp2=[Z;Z01;comp2]; semilogx(f,Zkabs,f0,Zk00abs);