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

if I mix water with refrigerant (R134a), does the color of the water change?
Hire Technology Freelancers with Gigs
LVL 12
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

What to do if a split doesn't fit? Or a bunch of invoice lines must be rounded while the sum must match a total? It takes a little, but - when done - it is extremely easy to implement.

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,

So this startup, Nectome, is engineering the science to preserve your brain -- memories in tact -- so that one day off in the future, it can be rebooted with full consciousness. Basically a full backup of your brain.

Catch being that the backup procedure is fatal.
LVL 19

Author Comment

by:Lucas Bishop
No question. Just a post about something I found a bit fascinating.
LVL 27

Expert Comment

it is interesting. I do not think I wil try it any time soon.
Hi Experts,

I have the following code that is to produce a PDF with a Pie Chart.

$PATH_TO_ROOT = '../';

$report_name = 'STATISTICS FOR ';

$os_id = $_SESSION['os_id'];
if ($os_id != 0){
    $spec = $_SESSION['specialist'];
    $report_name .= $spec[0]['first_name'] . ' ' . $spec[0]['last_name'];
} else {
    $report_name .= 'Agency-Wide';

$user = $_SESSION['user']['first_name'] . ' ' . $_SESSION['user']['last_name'];
$report_footer = 'printed by: ' . $user;

require_once $PATH_TO_ROOT . 'utilities/general_includes.php'; //<-- General
require_once $PATH_TO_ROOT . 'reporting/configure_pdf.php';

$pdf = new ReportPDF('P', 'mm', array(215.9, 279.4));


//Client Stats
    $client_stats = $_SESSION['client_stats'];
    $stats_x = 150;
    $stats_lable = 30;
    $stats_value = 20;
    $pdf->draw_pdf_cell($stats_lable, 'Active Clients');
    $pdf->SetX($stats_x + $stats_lable);
    $pdf->draw_pdf_cell($stats_value, $client_stats['active'], 'R');
    $pdf->draw_pdf_cell($stats_lable, 'Closed Clients');
    $pdf->SetX($stats_x + $stats_lable);
    $pdf->draw_pdf_cell($stats_value, $client_stats['closed'], 'R', FALSE, 'B');
    $pdf->SetFont($default_font_family, 'B');

Open in new window

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?
Factors that will drive Python growth in 2018

Python was the fastest growing programming language in 2017. Although Python has been around quite a while, the recent growth factors many aspects. One of the major aspects is the rise of data science, data mining and machine learning.
Hey all I am in need of some help with determines what box I need to place a given image into depending on that images ratio (image width / image height) to the box areas Aspect Ratio (box width / box height).

The code below is what I currently have that I am using to determine this (which does not work):

public static Dictionary<string, List<double>> sizeOfPhotoBoxes = new Dictionary<string, List<double>>()
                                              |     [Height]
                                              |     |      [Aspact Ratio]
                                             ↓    ↓    ↓
        KEY:         VALUE(s):   [1]  [2]  [3]*/
     { "box1", new List<double> {357, 272, 1.31} },
     { "box2", new List<double> {357, 272, 1.31 } },
     { "box3", new List<double> {365, 460, 0.79 } },
     { "box4", new List<double> {365, 265, 1.38 } },
     { "box5", new List<double> {715, 455, 1.57 } },
     { "box6", new List<double> {360, 465, 0.77 } },
     { "box7", new List<double> {360, 465, 0.77 } },
     { "box8", new List<double> {360, 465, 0.77 } },
     { "box9", new List<double> {540, 290, 1.86 } },
    { "box10", new List<double> {540, 290, 1.86 } }

double RA = (double)item.images[0].width / item.images[0].height;

foreach (var AR in sizeOfPhotoBoxes)
   if (AR.Value[2] >= RA && AR.Value[2] <= RA)

I'm …
If I attempt melt ybco powder in order to make a circuit at what temperature will it begin to chemically break-down? is this feasible?
Hey all I have the following image box' sizes on my WPF form:
 Box |Width |Height
 1   |357   |272
 2   |357   |272
 3   |365   |460
 4   |365   |265
 5   |715   |455
 6   |360   |465
 7   |360   |465
 8   |360   |465
 9   |540   |290
 10  |540   |290

Open in new window

So visually it would look something like this:
 |       |        |       |
 |   1   |    2   |       |
 |----------------|   3   |
 |                |       |
 |                |-------|
 |       5        |       |
 |                |   4   |
 |        |       |       |
 |   6    |   7   |   8   |
 |        |       |       |
 |            |           |
 |     9      |     10    |

Open in new window

So what my goal is is to get the current image I am wanting to place into a box and get its width and height and from that determine the best box to place it in so that it will show the image:

- Without black borders on either the left/right or top/bottom (or both).
- Not chop off the important areas of the image (mostly the middle section moving out).

I have decided to use Magick.NET in order to ease the pain of doing something like this from scratch. So when I determine what box I will be placing the image into then I can use the Magick.NET to crop it using:

Resize with something like this:
imgStream.Crop(width, height, Gravity.Center);

Open in new window

MagickGeometry size = new MagickGeometry(width, height);
size.IgnoreAspectRatio = maintainAspectRatio;
// Adjust geometry offset to center of image (same as `-gravity Center`)
size.Y = imgStream.Height / 2 - height / 2;
size.X = imgStream.Width / 2 - width / 2;

Open in new window

So to sum up the above - I am in need of finding the best box to place the image into before I go and use Magick.NET on it.
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.

Dear experts,

In the attached screen I have shown the text from ‘application of derivatives’ discussing the calculation of approximate values of delta-n.

Can someone please explain the steps n text between 2 and 3.

I am having a challenge to understand how delta-x=delta-y has been arrived by the substitution.

Thank you
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
What are the differences between mortgage interest rate and APR?
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 …
I would like to distribute the difference between the weekly labor target G2 and the weekly hours of operation I2 in even 0.25 chunks. The difference between G2 and I2 is in J2. If you multiply J2 by four you can see that I have 82 0.25 hour chunks of time available to distribute. How can I distribute those 82 chunks based on the needs represented by the ticket counts (workload) represented in column F. It's okay for some rows to be blank as long as I don't exceed the 82 chunks of time available and distribute the 0.25 hours to the intervals where the needs are highest.

I have tried distributing the labor based on a ratio defined by F/G but that often results in uneven labor or labor that is blowing the budget available.
Can anyone tell what is the difference between data analytics and data science?
what are good science experiments for my grade
I have a set of seven parameters which are numerical values (i.e. current readings, pitch, roll and yaw angles, acceleration, etc..) and I use them to classify a vehicle behavior.
For example, if:

pitch=12 degrees
yaw=41 degrees
Y_acc = 10 m/s^2

then the vehicle behaviour is classified as A otherwise if

pitch=15 degrees
yaw=42 degrees
Y_acc = 11 m/s^2

then the vehicle is classified as B, and so on..

What is the best way to implement this kind of classification in Matlab?
Should I use a simple neural network? Or a classification method like SVM?
Is there any tutorial or example?

I have a set of data where each set of parameters is related to a specific behavior, so I can use this to train my model.

Thank you!
why is aluminum foil good at keeping things cold
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.

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?

I need help finding the general mathematical form (similar to "n choose k") of a counting/probability problem. It arose after a coworker implemented a simple JS fix to prevent something from displaying multiple times when sampled randomly and I wondered what the odds of it happening were. As formally as I could state it is as follows:

Problem Statement:
Given n distinct options with equal probability of occurring, what is the probability of at least one grouping of type ni of size k or greater appearing after s independent samplings?

I've looked into multinomial coefficients but couldn't figure out how to generalize it so it didn't matter which pair happened or that larger pairs should count towards it. A Poisson Distribution also looked promising but the simplest form seems to only be concerned with the probability of a single thing happening over a given time frame. Instead I hacked together some JavaScript to at least get a sense of its behavior.

Roll a die 10 times. What is the probability that any of the numbers occurs at least 3 times?

Monte Carlo Solution
This will happen approximately 93% of the time given by the following code:


Open in new window

Nick and Sarah are partners. Their invested capital is $30000 and $45000. Respectively

a)what is their capital ratio
b)if the share of each in a net profit of $18000
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?
Computer Science
There's never been a better time to become a computer scientist. Employment growth in the field is expected to reach 22% overall by 2020, and if you want to get in on the action, it’s a good idea to think about at least minoring in computer science and knowing how to code.
Dear experts,

I am planning to pursue MS in Financial Engineering.

I come with a commerce background and do not have statistics background.

I am looking for anyone/online course which can teach me college level statistics. Please find attached the front page of the book which i intend to cover. I am looking for a resource which can teach me the subject.

I live in Visakhapatnam, India.

Kindly guide.

Thank you

Math / Science

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