CARVIEW |
Select Language
HTTP/2 200
date: Sat, 11 Oct 2025 06:14:35 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
x-frame-options: DENY
x-content-type-options: nosniff
x-xss-protection: 1;mode=block
vary: accept-encoding
cf-cache-status: DYNAMIC
content-encoding: gzip
set-cookie: _csrf-frontend=3cba868178eb9fc4c4f18d88da59a312948ac196d3787e06b42903584ff1217ba%3A2%3A%7Bi%3A0%3Bs%3A14%3A%22_csrf-frontend%22%3Bi%3A1%3Bs%3A32%3A%22EHn-l93y2tcrkoJuUr7ZCm56YVZfr5i-%22%3B%7D; HttpOnly; Path=/
cf-ray: 98cc37d30fc8741b-BLR
% UC: 21048 - Física Geral % Ano 2022/23 - EFOLIO B - Gráfico Pêndulo Gravític - Pastebin.com
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % UC: 21048 - Física Geral
- % Ano 2022/23 - EFOLIO B - Gráfico Pêndulo Gravítico - UAb
- % Aluno: 2100927 - Ivo Baptista
- clc % limpa a tela do terminal
- close all % Fecha os graficos que estão abertos
- clear all % limpa o valor das variaveis em memoria
- % Constantes
- m = 0.0026; % Massa em g
- L = 1.0; % Comprimento em m
- r = 0.3; % Raio em m
- g = 9.81; % Aceleração da gravidade em m/s^2
- rho = 1.2; % Massa específica do ar em kg/m^3
- cd = 0.1; % Coeficiente de arrasto
- A = pi * r^2; % Área transversal da esfera
- % Calcula o coeficiente de arrasto aerodinâmico
- b = 1/2 * rho * cd * A;
- % Valores iniciais
- theta0 = 0.05; % Ângulo inicial em rad
- w0 = 0.0; % Velocidade angular inicial em rad/s
- t0 = 0.0; % Tempo inicial em s
- h = 0.1; % Passo de tempo em s
- t = 0; % Valor inicial do tempo
- tend = 100; % Valor final do tempo
- ciclos = (tend - t)/h % Numero de ciclos
- % Listas para armazenar os resultados
- t = t0;
- theta = theta0;
- w = w0;
- % Apresentação de Titulo
- hold on;
- grid;
- title('EfolioB - Fisica - Pendulo Gravitico');
- axis ([t, tend, -0.15, 0.15]);
- % cabeçalho da tabela de resultados
- printf(" t(s) | Theta(rad/s) | w(rad/s) | k1x | k1v | k2x | k2v \n");
- printf("-------|--------------|--------------|--------------|--------------|--------------|-------------\n");
- % Loop de tempo
- while t(end) < ciclos
- k1x = w(end);
- k1v = -sign(w(end)) * (((b*L)/m) * w(end)^2) - (g / L) * theta(end);
- k2x = w(end) + k1v * h;
- k2v = -sign(w(end) + k1v *h) * (((b*L)/m )* (w(end) + k1v *h)^2) - (g / L) * (theta(end)+k1x(end)*h);
- % Atualização dos valores de θ e w
- theta = [theta, theta(end) + ((k1x + k2x) / 2.0)*h];
- w = [w, w(end) + ((k1v + k2v) / 2.0)*h];
- % Atualização do tempo
- t = [t, t(end) + h];
- printf(" %4d | %8d | %8d | %8d |%8d | %8d | %8d\n",t(end),theta(end),w(end),k1x,k1v,k2x,k2v);
- end
- % Adiciona uma linha para w com a linha azul
- hold on;
- plot(t, theta, 'r',t, w, 'b');
- % Adiciona uma legenda
- legend('Theta', 'w');
- % Adiciona títulos aos eixos
- xlabel('tempo (s)');
- ylabel('Theta (rad), w (rad/s)');
- grid on;
- % Exibe o gráfico
- hold off;
Advertisement
Add Comment
Please, Sign In to add comment
-
⭐✅ Online Marketplace Exploit ✅ NEVER SEEN BE...
JavaScript | 2 sec ago | 0.24 KB
-
⭐✅ Trading Profit Method ✅ NEVER SEEN BEFORE...
JavaScript | 12 sec ago | 0.24 KB
-
⭐ Instant BTC Profit Method ✅ NEVER SEEN BEFO...
JavaScript | 21 sec ago | 0.24 KB
-
⭐✅ MAKE $2000 INSTANTLY ✅ NEVER SEEN BEFORE ⭐...
JavaScript | 31 sec ago | 0.24 KB
-
⭐ Free Crypto Method ✅ NEVER SEEN BEFORE ⭐⭐⭐
JavaScript | 42 sec ago | 0.24 KB
-
✅⭐ Make huge profits on trading ✅ NEVER SEEN...
JavaScript | 53 sec ago | 0.24 KB
-
⭐✅ Marketplace Glitch ✅ Working ✅ NEVER SEEN...
JavaScript | 1 min ago | 0.24 KB
-
✅⭐ Make $2500 in 15 minutes ✅ NEVER SEEN BEFO...
JavaScript | 1 min ago | 0.24 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand