You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have translated an equation from my book Analysis of Engineering Structures and Material Behavior:
//#include "catch.hpp"
#include<symengine/basic.h>
#include<symengine/visitor.h>
#include<symengine/eval_double.h>
#include<symengine/derivative.h>
#include<symengine/symengine_exception.h>
#include<cstring>usingnamespacestd;using SymEngine::Add;
using SymEngine::atoms;
using SymEngine::Basic;
using SymEngine::coeff;
using SymEngine::Complex;
using SymEngine::complex_double;
using SymEngine::ComplexInf;
using SymEngine::diff;
using SymEngine::down_cast;
using SymEngine::EulerGamma;
using SymEngine::free_symbols;
using SymEngine::function_symbol;
using SymEngine::FunctionSymbol;
using SymEngine::has_symbol;
using SymEngine::I;
using SymEngine::Integer;
using SymEngine::integer;
using SymEngine::is_a;
using SymEngine::make_rcp;
using SymEngine::map_basic_basic;
using SymEngine::map_basic_num;
using SymEngine::map_int_Expr;
using SymEngine::map_uint_mpz;
using SymEngine::Mul;
using SymEngine::multiset_basic;
using SymEngine::Nan;
using SymEngine::NotImplementedError;
using SymEngine::Number;
using SymEngine::one;
using SymEngine::pi;
using SymEngine::pow;
using SymEngine::print_stack_on_segfault;
using SymEngine::Rational;
using SymEngine::rational_class;
using SymEngine::RCP;
using SymEngine::rcp_static_cast;
using SymEngine::real_double;
using SymEngine::sdiff;
using SymEngine::set_basic;
using SymEngine::Symbol;
using SymEngine::symbol;
using SymEngine::tribool;
using SymEngine::umap_basic_basic;
using SymEngine::umap_basic_num;
using SymEngine::unified_compare;
using SymEngine::vec_basic;
using SymEngine::zero;
using SymEngine::DenseMatrix;
using SymEngine::Expression;
vector<vec_basic> nodes;
usingnamespacestd;intmain(int argc, char** argv) {
vec_basic i;
i.push_back(real_double(1.0));
i.push_back(real_double(1.0));
vec_basic j;
j.push_back(real_double(2.0));
j.push_back(real_double(2.0));
vec_basic condensed;
condensed.push_back(i.at(0));
condensed.push_back(j.at(0));
DenseMatrix matrix_global_uv = DenseMatrix(1,1,condensed);
Expression phi("phi");
auto m1 = cos(phi);
auto m2 = sin(phi);
auto m3 = sin(phi);
auto m4 = cos(phi);
DenseMatrix matrix_translate_local = DenseMatrix(2,2,{m1,m2,m3,m4});
DenseMatrix matrix_result;
matrix_translate_local.mul_matrix(matrix_global_uv, matrix_result);
cout << "Print values of matrix_result here and check them..." << std::endl;
cout << "Done..." << std::endl;
return0;
}
Things are supposed to be: auto m3 = -sin(phi);
or the negated value of -sin(phi). Somehow using the minus operator doesn't seem to work and I get an error about a missing minus operator. Is there a way maybe to accomplish the same thing some other way that the symbolic engine can interpret a negation?
The text was updated successfully, but these errors were encountered:
I have translated an equation from my book Analysis of Engineering Structures and Material Behavior:
Things are supposed to be:
auto m3 = -sin(phi);
or the negated value of -sin(phi). Somehow using the minus operator doesn't seem to work and I get an error about a missing minus operator. Is there a way maybe to accomplish the same thing some other way that the symbolic engine can interpret a negation?
The text was updated successfully, but these errors were encountered: