Getting warning while running the attached code!!
2 views (last 30 days)
Show older comments
clear all;
close all;
clc;
syms x
E = 30e3;
s_u= 114;
k_p = 154;
n_p = 0.123;
s_f_p = 169;
e_f_p =1.14;
b = -0.081;
c = -0.67;
N = logspace(0,6); % 2N_f
k_f = 2.22;
s_nom = 50;
s_e_peak = (k_f*s_nom)^2/E
eqn = x*((x/E) + (x/k_p)^(1/n_p)) == 0.4107;
sol = solve(eqn)
Warning: Solutions are parameterized by the symbols: z2. To include parameters and conditions in the solution, specify the 'ReturnConditions'
value as 'true'.
0 Comments
Accepted Answer
Walter Roberson
on 30 Mar 2022
That is not an error.. but it can be a nuisance.
format long g
syms x
E = 30e3;
s_u= 114;
k_p = 154;
n_p = 0.123;
s_f_p = 169;
e_f_p =1.14;
b = -0.081;
c = -0.67;
N = logspace(0,6); % 2N_f
k_f = 2.22;
s_nom = 50;
s_e_peak = (k_f*s_nom)^2/E
eqn = x*((x/E) + (x/k_p)^(1/n_p)) == 0.4107;
sol = solve(eqn, 'returnconditions', true)
cond1 = children(sol.conditions,1)
p = sym2poly(lhs(cond1));
z_sols = roots(p);
cond2 = children(sol.conditions,2) & children(sol.conditions,3)
mask = simplify(subs(cond2, z_sols));
valid_sols = z_sols(logical(mask));
overall_sol = vpa(subs(sol.x, sol.parameters, valid_sols))
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!