Math / Science

The Math / Science topic primarily includes discussions of mathematics, physics, statistics and economic analysis, but also biology, chemistry and other sciences.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi to all,

I would like to be able to read my /mobile_robot/io topic which has this output:

data: 1517480481.375425333,0,0,0,0,1514,3307,0,0,0,0,0,0,0,0,0,1,1,0,1,0,1,1,0,0,0,0,0,0,0,0,6629
data: 1517480481.476979162,0,0,0,0,1032,3571,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0,0,6630
data: 1517480481.574876785,0,0,0,0,288,3308,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,0,0,0,0,0,0,0,6631
data: 1517480481.674732409,0,0,0,0,4914,3268,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,6632

Open in new window

I would like to read the first value which is the timestamp and the values placed at positions 6 and 7. The message type is String and I'm not able to correctly parse the output of this node.

I created the subscription block in Simulink and then I added the BUS Selector with three outputs:

Open in new window

What kind of block or function do I need to use in order to be able to read the timestamp and values at 6 and 7 columns?

I hope you can help me!

Free Tool: Port Scanner
LVL 12
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

if I mix water with refrigerant (R134a), does the color of the water change?

I'm trying to read the /status topic from Husky A200 in Matlab.
This is my bag file (20KB) I'm using this code:
      %% Retrieve information from the ROSbag
      filePath_Pro = 'matlab.bag';
      bagPro = rosbag(filePath_Pro);
      bagPro_System = select(bagPro, 'Topic', '/status');
      system_msg = readMessages(bagPro_System);

Open in new window

But when I call readMessages, I get this error:

