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

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

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.

댓글을 달려면 로그인하십시오.

 채택된 답변

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

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.
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);

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Torsten
Torsten 2022년 3월 20일
편집: Torsten 2022년 3월 20일
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)

카테고리

제품

릴리스

R2021b

질문:

2022년 3월 20일

댓글:

Jan
2022년 3월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by