Monday, July 6, 2020

Octave - Use solve function to symbolic solution of equation whith one variable


% Script for solving equation with one variable using the solve function
% sytax :
% S = solve(eqn,var) solves the equation eqn for the variable var.

% load symbolic package, and initilize PYTHON variable. (Octave only).
pkg load symbolic
setenv PYTHON C:\ProgramData\Anaconda3\pythonw.exe

% Declare symbolic and variables and parameters
syms a b c x

% Define the equation to solve:
eqn = a*x^2 + b*x + c == 0

% activate solve function for x
S = solve(eqn, x)

% Solve for b:
Sb = solve(eqn, b)


Output








No comments:

Post a Comment

Featured Post

Solve simple Absolute Value Inequality

  Exam - BARTON COLLEGE PRACTICE PLACEMENT TEST Ex. 39 Exercise: The inequality |8 - x| < 8   is equivalent to:   a) x < 0 b) x &g...