Skip to content
Snippets Groups Projects
Commit c77950c6 authored by Alvaro Andres Ortega Rojas's avatar Alvaro Andres Ortega Rojas
Browse files

Upload New File

parent 94a88e1f
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id:d8c9cc7e-12af-41a2-a3e2-17947687b52b tags:
``` python
import numpy as np
import matplotlib.pyplot as plt
```
%% Cell type:code id:0a9bf50c-beb0-419c-8461-08b7b11db189 tags:
``` python
L = np.arange(10, 32, 2)
dL = np.random.rand(len(L))
B = 0.5
alpha = 0.3
T0 = T = B*L**alpha
T = B*(L+dL)**alpha
```
%% Cell type:code id:cafe1b32-cfac-4005-888d-75cb295b539b tags:
``` python
plt.figure()
plt.plot(L, T0, 'b.')
plt.plot(L, T, 'g.')
plt.show()
```
%% Output
%% Cell type:code id:7d536043-8efb-4a8f-9017-7b9b13c8ea1a tags:
``` python
X = np.log(L)
Y = np.log(T)
plt.figure()
plt.plot(X, Y, 'g.')
plt.show()
```
%% Output
%% Cell type:markdown id:6c99b9ca-c8c1-43ae-988f-6430c66aca0d tags:
## Ajuste lineal
%% Cell type:code id:3ded9ca3-c33a-4b0f-8b02-04dc38c6fca6 tags:
``` python
alpha_exp, C_exp = np.polyfit(X,Y, 1)
print(alpha_exp, C_exp)
```
%% Output
0.28504042495634563 -0.6423000064800591
%% Cell type:code id:7d0c0abf-9ba7-43db-97bd-b8c0867e093e tags:
``` python
np.exp(C_exp)
```
%% Output
0.5260810416785282
%% Cell type:code id:c5e3186b-dd09-4813-a21c-48e980741cb2 tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment