Ask Your Question
1

Problem with solve and solve_ineq

asked 2021-08-27 12:41:46 +0200

Cyrille gravatar image

In the following inequation solving

var('x_0 x_1') 
s1=solve(x_1 - 2*x_0 <= 20, x_0) 
show(s1)

whatever be the variable $x_0$ or $x_1$ the result obtains is a function of $x_1$. So I try to substitute for solve_ineq() and then have an error. I need a result in the form $x_1 \leq 20 + 2*x_0$.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-08-27 14:25:14 +0200

tmonteil gravatar image

With solve_ineq, you should put equations and variables in a list:

sage: s1 = solve_ineq([x_1 - 2*x_0 <= 20], [x_1])
sage: s1
[[x_1 == 2*x_0 + 20], [x_1 < 2*x_0 + 20]]
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-08-27 12:41:46 +0200

Seen: 75 times

Last updated: Aug 27 '21