Solving a simple equation

1 visualización (últimos 30 días)
Richard Golem
Richard Golem el 2 de Abr. de 2021
Comentada: Paul Hoffrichter el 5 de Abr. de 2021
%Angle = B
%Thickness = u
%Inner Radius = p
%Developed length = L
%L = L1+L2+a
%Bend Allowance = a
B = 90;
u = .075;
p = .046875;
L1 = 12;
L2 = 3.5;
syms B u p v;
v = solve(v == pi*((180-B)/180)*(p+(u/2e-6)*(6.5e-6+5e-6*log(p/u)))-2e-6*(p+u),v);
%syms v L1 L2 L;
%L = solve(L==L1+L2+v);
disp(v)
%I am trying to ultimatly solve for L, however when I try and solve for v it comes out wit a really long and complicated equation that includes my variables. I put the equation with the right number in my calculator and got a single number using the same notation, so I'm pretty sure the problem is somewhere in my code. It is probalby really obvius, but I am pretty new and don't know what I'm doing wrong. Any help would be great, thank you.

Respuesta aceptada

Paul Hoffrichter
Paul Hoffrichter el 2 de Abr. de 2021
Sorry, no idea if this is right.
clc, clearvars
%Angle = B
%Thickness = u
%Inner Radius = p
%Developed length = L
%L = L1+L2+a
%Bend Allowance = a
B = 90;
u = .075;
p = .046875;
L1 = 12;
L2 = 3.5;
% % % syms B u p v;
syms v
v = solve(v == pi*((180-B)/180)*(p+(u/2e-6)*(6.5e-6+5e-6*log(p/u)))-2e-6*(p+u),v);
%syms v L1 L2 L;
%L = solve(L==L1+L2+v);
disp(v)
val = double(v);
disp(val);
Output:
1432527233130751/4503599627370496
0.318084943524866
  2 comentarios
Richard Golem
Richard Golem el 2 de Abr. de 2021
That worked! Thank you so much!
Paul Hoffrichter
Paul Hoffrichter el 5 de Abr. de 2021
Glad to have helped.
~Paul

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by