Solving a simple equation

1 回表示 (過去 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 Center および File ExchangeAssumptions についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by