Solving a simple equation

1 Ansicht (letzte 30 Tage)
Richard Golem
Richard Golem am 2 Apr. 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.

Akzeptierte Antwort

Paul Hoffrichter
Paul Hoffrichter am 2 Apr. 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 Kommentare
Richard Golem
Richard Golem am 2 Apr. 2021
That worked! Thank you so much!
Paul Hoffrichter
Paul Hoffrichter am 5 Apr. 2021
Glad to have helped.
~Paul

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Programming finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by