-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathK1_K4.m
63 lines (51 loc) · 1.08 KB
/
K1_K4.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
clear all;
close all;
syms x K y dy;
y=3435/log((10000*x)/((5-x)*0.0992));
dy=diff(y);
K=symfun(abs((x*dy)/y),(x));
da=0.0000001;
a=da;
k=zeros(2000,2);
for i=1:length(k)
k(i,1)=a;
k(i,2)=K(a);
a=a+da;
end
c=zeros(length(k),1);
c(:)=1;
scrsz=get(0,'Screensize');
figure('Position',[1 scrsz(4) scrsz(3) scrsz(4)])
subplot(2,1,1);
plot(k(:,1),k(:,2),k(:,1),c,'r');
xlim([0 0.00019]);
ylim([0 1.9]);
xlabel('Voltage / V');
ylabel('Condition');
title('Condition of the temerature algorithm');
legend('Condition','Boundary value','Location','Best');
grid on;
syms x K y dy;
y=3435/log(x);
dy=diff(y);
K=symfun(abs((x*dy)/y),(x));
dV=0.0000001;
V=dV;
k=zeros(2000,2);
for i=1:length(k)
R=10000*V/((5-V)*0.0992);
k(i,1)=V;
k(i,2)=K(R);
V=V+dV;
end
c=zeros(length(k),1);
c(:)=1;
subplot(2,1,2);
plot(k(:,1),k(:,2),k(:,1),c,'r');
xlim([0 0.00019]);
ylim([0 1.9]);
xlabel('Voltage / V');
ylabel('K4');
title('Condition of the 4th step of the temerature algorithm --- Range: 0.1 uV - 0.2 mV');
legend('Condition','Boundary value','Location','Northeast');
grid on;