Exploring Base Vectors in Covariance and Contravariance: A Brief Overview

  • I
  • Thread starter Somali_Physicist
  • Start date
  • Tags
    Covariance
In summary, the base vectors for both covariant and contravariant bases are found through the definitions of being normal and tangent vectors to the coordinate functions. This is based on the rational that the normal vector of a function is given by its gradient and the tangent vectors are chosen to be the tangent vectors of the coordinate lines.
  • #1
Somali_Physicist
117
13
I'm confused at how the base vectors are found for both.

e(1) = ∂r/∂u
e(1)= ∇u
where r = xi + yj+zk
x = x(u,v,w)
y=y""
z=z""

cant understand why.
 
Physics news on Phys.org
  • #2
Exactly what is it that confuses you?
 
  • #3
Orodruin said:
Exactly what is it that confuses you?
How the covariant and contravariant base vectors are found.
For instance the covariant base vectors is found through:
e1 = ∇u , why is this?
 
  • #4
It is a definition.

You choose those base vectors to be normal vectors to the coordinate functions. The normal vector of a function is given by its gradient.

The other set of base vectors is chosen to be the tangent vectors of the coordinate lines.
 
  • Like
Likes Somali_Physicist
  • #5
Orodruin said:
It is a definition.

You choose those base vectors to be normal vectors to the coordinate functions. The normal vector of a function is given by its gradient.

The other set of base vectors is chosen to be the tangent vectors of the coordinate lines.
not to sound slow but just to clarify.

e1 ⋅ (equivalent coordinate function base) = 0
e1⋅(equivalent coordinate function base) = 0
e1 ⋅ (equivalent coordinate function base) = e1⋅(equivalent coordinate function base)
e1 ⋅(1/e1) = 1
∂u/∂x ⋅ ∂u/∂x = ε^2 ( magnitude)
=ε^2cosθ , if orthogonal , = 1
Is that the rational they took to get use the vectors?
 
Last edited:

What is covariance and contravariance?

Covariance and contravariance are terms used in mathematics and computer science to describe the relationship between types and subtypes or supertypes. In simple terms, covariance refers to the ability of a subtype to be substituted for its supertype, while contravariance refers to the ability of a supertype to be substituted for its subtype.

How are covariance and contravariance used in programming?

In programming, covariance and contravariance are used to ensure type safety and to facilitate polymorphism. By allowing subtypes and supertypes to be substituted for each other, it allows for greater flexibility and extensibility in code without compromising type correctness.

What are some examples of covariance and contravariance in programming?

One example of covariance is the use of a subclass object in place of its superclass in a method. For example, if a method expects an Animal object and we pass in a Dog object, which is a subclass of Animal, then the Dog object is being used covariantly. An example of contravariance is the use of a superclass object in place of its subclass. For instance, if a method expects a Dog object and we pass in an Animal object, which is a superclass of Dog, then the Animal object is being used contravariantly.

What are the benefits of using covariance and contravariance in programming?

Using covariance and contravariance can lead to more concise and flexible code, as it allows for different types to be used interchangeably. It also helps to prevent errors and improve type safety by ensuring that the correct types are being used in different contexts.

Are there any potential drawbacks to using covariance and contravariance in programming?

While covariance and contravariance can improve code flexibility, it can also make code more complex and potentially lead to hard-to-debug errors if not used carefully. Additionally, some programming languages may not support covariance and contravariance, limiting their use in certain contexts.

Similar threads

  • General Math
Replies
5
Views
1K
Replies
3
Views
2K
  • Advanced Physics Homework Help
Replies
5
Views
2K
Replies
24
Views
1K
  • Other Physics Topics
Replies
5
Views
1K
  • Special and General Relativity
Replies
3
Views
859
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
961
  • Special and General Relativity
Replies
10
Views
712
  • Special and General Relativity
Replies
3
Views
966
  • Linear and Abstract Algebra
Replies
3
Views
301
Back
Top