How to numerically solve and plot after solving the integration with a constant Multiplication
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
clc
clear all
close all
B=51;
C=10;
t=0:.01:1;
K= @(t) (((sin(t)-(t.*cos(t))).^(1/2)).*((sin(t)+(51.*sin(10.*t)))));
H1=(1/pi).*(S0/lam_d)^2;
plot(k,t)
1 Commento
Jan
il 20 Mar 2022
Please note that clear all deletes all loaded functions from the memory. This has no advantage, but reloading them from the slow disk wastes a lot of time. Waht a pity that many teachers suggest this brute clearing header.
Risposta accettata
Jan
il 20 Mar 2022
B = 51;
C = 10;
S0 = 17.34; % ???
lam_d = 19.34; % ???
H1 = (S0/lam_d)^2 / pi;
K = @(t, y) (sqrt(sin(t) - t * cos(t))) * (sin(t) + B * sin(C * t));
t = 0:0.01:1;
[T, Y] = ode45(K, t, 0);
Y = H1 * Y;
plot(T, Y)
2 Commenti
Jan
il 20 Mar 2022
I'm not sure, what "G.J" should mean. Maybe you mean:
G = @(t) (sqrt(sin(t) - t * cos(t))));
J = @(t) (sin(t) + B * sin(C * t));
K = @(t, y) G(t) * J(t);
Più risposte (1)
Torsten
il 20 Mar 2022
Modificato: Torsten
il 20 Mar 2022
B = 51;
C = 10;
S0 = ...;
lam_d = ...;
H1 = (1/pi)*(S0./lam_d).^2;
K= @(t) (sin(t)-t.*cos(t)).^(1/2).*(sin(t)+ 51*sin(10*t));
U = 0:0.01:1;
S = zeros(numel(U),1);
S(1) = 0.0;
for i = 2:numel(U)
S(i) = integral(K,U(i-1),U(i)) + S(i-1);
end
S = S*H1;
plot(U,S)
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!