0% found this document useful (0 votes)
41 views3 pages

L Norm Script: All All

The document describes using the L-norm inversion method to estimate temperature profiles from depth data with outliers and noise. It generates synthetic temperature and depth data, adds outliers and noise, then calculates the L1 through L4 and L-infinity norms to find the coefficients a and b that minimize each error function. Plots of the observed and predicted depth profiles using each L-norm coefficient set are presented and discussed.

Uploaded by

Radifant Taufik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views3 pages

L Norm Script: All All

The document describes using the L-norm inversion method to estimate temperature profiles from depth data with outliers and noise. It generates synthetic temperature and depth data, adds outliers and noise, then calculates the L1 through L4 and L-infinity norms to find the coefficients a and b that minimize each error function. Plots of the observed and predicted depth profiles using each L-norm coefficient set are presented and discussed.

Uploaded by

Radifant Taufik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

M Zofran Hilmy

03411540000023
Metode Inversi
L Norm
Script
clc e = dobs-dpre;
clear all abse = abs(e);
close all E1(i,j)=sum(abse);
E2(i,j)=sum(abse.^2);
N=30; E3(i,j)=sum(abse.^3);
zmin=0; E4(i,j)=sum(abse.^4);
zmax=50; Einf(i,j)=sum(abse.^20);
z = end
sort(random('Uniform',zmin,zmax,N,1) end
);
% find minimum error
% d = a + b*z + noise [Ep, p] = min(E1);
a=32.6067; %nilai suhu di permukaan [E1min, c1] = min(Ep);
b=0.9565; %nilai perubahan nilai r1 = p(c1);
suhu terhadap kedalaman a1 = amin+Da*(r1-1);
sd=5; b1 = bmin+Db*(c1-1);
dobs = dpre1 = a1 + b1*z;
a+b*z+random('Normal',0,sd,N,1);
dobsmin=min(dobs); [Ep, p] = min(E2);
dobsmax=max(dobs); [E2min, c2] = min(Ep);
batas=mean(dobs); r2 = p(c2);
a2 = amin+Da*(r2-1);
% outlier b2 = bmin+Db*(c2-1);
for i=1:4 dpre2 = a2 + b2*z;

dobs(1+i)=random('uniform',0,batas,1 [Ep, p] = min(E3);


,1); [E3min, c3] = min(Ep);
dobs(N- r3 = p(c3);
i)=random('uniform',batas,dobsmax,1, a3 = amin+Da*(r3-1);
1); b3 = bmin+Db*(c3-1);
end dpre3 = a3 + b3*z;

% grid [Ep, p] = min(E4);


Na=201; [E4min, c4] = min(Ep);
amin=0; r4 = p(c4);
Da = 0.1; a4 = amin+Da*(r4-1);
Nb=201; b4 = bmin+Db*(c4-1);
bmin=0; dpre4 = a4 + b4*z;
Db = 0.1;
[Ep, p] = min(Einf);
% L norm [Einfmin, cinf] = min(Ep);
E1 = zeros(Na,Nb); rinf = p(cinf);
E2 = zeros(Na,Nb); ainf = amin+Da*(rinf-1);
E3 = zeros(Na,Nb); binf = bmin+Db*(cinf-1);
E4 = zeros(Na,Nb); dpreinf = ainf + binf*z;
Einf = zeros(Na,Nb);
for i=[1:Na] disp(sprintf('1: a %f b %f', a1, b1
for j=[1:Nb] ));
ao = amin+Da*(i-1); disp(sprintf('1: a %f b %f', a2, b2
bo = bmin+Db*(j-1); ));
dpre = ao + bo*z;
M Zofran Hilmy
03411540000023
Metode Inversi
disp(sprintf('1: a %f b %f', a3, b3 axis( [pdmin, pdmax, 0, 60 ]' );
)); plot( dobs, z, 'ko', 'LineWidth',
disp(sprintf('1: a %f b %f', a4, b4 2);
)); plot( dpre1, z, 'r-', 'LineWidth',
disp(sprintf('1: a %f b %f', ainf, 2);
binf )); plot( dpre2, z, 'g-', 'LineWidth',
2);
% plot results plot( dpre3, z, 'm-', 'LineWidth',
figure(1); 2);
clf; plot( dpre4, z, 'c-', 'LineWidth',
2);
pdmin=0; plot( dpreinf, z, 'b-', 'LineWidth',
pdmax=100; 2);
xlabel('T');
ylabel('d');
axis ij legend('dobs','dpre1','dpre2','dpre3
set(gca,'LineWidth',2); ','dpre4','dpreinf')
hold on;

Flow Chart

Pembuatan Data
berupa kedalaman Pembuatan L-Norm
Pembuatan outlier
vs suhu dengan sebanyak 5
noise

Membuat minimum
Membuat a dan b
error untuk gradien Plot hasil data
untuk tiap L-Norm
L-Norm

Hasil Data

Nilai a dan b hasil L norm


M Zofran Hilmy
03411540000023
Metode Inversi
Plot Grafik

Pembahasan
Data suhu sebanyak 30 data dengan nilai awal 32.6067 dan pertambahan 0.9565, nilai
kedalaman berkisar dari 0-50 disertai noise yang berkisar dari 0 sampai 5. Outlier dibuat sebanyak
8 nilai dengan 4 angka dibawah rata rata dan 4 diatas rata rata data. Dilakukan nilai L norm
sebanyak 5 yaitu L norm pangkat 1, 2, 3, 4 dan 20. L norm pangkat 20 sebagai infinity. Minimum
error dibuat untuk mengetahui nilai a dan b pada tiap garis L norm. Plot grafik menghasilkan 5
buah garis L norm sehingga terlihat perubahan tiap L norm karena data yang sangat beragam.

You might also like