How to add/specify range of values for each variable in vpasolve?

5 views (last 30 days)
How do I add specific ranges for each variables in vpasolve?
Example, for variable x, range of values should be 1 to 2. For variable y, range is 10 to 100. For variable z, range is 0 to 1.
Part of my code is given below.
syms x y z positive
eq1 =
eq2 =
eq3 =
sol=solve([eq1,eq2,eq3],[x,y,z]);
xsol=vpa(sol.x)
ysol=vpa(sol.y)
zsol=vpa(sol.z)
I tried the following below
syms x y z positive
eq1 =
eq2 =
eq3 =
range=[1 2; 10 100; 0 1]
sol=solve([eq1,eq2,eq3],[x,y,z],range);
xsol=vpa(sol.x)
ysol=vpa(sol.y)
zsol=vpa(sol.z)
but I got an error for the line "range=[1 2; 10 100; 0 1]"
Invalid text character. Check for unsupported symbol, invisible character, or pasting of non-ASCII characters.
  2 Comments
whiteribbon
whiteribbon on 7 May 2019
Thank you for that.
I changed this line to:
range=[1,2;10,100;0,1]
but a new error for the following line appears
sol=solve([eq1,eq2,eq3],[x,y,z],range);
together with these other errors
Error using sym.getEqnsVars>checkVariables (line 87)
Second argument must be a vector of symbolic variables.
Error in sym.getEqnsVars (line 54)
checkVariables(vars);
Error in solve>getEqns (line 429)
[eqns, vars] = sym.getEqnsVars(argv{:});
Error in solve (line 226)
[eqns,vars,options] = getEqns(varargin{:});

Sign in to comment.

Answers (1)

madhan ravi
madhan ravi on 7 May 2019
vpasolve() not solve()
  7 Comments
Muhammad Adil
Muhammad Adil on 17 Mar 2020
Also having this problem, how you managed to solve bro plz share

Sign in to comment.

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!