I am trying to solve for OS here, but keeping getting pi/2 even when I change L

2 次查看(过去 30 天)
%variables
F = .00024; %kg
E = 10^6; %mPa
I = 6.1*10^-9; %kg m^2
L = .01; %m
%solve for Theta sub 0
func = @(initial) L/sqrt((E*I)/(2*F)) - integral(@(theta)1./sqrt(cos(initial)-cos(theta)),initial,pi/2);
OS = fsolve(func,.5);
I am not sure what I am doing wrong here, I hope to find the value of initial, this function is in respect to d theta. Is there anything wrong with this?
I want to then solve for xi which is also funky,
aa = linspace(pi/2*.99, 0, 49);
aa=aa';
%shape of rod given
xi = sqrt((2*E*I)/F)*(sqrt(cos(OS))-sqrt(cos(OS)-cos(aa)));
any help appreciated not sure what is wrong

回答(1 个)

Jeffrey Clark
Jeffrey Clark 2022-7-11
@adam puchalski, you need to limit fsolve such that it doesn't attempt values that cause sqrt(cos(initial)-cos(theta)) to return a complex value, e.g., values >pi/2 and other ranges about the circle:
func(2)
ans =
0.0028 - 1.3565i

类别

Help CenterFile Exchange 中查找有关 Number Theory 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by