How to numerically solve and plot after solving the integration with a constant Multiplication

1 visualizzazione (ultimi 30 giorni)
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
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.

Accedi per commentare.

Risposta accettata

Jan
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
Md Sakiluzzaman
Md Sakiluzzaman il 20 Mar 2022
can you suggest me that how can I integrate a long function by taking two or more function
like for this below equation, I am supposed to take individual variable
G=(sqrt(sin(t) - t * cos(t)))); % I mean just simplify for a long enquation
J=(sin(t) + B * sin(C * t));
K = @(t, y)(G.J);
%then what will be rest of the part
Did you get my point, I am trying to say.
Jan
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);

Accedi per commentare.

Più risposte (1)

Torsten
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)

Categorie

Scopri di più su Programming in Help Center e File Exchange

Prodotti


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by