-2

I'm new here and I don't really know how to precisely ask my question. I have to prepare code that will proceed like x1 = x0 + t* e, which in practice looks like:

x1 = [0.5, 1] + [0, t]

x1 = [0.5, 1+t]

How should I declare t to make it work? I mean t has to remain here all the time, to make it possible to calculate the roots of a quadratic function a few steps further.

Mike Pierce
  • 1,390
  • 1
  • 12
  • 35
bobby
  • 1
  • 1

1 Answers1

0

This would be hard to implement in a general purpose programming language because you need t to stay "symbolic" so you can do algebraic manipulations with it. You should look into implementing this in a Computer Algebra System (CAS) because those are specifically designed to handle symbolic computations. Implementing what you describe would be very quick and easy in a CAS.

There is well-known (and expensive proprietary) CAS software like Mathematica or Matlab. Or if you are working in C++ or python there is SymbolicC++ and SymPy that integrate well with each of them respectively. You can see Wikipedia for a list of CAS software.

Mike Pierce
  • 1,390
  • 1
  • 12
  • 35