Borrar filtros
Borrar filtros

imaginary solution with solve

5 visualizaciones (últimos 30 días)
monarch
monarch el 1 de Dic. de 2017
Editada: David Goodmanson el 7 de Dic. de 2017
I am trying to solve for 2 variables R2 and theta. Since the systems are not linear, equationsToMatrix and linsolve don't work. So I tried solve.
At one point I was getting a symbolic solution with i in it (which I have since been unable to reproduce) and so I tried to initialize the variables as 'real':
E = 447000;
v = 849968100;
deltay = .00127;
q = 40;
t = .000211;
R = .0525;
R2 = sym('R2','real');
theta = sym('theta','real');
eqns = [deltay*(2*E*t)/(q*(1-v)) == (R2^2)*(1-cos(theta)), sin(theta) == R/R2];
vars = [R2 theta];
[solR2,soltheta] = solve(eqns, vars)
% R2 = double(R2)
% theta = double(theta)
And now, instead of getting an imaginary solution, I get an empty symbolic variable. In the end, I'd like to get a real numeric solution for R2 and theta.
TIA! :)

Respuesta aceptada

Walter Roberson
Walter Roberson el 1 de Dic. de 2017
There are no real-valued solutions for R2 and theta for those constants.
The system of equations is a quadratic. The two forms are
R2 = 2*(-(1/4)/(((1/4)*R^2*(-1+v)*q+deltay*E*t)*(-1+v)*q))^(1/2)*t*deltay*E
theta = arctan(R/((-(1/4)/(((1/4)*R^2*(-1+v)*q+deltay*E*t)*(-1+v)*q))^(1/2)*t*deltay*E), (-2*deltay*E*t-R^2*(-1+v)*q)/(E*t*deltay))
and
R2 = -2*(-(1/4)/(((1/4)*R^2*(-1+v)*q+deltay*E*t)*(-1+v)*q))^(1/2)*t*deltay*E
theta = arctan(-R/((-(1/4)/(((1/4)*R^2*(-1+v)*q+deltay*E*t)*(-1+v)*q))^(1/2)*t*deltay*E), (-2*deltay*E*t-R^2*(-1+v)*q)/(E*t*deltay))
If you examine the ^(1/2) portions, you will see that they involve -1 times an expression. When all of the constants are positive and v is greater than 1, then the expression is strictly positive, leading to a negative inside the sqrt, which will be imaginary.
At least one of your constants would need to change sign, or your v would need to be less than 1, in order to be taking the square root of a positive value there.
  24 comentarios
David Goodmanson
David Goodmanson el 3 de Dic. de 2017
If R/R2 is positive (and less than one) then asin outputs into the first quadrant, so you get check_theta = 0.1513. But since sin(theta) = sin(pi-theta), (pi-theta) is also a valid solution for asin. Indeed if you compare check_theta with theta from the acos calculation, then if you check whether (pi - check_theta) = theta, that checks out.
Geometrically, is check_theta really the angle that counts? It's certainly in the range you wanted.
You did not yet mention what deltay is. Is it a deflection?
monarch
monarch el 3 de Dic. de 2017
Editada: Walter Roberson el 3 de Dic. de 2017
Yes - deflection. "deltay is change in the height dimension y; y is length of cylindrical or conical shell and is also used as a vertical position coordinate, positive upward."
I agree that check_theta is the one that makes most sense to me geometrically. However, plugging it back in to the deltay equation gives me a different deltay than the fixed one I input from the beginning.
The is the plot I get for theta on x axis, deltay on y axis for the above set of conditions (where deltay is supposed to be .0048).

Iniciar sesión para comentar.

Más respuestas (1)

monarch
monarch el 3 de Dic. de 2017
For the curious...the mystery has been solved. For this material, E varies under these conditions (but we can't measure it in this experiment) so I solved for E under various conditions and found that it's nowhere near the constant for E I was using (that was derived from a different experiment). When I use the derived E and feed everything back in, the thetas match. HOORAY!
  3 comentarios
monarch
monarch el 4 de Dic. de 2017
Yes that is true the shell was pressurized on the inside...and I understand your concern with using the derived E. It does indeed problems. I was just happy to see the theta matching...but yes, it is problematic and most likely pointing to some serious assumption violating going on!
David Goodmanson
David Goodmanson el 4 de Dic. de 2017
Editada: David Goodmanson el 7 de Dic. de 2017
Could you describe the experimental setup, for example is it a hemisphere, and how you are measuring y, and how is your angle theta measured or defined?
I'm not sure what you don't like about the plot that you posted since it looks like it peaks out at .0048 just like it should.

Iniciar sesión para comentar.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by