Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect results are generating with unit_vector() and magnitude() member functions of differential representations. #125

Open
rjnrohit opened this issue Apr 13, 2020 · 5 comments · May be fixed by #127

Comments

@rjnrohit
Copy link

rjnrohit commented Apr 13, 2020

User may instantiate a differential object as in the following way:

auto cart_rep_diff = make_cartesian_differential(34.9*meter/second,37.91*meters_per_second,490.1*centimeter/second);

and the generated results are as follows:

cart_rep_diff .magnitude() = 492.801

cart_rep_diff.unit_vector<decltype(cart_rep_diff)>() = Cartesian differential ( 0.0708196 m s^-1 , 0.0769275 m s^-1 , 0.994518 cm s^-1 )

But expected results are:
51.761 m s^-1 in case of magnitude
and for unit_vector is
Cartesian differential ( 0.674253 m s^-1 , 0.732405 m s^-1 , 0.0946852 cm s^-1 )

@rjnrohit rjnrohit changed the title Incorrect result generating with unit_vector() and magnitude() member functions of differential Representation. Incorrect result generating with unit_vector() and magnitude() member functions of differential representations. Apr 13, 2020
@rjnrohit
Copy link
Author

Member functions unit_vector and magnitude need to be removed from header base_differential.hpp

@rjnrohit rjnrohit changed the title Incorrect result generating with unit_vector() and magnitude() member functions of differential representations. Incorrect results are generating with unit_vector() and magnitude() member functions of differential representations. Apr 13, 2020
@rjnrohit
Copy link
Author

rjnrohit commented Apr 13, 2020

I have updated base_differential.hpp in #127

@Gopal-Dahale
Copy link

why is your expected result in m s^-1? it could also be cm s^-1. How to decide that?

@rjnrohit
Copy link
Author

@Gopal-Dahale you can see here

bg::set<1>(tempPoint, static_cast<XQuantity>(vector.get_y()).value());
. for the magnitude we're typecasting to XQuantity. It seems we expect magnitude in units of first coordinate quantity.

@Gopal-Dahale
Copy link

Well, I am able to convert the units but I had used the functions get_dx(), get_dy(), get_dz() for accessing the units whereas in the magnitude function in base_differential.hpp, cartesian_-differential is represented as a point (no units). Is there a way for me to get the units without using the getter methods as they are specific to different representations(cartesian, spherical etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants