-
Notifications
You must be signed in to change notification settings - Fork 0
/
K4.m
101 lines (80 loc) · 1.65 KB
/
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
% Krel(f,x) = abs(x*f'(x)/f(x))
clear all;
close all;
syms x K y dy;
y=3435/log(x);
dy=diff(y);
K=symfun(abs((x*dy)/y),(x));
da=0.01;
a=da;
k=zeros(499,2);
for i=1:length(k)-400
k(i,1)=a;
k(i,2)=K(a);
a=a+da;
end
a=1.01;
for i=100: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(3,1,1);
plot(k(:,1),k(:,2),k(:,1),c,'r');
ylim([0 5]);
xlabel('Resistance / Ohm');
ylabel('K4');
title('Condition of the 4th step of the temerature algorithm');
legend('Condition','Boundary value','Location','Northeast');
grid on;
syms x K y dy;
y=3435/log(x);
dy=diff(y);
K=symfun(abs((x*dy)/y),(x));
dV=0.01;
V=dV;
k=zeros(499,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(3,1,2);
plot(k(:,1),k(:,2),k(:,1),c,'r');
ylim([0 1.1]);
xlabel('Voltage / V');
ylabel('K4');
title('Condition of the 4th step of the temerature algorithm --- Range: 0 V - 5 V');
legend('Condition','Boundary value','Location','Northeast');
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(3,1,3);
plot(k(:,1),k(:,2),k(:,1),c,'r');
xlim([0 0.0002]);
ylim([0 2]);
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;