Error using robotics.ros.BagSelection/deserializeMessages (line 445)
Java exception occurred:
org.ros.exception.RosMessageRuntimeException: java.lang.ClassNotFoundException:
    at        org.ros.internal.message.definition.MessageDefinitionReflectionProvider.get(
            at          org.ros.internal.message.DefaultMessageDeserializer.deserialize(
        Caused by: java.lang.ClassNotFoundException: husky_msgs.HuskyStatus
    at java.lang.ClassLoader.loadClass(
    at sun.misc.Launcher$AppClassLoader.loadClass(
    at java.lang.ClassLoader.loadClass(
    at          org.ros.internal.message.definition.MessageDefinitionReflectionProvider.get(
            ... 2 more
Error in robotics.ros.BagSelection/readMessages (line 195)
            msgs = obj.deserializeMessages(obj.MessageList, rows);

Open in new window

This is the output of the topic /status when I read it with rostopic echo /status :

  seq: 976
    secs: 1517311503
    nsecs: 918934269
  frame_id: ''
uptime: 1148382
ros_control_loop_freq: 9.91557364985
mcu_and_user_port_current: 0.57
left_driver_current: 7.69
right_driver_current: 9.26
battery_voltage: 24.51
left_driver_voltage: 24.67
right_driver_voltage: 24.57
left_driver_temp: 23.42
right_driver_temp: 27.25
left_motor_temp: 14.28
right_motor_temp: 15.51
capacity_estimate: 480
charge_estimate: 0.22
timeout: False
lockout: False
e_stop: False
ros_pause: False
no_battery: False
current_limit: False

Open in new window

I need to read the left_driver_current and right_driver_current. I'm able to read all the other topics, but not the /status topic.

I've already downloaded the Robotics System Toolbox Interface for ROS Custom Messages but I do not know how to use it and I do not know if it is useful for my problem.

I hope you can help me,

I know the length of all 4 sides of a trapezium
I know that one of the angles is 90 degrees.
None of the sides are parallel to the others.

How can I determine the remaining 3 angels?
I'm trying to write a .C program to project a point onto a cone section or parabola if you will.
I know...
3 dimensions of the point to project.
vector to project.
plane that is parallel to the axis of the cone the point and the vector lies on.
angle, axis, base diameter, height, vertex point of the cone.

Refer to this sketch.

point project to cone
I'm trying to calculate fastener load for a shelf of the given dimensions below.

|               20.5"

This is an L shelf with the load being placed on the bottom portion

For the moment let's assume the materials used are able to support the required load. I am fully aware that I need to evaluate the materials used, bracing, and sizing, etc.  This is really just a starting point.  My goal is to create a "floating shelf" where the rear brackets will be hidden by the load.

 I am thinking of using either 3, or 5 L brackets made of 2" wide by 1/4" thick hot rolled a36 plate that has been waterjet cut into the specified L shape and size.  The brackets will set "edgewise" against the mounting wall, with bracket tabs welded on at the top, and the bottom of the back to support the load.  The load bearing surface of the shelf will be covered in thin plate, likely 1/8"   Also the 850lb load will be evenly distributed across the shelf, however the load is only 18 inches wide (deep).  In order for it to fit on the bracket, the bottom leg will need to be 20.5" to account for the dimension of the rear brace.   The reality in that case is, that the center mass will be shifted 2" away from the wall mounting plane.  

The shelf will be 48" (long) against the wall.  

If I were to use 3 brackets, and 3 top fasteners (one at each bracket) and 3 bottom fasteners, how would one calculate the rotational load of the bracket, and in …
Can anyone tell what is the difference between data analytics and data science?
I am trying to figure out how this equation works but I cannot understand the steps.

Calculate demand with 10% lower rate
50 per hour
% change quantity (Q1 – Q0)/Q0
(Q1 - 2,000 )/2000 = 1- (Q1 /2000)
% change price -10% = (P1 – P0)/P0
Elasticity = -.5 = [(Q1 /2000)-1]/-10%
Solve and get Q1 = 2000 x 1.05 = 2100
Demand goes up 100 hours
P x Q = Revenue = 45x2100=


The steps in this calculation are:

Elasticity = ΔQ% / ΔP%
Elasticity = [(Q1 – Q0)/Q0] / [(P1 – P0)/P0]
Elasticity x [(P1 – P0)/P0] = [(Q1 – Q0)/Q0]
Elasticity x [(P1 – P0)/P0] x Q0 = (Q1 – Q0)
{Elasticity x [(P1 – P0)/P0] x Q0} + Q0= Q1
{-.5 x [-.1] x 2000} + 2000= Q1
{100} + 2000= Q1
2100= Q1

Can someone explain to me the steps needed to solve this?
I cannot seem to arrive at the same answer as the example. Therefore I dont
think I understand the proper order and steps required. Can someone explain so I can improve my skills?

Is there anyone that can help?

he cut some apples into eighths. she and her friends ate all but 17 pieces. how many whole apples and parts of apples did she have left over? tell how you know?

I am doing a fitness trainer course alongside my computing and I am confused about the terms used to rotate the hip. The images on Google images also seem to be conflicting

Imagine the knee is bent and lifted up I thought lateral rotation was moving the hip away from the midline of the body to the leg makes a 'r' shape with the feumr being the top of the r and medially rotation was turning it back to its starting position.

This page states that external rotation is lateral rotation and it is the rotary movement that is occurring in the vertical axis when the femur moves away from midline, thereby turning the thigh or pelvis outward.1 the hip can rotate externally 45 degrees.

I extrpaolate from that that medial roation is internal rotation. Correct?

However the image I have attached called incorrect internal and external extension seems to suggest the opposite of the website. The second image is what I would have expected to see

Is the first image incorrect or have I misunderstood as there are so many different sites and pictures it can get confusing. But the second image is intuitive which does make it feel correct. The first image could be a labeling error. I hope so :)

Many thanks in advance
Build your data science skills into a career
Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

I am drawing rectangle using 4 points. User should resize rectangle by mouse drag one of rectangle points. So program should  appropriately calculate two neighboring points of the rectangle while the diagonally opposed point is stationary.

Calculating is simple if rectangle is not rotated, but how to calculate points if it is rotated.... for example 30 degrees ?
It is mathematical and program problem and I am a little short how to do it in C++.
twitter sentiment analysis using Matlab   , kindly tell me whenever i import MaxentTagger class , i generate error that *. is must fot import statement..

Even i put *. but still MaxentTagger methods are not imoported in my program.....    

function result = PosTaggerM(str)
      import edu.stanford.nlp.tagger.maxent.MaxentTagger.*;

      % This initialization is expensive.
        % It is better to create the tagger once and then reuse it.
      tagger = MaxentTagger('C:/Program Files/MATLAB/R2017a/bin/english-left3words-distsim.tagger');
      result = java.util.ArrayList();
      sentences = MaxentTagger.tokenizeText(StringReader(str));
      for ii = 1:size(sentences)
            tSentence = tagger.tagSentence(sentences.get(ii-1));

ERROR GENERATED on RUN     Undefined function or variable 'MaxentTagger'.

Error in PosTaggerM (line 40)
      tagger = MaxentTagger('C:/Program Files/MATLAB/R2017a/bin/english-left3words-distsim.tagger');
I watch and have looked at information to get me  as far as I am now all I need before I can run is to target it I know its com  but have no I idea on the prefix
I got the positive number multiplication right and I can kinda do negative numbers . but I cant do both at the same time
my try code
        STA A
        STA B
        LDA A
        BRZ END
        LDA B
        BRZ END
        LDA NUM
        SUB B
        BRP CHANGE
        SUB B
        STA B
        LDA NUM
        SUB A
        STA A
        BRZ END
        SUB ONE
        STA B
        LDA P
        ADD A
        STA P
        BRA LOOP
        SUB P
        STA P
A       DAT
B       DAT
P       DAT 0
ONE     DAT 1
NUM     DAT 0
This could be an easy question and in fact, this is simple. But just wondering what's the proper algorithm for lucky draw chances?

Let's say in every new deposit amount of X get a no of chances of Y. Providing X = $1000, Y = 1

If there's a customer A credited $10000, he got 10 chances in this month.
If there's a customer B credited $2000, he got 2 chances in this month.
If there's a customer C credited $100, he got 0 chances in this month.
If there's a customer D credited $3500, he got 3 chances in this month.

By end of this month, how do I use a proper algorithm to pick a lucky draw winner? That's to pick a winner among this 15 chances.

One of the approaches is to create multiple chances in a temp table, and then random a position to pick the winner. But my question is what if the total no of chances is a very big number? Will the process of populating this temp table become slow?

Thank you.
calculate the disk capacity transfer rate
given that no. of recording=10,no. of tracks per surface=256,no. of sector per track=32,no. of bytes per sector=128,disk rotation speed=2400 rpm
In a previous question we're shopping for an ingredient which comes in standard pack sizes of either 100g, 250g or 500g, having prices $0.40, $0.75 and $1.00 respectively.


PackSize = {100; 250; 500}
PackPrice = {0.40; 0.75; 1.00}

QuantityNeeded = {0.... up in steps of GCD(PackSize)... MaxQuantity }

GCD = greatest common divisor, eg GCD({100; 250; 500}) = 50

We only need to define a table with intervals in these steps as in between there won't be any change in the cost. I think this logic is right, please correct me if wrong.

We then define f_mincost(QuantityNeeded ) as the set of packs that meets the QuantityNeeded at minimum cost, eg:

f_mincost(1050) gives 1 x 100g + 2 x 500g at a total cost of $2.40

This problem is solved in the previous question by using dynamic programming to create a lookup table of values:

a) Quantity needed, eg 1050
b) Minimum cost, eg $2.40
c) Pack selection, eg 100, 500, 500

1. What MaxQuantity do we need to tabulate upto before the pattern is repeating
    ie MaxQuantity = some function of Packsize
2. How can we define f_mincost(QuantityNeeded) as a function of this repeating pattern
   eg what is f_mincost(6400) as a function of f_mincost(some value <= MaxQuantity)

This is is probably straightforward but after the previous question my head has been frazzled!

Thanks again
Write a function called my_gcd() that takes parameters a and b and returns their greatest common divisor. Create your own implementation of the algorithm and test your code by comparing the output of your function to Python's gcd() function from math package.Test the code with the following inputs: (39, 91), (20, 30) and (40,40). Explain the logic of your function.
1. Write the pseudocode and draw the flowchart for a hotel program to determine the cost a customer has to pay for a stay based on the following pricing policy of the choice of room:
>>>Room for 1 to 2 people: RM85
>>>Room for 3 to 4 people: RM90
>>>Room for 5 to 6 people: RM120
>>>Room for > 6 people, RM125 plus charge for additional people at RM25 per person

If the customer has a membership card, there is a 20% discount. If the customer wants to pay using credit card, there is a 15% discount. A customer cannot receive both discounts. If the customer wants to pay using credit card and has a membership card, the highest discount rate will be given.

Answer these questions before you start solving the problem.
What is the output?
→Cost of customer has to pay for a stay
How many input(s) is/are needed?
What is/are the input(s)?
→number of people, number of days, payment type,
What is the process (equation) to find the output?                                                                                                                    
→cost = number of days * 85
→cost = number of days * 90
→cost = number of days * 120
→additional people = number of people - 6
→cost = number of days * [125 + 25 (additional people)]
→membership card =  cost * 80/100
→credit card = cost * 85/100
How many different calculation(s) is/are needed?
What structure need to be used to select which is the correct calculation to use? Repetition or decision? →decision…
A proven path to a career in data science
A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

It is for a science project we just don't have any weighing scales to test it ourselves
How much more will the cost be for a wager on V5 compared to V4 when adjusting for difference in probability, price per unit and track's deduction?:

For V5 (a type of wagering on harness racing where you should pick the winner in 5 races), the probability to pick the winners in the five races is 12 times more difficult compared to for V4 (1/248832 divided with 1/20736; (12x12x12x12x12)/(12x12x12x12)), which means you need to spend 12 times more units on V5 to achieve the same probability. However, this should be adjusted first for price per unit, which for V4 is 2 SEK and for V5 is 1 SEK, so the adjustment becomes 12 x 0.5 = 6.

The final adjustment is for the racing track's deduction, which for V4 is 25 % and for V5 is 35 %.

Is this correct?:

6 + (0.1/0.25) = 6.4

Which means in order to compensate for lower probability in V5 compared to V4, and for difference in price per unit (V4: 2 SEK; V5 1 SEK) and difference in track's deduction (V4: 25 %; V5 35 %), I need to spend 6.4 times more units/money on V5 compared to V4 so that I in the end have the same probability to win on my wager on both V4 and V5, provided that the payouts on both the wagers are the same.

Or do I get it wrong? Is it that the payout on V5 needs to be 6.4 times higher than on V4 in order to compensate for the difference in probability, price per unit and track's deduction?
I am trying to rotate an object and get the following error message: 1119:access of possibly undefined property Math through a reference with a static type class. Thank you for your help

 here is the code


stage.addEventListener(MouseEvent.MOUSE_MOVE, FollowMouse);
function FollowMouse(event:MouseEvent):void
      var SideY:Number = mouseY-circle.Y;
      var SideX:Number = mouseY-circle.X;
      var Rad:Number = Math.atan2(SideY,SideX);
      var Deg:Number = Rad * 180/Math.PI;
      circle.rotation = Deg;
I heard gastritis and heartburn can be solved by ingesting alkaline substances.
Alkaline plants supposedly containing alkaline substances can be ingested to lower the pH value in the stomach due to stomach acid.
I'm trying to extract alkaline substances from plants using simple boiling extraction.
Thus, I tried to extract alkaline substances from a alkaline plant, dandelion, in ethanol and ethyl acetate solvent for 10~15 minutes.
The solution was filtered with carbon black for decolourization, but it didn't show alkaline colour with universal indicator.

So... I've got some questions to ask

1. Is dandelion alkaline?
2. If it's alkaline, is it possible to extract alakline substances or alkaloids from the plant?
3. If dandelion is not alkaline enough, then could there be any othe ralternative plant or food that can be extracted alkaline substances?
4. Is alkaloid alkaline?
5. What are the alkaline substances coming from?
6. If the simple boiling extraction doesn't work , is there any other ways that I can extract alkaline substances from the plants?

Could you explain in high school level.
I hope this forum can also help regarding electricity science.
Need to purchase a few single cells of lipo and ni-mh battery types >> high drain >> for airsoft purpuse, and rc!

1. Would like to get anykind information to get them from any Europe dealers, wholesalers,distributors, etc?
2. Or, name of a few manufacturers companies?

Thanks in advance...
I wish to extract info from a land registry file - see info on this link.

I have a UK land registry .gml file downloaded from their site

I have installed QGIS and have managed using the menu item FILE / IMPORT VECOR DATA / COMMON IMPORT FORMATS browsed to the .gml file and opened it but all I see is View1 ( attached ). I can zoom to produce View2 & 3 ( also attached )  but I can't see how I can reveal the Polygons referred to by the Land Registry.

Math / Science

The Math / Science topic primarily includes discussions of mathematics, physics, statistics and economic analysis, but also biology, chemistry and other sciences.