caroroza takenya gotthart

0 views
Skip to first unread message

Trudi Miranda

unread,
Aug 3, 2024, 1:53:18 AM8/3/24
to cokemahew

Currently, I am trying to make a calculator using Java, but have come across an error in my code...I have been trying to figure out the cause of the problem but I am absolutely stuck. I am trying to create a calculator that has users enter an equation on one line, and through parsing, the program should be able to give me a correct answer. Currently I have only programmed the math to calculate equations with two operands (+,-,*,/,^), but I also want my program to calculate equations with single operands (absolute value, sin, cos, tan).

As of right now, I feel as though my code is headed in the right direction: except there is a significant error, the cause of which I am unsure. public class Maths is not working in my main block of code. When I was creating this, I had the idea that I would use procedural decomposition and make a separate method where the computation would take place, while the actual collection of variables would happen in the main class.

The calculator solution will show work using the quadratic formula to solve the entered equation for real and complex roots. Calculator determines whether the discriminant \( (b^2 - 4ac) \) is less than, greater than or equal to 0.

Hello, my name is Stephen Lanford and I am very new to using Microsoft Excel. I am currently trying to solve a problem in a physics class in which I am required to use Excel to solve for an unknown variable in the equation for acceleration of an object in simple harmonic motion. The equation is a(t)=-A(2pi/T)^2 times (cos(2pi/T)(t)), where a is acceleration, t is time, A is amplitude, and T is the period of oscillation. The values of t (3.45 seconds), of a (1.89 m/s^2), and of A (2.34 m) are given. I need to solve for T, which will describe the period of oscillation in seconds.

My text tells me not to "waste time trying to rearrange this equation for the variable of interest (T)" and this equation is so complex that I quite frankly could not figure out how to arrange this equation as "T= everything else" anyway.

The problem is that when I plug this equation into Excel, I cannot seem to find any way to solve for T unless I actually have one of the boxes set for T= something. Unless I have a definite value or direct expression for T, it displays a message that I am committing a division by zero error, since the unknown T is divided by twice in the equation

Attached to this message is a link to my current worksheet on Excel for this problem, so you can tell me what I am doing wrong and need to rearrange. Also attached is the worksheet from my physics class that asks me to do this problem with Excel (note that it is the 2nd of the two problems given in the two page worksheet).

I assume that multiple correct values in this case is simply due to the oscillating nature of the cosine function. However, I am not sure how to set things up to solve for six correct solutions in Excel!

Also, using Solver and setting D2 as the objective (to a value of 1.89, by changing variable cell B4), I got an answer of T = 1.256897 s. This turned out to be at least one of the six correct values for T, as I plugged it into the equation with my calculator and saw the equation multiplied out very close to 1.89. (I also plugged in the 1.06 value of T, but found the equation multiplied out to 2.34, which is the value of A, not of a(t).)

Anyway, do you know how I can set things up using Solver and Excel so that it will show six correct values for the period described by this equation? I have attached the assignment sheet again so you can take another look at what the problem is asking me to do.

The Equation Solver on your TI-84 Plus calculator is a great tool for solving one-variable equations. The Solver is also capable of solving an equation for one variable given the values of the other variables. Keep in mind that the Solver can only produce real-number solutions.

Jeff McCalla is a mathematics teacher at St. Mary's Episcopal School in Memphis, TN. He cofounded the TI-Nspire SuperUser group, and received the Presidential Award for Excellence in Science & Mathematics Teaching.

I could use MATHCAD or MATLAB but I might as well use excel if I am going to use one of those. I have used EES for a couple of years now and the true power in it is being able to simultaneously solve systems of equations. For example, I could input 5 equations with 5 unknowns and it would solve for all 5 unknowns instantly without any manipulation to any of the equations. It could even simultaneously solve 100 equations with 100 unknowns!! I could pretty much input them as how they were written in a textbook or scientific paper without manipulation. If I was to do that in MATLAB, MATHCAD, or Excel, I would need to then waste a lot of time setting up a matrix to solve and you could imagine how time consuming that would be with 10+ equations/unknowns. EES is able to determine the variables that are unknown and its architecture automatically organizes the matrix and solves it. EES is also very powerful at combining this feature with being able to parametrically sweep design variables.

