cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Array of same value

jw_CS
12-Amethyst

Array of same value

I 'm busy with calculate the intersections of two lines as done here.

 

JeeBee_CS_0-1674481405285.png

 

I think the variable y2 is currently the problem because it is a single value. In python(with numpy) i'm able to create a ones(length) array. How do i create a array (arbritrary length) where all values are the same?

 

 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:jw_CS)

Always attach your sheet, not just a picture.

root needs a guess value x1 but in your setup x1 is a range, which can't work.

You may consider using root by providing a range for x1 instead of a guess value or you may create a function with the guess value as its argument and feed it with a vector of appropriate guess values_

Werner_E_0-1674485196962.png

 

EDIT: But in case you ae nonetheless still looking for a way to create a vector with all the values the same, here is one way to do it

Werner_E_0-1674518993712.png

 

 

View solution in original post

1 REPLY 1
Werner_E
25-Diamond I
(To:jw_CS)

Always attach your sheet, not just a picture.

root needs a guess value x1 but in your setup x1 is a range, which can't work.

You may consider using root by providing a range for x1 instead of a guess value or you may create a function with the guess value as its argument and feed it with a vector of appropriate guess values_

Werner_E_0-1674485196962.png

 

EDIT: But in case you ae nonetheless still looking for a way to create a vector with all the values the same, here is one way to do it

Werner_E_0-1674518993712.png

 

 

Announcements

Top Tags