Calculation of a precise point after indefinite integral
Mostra commenti meno recenti
Hello,
I am trying to calculate the indefinite integral q_o_a to then calculate at the point of d = pi/2 (q_1). I have tried with function handles and a script function as well but I can't work out how to do this. It gives me the good indefinite integral such that q_o_a = 3200cos(d) * Sy/IXX (second half unimportant) but I can't managed to use this as I would like to.
Thanks for any help
4 Commenti
Thomas Beaudet
il 23 Feb 2021
Star Strider
il 23 Feb 2021
First, thank you for understanding that MATLAB can’t run images of code, only actual code.
Second, do you want to solve for ‘R’, or do something else? If so, it would be necessary to know the value of the expression for ‘q_o_a’ at one or more specific values of ‘t’ and the other constants, none of which are currently defined.
Thomas Beaudet
il 23 Feb 2021
Star Strider
il 23 Feb 2021
If you want to vary ‘d’, that will require a loop (or arrayfun, however that is significantly slower than an explicit loop, so I rarely use it), for example with all the constants already in your workspace:
y_a = @(d,R) R*sin(d) ;
dv = linspace(pi/2, pi, 10);
for k = 1:numel(dv)
q_o_a(k) = -(Sy/IXX)*integral(@(d)y_a(d,R)*R*t,0,dv(k)) ;
end
Note also that there must be two limits-of-integration if you want to evaluate any integral, regardless of the function used to integrate it.
Risposte (1)
Walter Roberson
il 23 Feb 2021
syms Sy IXX
syms d R
y_a = @(d,R) R*sin(d) ;
q_o_a(d, R) = -(Sy/IXX)*int(y_a(d,R)*R*t,d) ;
q_1 = q_o_a(pi/2, R) ;
Reminder that definite integrals require the subtraction of the value at the lower bound. If you are using 0 as the lower bound then the indefinite integral is non-zero there.
1 Commento
syms Sy IXX
syms d R t
y_a = @(d,R) R*sin(d) ;
q_o_a(d, R) = -(Sy/IXX)*int(y_a(d,R)*R*t,d) ;
D = linspace(pi/2, pi, 10);
q_1 = q_o_a(D, R) ;
q_1.'
Categorie
Scopri di più su Calculus in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
