Why is the solve() function not working properly?

Hello,
I am trying to solve for a variable Nt, from an equation with the form
When I try to solve it using the solve() function it outputs a negative number rather than what should be a positive number (I get -35.8471 when I implement the below MATLAB code). Is there something wrong with my implementation of this code?
clc; clear; close all;
k = 1167.490;
E = 30e6;
d = 0.625;
theta = 17*2*pi;
Dm = 3+1+d;
syms Nt
eqn = E*d^4/(10.8*(Dm*(Nt+theta)/Nt)*(Nt+(Nt/(3*pi)))) == k;
S = solve(eqn,Nt);
Snum = double(S);

3 commentaires

It appears to be correct. I even checked it with:
syms Nt k E d theta Dm
eqn = E*d^4/(10.8*(Dm*(Nt+theta)/Nt)*(Nt+(Nt/(3*pi)))) == k;
pretty(eqn)
to be certain.
Unless there is some sort of error in the constants (no way to check that), the code should produce a correct result.
Just found that there was a typo in one of the variables. Now I'm getting correct values.
Thanks!!
Star Strider
Star Strider le 16 Fév 2021
My pleasure!
In retrospect, I should have posted that as an Answer!

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Mathematics dans Centre d'aide et File Exchange

Produits

Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by