is not true when it come to Mathcad (although that would be one possible approach if the equations are linear), but maybe the setup in EES is even easier, or more flexible for differential equations. It says it handles integral equations too, which Mathcad doesn't (so they have to be converted to differential equations, which is possible, but a PITA).

In fact, it looked familiar and reminded me of some other software that I'd seen sometime in the past ... after a bit of inspiration I found it, TK Solver; it's still around and also does the solver bit (as you might guess from the name).

I'd have to have a play with it, but at first sight it doesn't look significantly easier to use than Mathcad ... at least, not enough to warrant a change, given all the other things Mathcad can do. I downloaded the manual to have a quick skim and I haven't looked at any of the videos.

Hmm. In the first example shown at the link given by Stuart, EES only seems to provide a single solution set to a set of non-linear equations. Mathcad provides two sets of solutions, as does the (free) Microsoft Mathematics 4 calculator (though this last is restricted to no more than 6 simultaneous equations).

Thanks. I see. Somewhere on their web page, or in the documentation, or in a video, I noticed that it said EES solves numerically. I think if you don't enter a guess value it uses a default. I don't think it can do symbolic math, so the only way to get both solutions would be to play around with the guess values.

dCode calculator can solve equations (but also inequations or other mathematical calculations) and find unknown variables. The equations must contain a comparison character such as equal, ie. = (or ).

dCode returns exact solutions (integers, fraction, etc.) by default (for linear and nonlinear equation systems), if the equation contains comma numbers then dCode will return a solution with decimal numbers.

Use the dedicated tool to check an equality or else, enter the equation and click on solve, the solver will answer true if the equality is checked whatever the variable (there are an infinite number of possible solutions for the variable).

The calculation steps of the solver are not shown because they do not correspond to the steps a human would make. The operations performed by the solver are binary calculations bit by bit very different from those of a resolution by hand from a mathematician.

The most reliable protein estimation is performed using a reference or a protein standard that has properties similar to the protein being estimated. Often, it is difficult to find a protein standard with similar properties to the sample being analyzed. As a result, it has become acceptable to use readily available proteins such as bovine serum albumin (BSA) and gamma globulin as standards. Using either the BSA or the bovine γ-globulin (IgG) as reference proteins, Bradford protein assays do show significant protein-to-protein variation; hence, the calculated result is an estimation of protein concentration.

A key point to remember is that identically assayed samples are directly comparable. This means that unknown samples and standards that are treated identically are directly comparable in terms of protein estimation. As a result, it is highly recommended to use the same buffers that your unknown samples are in for the generation of your standards.

Below is a simple table for the generation of your standards. As a general rule of thumb, use at least 6 standards for generating the standard curve and adjust the dilutions of standards to cover the expected range of your unknown samples. More importantly, stay within the linear range of your protein assay.


The above table is shown to help lessen the confusion when standard curves or protein assays are performed based on the amount of protein; however, most researchers want to know the amount of protein in their sample, not the amount of protein in the assay tube or well. So, it is critical to always generate standard curves based on their starting concentrations.

Most commercial assays will express the linear range of the assay, the range over which the assay is accurate. You should ensure that your unknown sample is within that linear range. If you know your sample is greater than the linear range, or if after performing an assay is outside the linear range, then you would need to dilute the sample.

For example, if the unknown sample is expected to have a concentration of 5mg/ml and the linear range of your assay is 0.1-1mg/ml, then the unknown sample needs to be diluted 10 fold so it is in the middle of the linear range. A 10-fold dilution would be 1 part unknown sample to 9 parts buffer of choice, or 100l unknown sample added to 900l buffer of choice.

Perform the assay and calculate the standard (see below). The result should be around 0.5mg/ml. To calculate the concentration of the undiluted, unknown sample, simply multiply by the dilution factor. So, 0.5 x 10= 5mg/ml.

c01484d022
Reply all
Reply to author
Forward
0 new messages