Solving a simple equation

조회 수: 2 (최근 30일)
Richard Golem
Richard Golem 2021년 4월 2일
댓글: Paul Hoffrichter 2021년 4월 5일
%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.

채택된 답변

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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Assumptions에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by