Math help: calibrating adxl375

I have to 12 point calibration of adxl375. I have attached a datasheet of the method. Page 7 shows the equation 1 which i have to solve.
It has 12 known.
We keep sensor in six different poisition, each generate 3 set of equations to fit in the matrix. Equations arre below. I have filled value of Ax,Ay,Az:
How to solve that in labview??
/* +z axis */
a11*30 + a12*50 + a13*2548 + o1 = 0
a21*30 + a22*50 + a23*2548 + o2 = 0
a31*30 + a32*50 + a33*2548 + o3 = 1
/* -z axis */
a11*20 + a12*10 + a13*980+ o1 = 0
a21*20 + a22*10 + a23*980 + o2 = 0
a31*20 + a32*10 + a33*980 + o3 = -1
/* +y axis */
a11*30 + a12*1911 + a13*50 + o1 = 0
a21*30 + a22*1911 + a23*50 + o2 = 1
a31*30 + a32*1911 + a33*50 + o3 = 0
/* -y axis */
a11*20 + a12*49 + a13*10+ o1 = 0
a21*20 + a22*49 + a23*10 + o2 = -1
a31*20 + a32*49 + a33*10 + o3 = 0
/* +x axis */
a11*2303 + a12*30 + a13*50 + o1 = 1
a21*2303 + a22*30 + a23*50 + o2 = 0
a31*2303 + a32*30 + a33*50 + o3 = 0
/* -x axis */
a11*392 + a12*20 + a13*10+ o1 = -1
a21*392 + a22*20 + a23*10 + o2 = 0
a31*392 + a32*20 + a33*10 + o3 = 0
Attachments:
DM00119044_2.pdf ‏304 KB

1. I have made a equation as in attached excel file. Equation has 18 varaibles.
2. Then I took 6 readings from adxl375 which in turn form 18 equations. 
Equations are in matrix form in block diagram of labview program attached. 
3. I am getting error: 20001;  The matrix is rank deficient
4. I don't know why this error. i have 18 equations & 18 variables.
5. With error, I still get values in "Solution matrix" in front panel. These values when i put back in equation , I got result as in "AxB" in front panel.
These values are almost matching result. So not a problem at this stage.
I want to know is there any more aggressive method to get exact results.
Attachments:
matrix.xlsx ‏11 KB
18 vars.vi ‏15 KB

Similar Messages

  • Help calibrating color profile for two monitors??

    I have two cinema display monitors (one new, the other 1 year old), and I can't get them to share a color profile. Through SysPrefs I can calibrate them individually, but the results look completely different. The older monitor appears "pinker" overall, esp. in the light tones. When I finish calibrating, the last dialogue box asks to if I want to share the color profile, but I can't see the new profile in the other monitor's Display Profile list.
    Any help is greatly appreciated!
    Mac Pro   Mac OS X (10.4.7)  

    Barron,
    You have to load the profile you want to share into the approriate folder >Library>ColorSync>Profiles>Displays
    Then you have to double click the profile, it will open ColorSync.
    Then Go to Devices, Then colapse Displays, Click on your Cinema Display and you will see a little arrow, looks like a play button. Click the button and it will bring up a menu allowing you to load a profile, then you can load your shared profile.
    Why this is how you have to do it, I will never know, seems awfully PC like.

  • HELP Calibrating causing major issues

    After I calibrated my workouts my average pace has gone WAY up and before I calibrated everything was well and everything seemed pretty well accurate. I don't know how to change it back to the original and I don't even know how calibrating works and why it's screwing everything up!! SOMEBODY PLEASE HELP ME
    Intel Inside Pentium 4   Windows XP  

    Is a treadmill really accurate for calibration? We do have these expensive ($8k) treatmills in the studio. Can I really trust the reading there? My nike+ipod is off by more than 100m against the treatmill on a 1000m run. The treatmill shows 1100m and Paula Redcliff says: You've completed 1 kilometer Thanks for any advice!

  • Math.cos Math.sin = Math.HELP

    Hello Everyone,
    I was hoping to create a JS script to move objects away from common center based upon their current position. I was thinking to use a single selected path item as the center based on its position x/y and width/height. Using this reference point the script would then move away all other path items from this center point based on a desired amount and with uniform increments given their current location from this center. I was thinking cos and sin would be my friend in this case, however they seem to have become my foe instead. ;-)
    Does this sound doable? What am I missing, doing wrong, misinterpreting? Below is a non-working attempt, I can't seem to sort things out, perhaps I was close and missed it or maybe I am super way off and its more complex than I thought. However at this point I am confused across my various failed attempts this only being one of them.
    Thanks in advance for any assistance and sanity anyone can provide.
    // Example failed code, nonworking concept
    var docID = app.activeDocument;
    var s0 = docID.selection[0];
    pID = docID.pathItems;
    var xn, yn;
    var stepNum = 20;
    for (var i = 0; i < pID.length; i++) {
        var p = pID[i];
        var dx = ((s0.position[0] + s0.width) / 2 - (p.position[0] + p.width) / 2);
        var dy = ((s0.position[1] + s0.height) / 2 - (p.position[1] + p.height) / 2);
        xn = Math.cos(Number(dx) * Math.PI / 180)+stepNum;
        yn = Math.sin(Number(dy) * Math.PI / 180)+stepNum;
        var moveMatrix = app.getTranslationMatrix(xn, yn);
        p.transform(moveMatrix);
        stepNum+=stepNum;

    Hi W_J_T, here's one way to do what I think you want to do, I commented out the step increment so all items will "explode" the same distance, not sure if that's what you need.
    first I'd move the calculation of the Selected object's center out of the loop, you only need to make the math once.
    also, (s0.position[0] + s0.width) / 2  has a problem, it will not give you the center, check below
    // calculate Selection center position
    var cx = s0.position[0] + s0.width/2;
    var cy = s0.position[1] + s0.height/2;
    then we're going to loop thru all items and calculate their center
            // calculate pathItem's center position
            var px = p.position[0] + p.width/2;
            var py = p.position[1] + p.height/2;
    we're going to skip calculating the distance from the selection's center to each item's center, we don't need it for this method, other methods could use this info.
    now, your actual question about Sin/Cos
    xn = Math.cos(Number(dx) * Math.PI / 180)+stepNum;
    sin(angle) and cos(angle) expect angles in Radians, you are not providing any angles in the formula above. We need to calculate the angle between Selection's center and each path's center
            // get the angle formed between selection's center and current path's center
            var angle = get2pointAngle ([cx,cy], [px,py]);
    once we have the angle we can apply it to our "Explosion" variable, I'm assuming is stepNum, and get its x and y distance it needs to move away from selection
            // the distance to move is "stepNum" in the same direction as the angle found previously, get x and y vectors
            var dx = stepNum*Math.cos(angle);// distance x
            var dy = stepNum*Math.sin(angle);// distance y
    all is left to do is move the paths, here's the whole thing
    // Explosion, AKA move all items away from selection
    // carlos canto
    // http://forums.adobe.com/thread/1382853?tstart=0
    var docID = app.activeDocument;
    var s0 = docID.selection[0];
    pID = docID.pathItems;
    var stepNum = 20; // this is the distance to "explode"
    // calculate Selection center position
    var cx = s0.position[0] + s0.width/2;
    var cy = s0.position[1] + s0.height/2;
    for (var i = 0; i < pID.length; i++) {
        var p = pID[i];
        // skip selected item
        if (!p.selected) {
            // calculate pathItem's center position
            var px = p.position[0] + p.width/2;
            var py = p.position[1] + p.height/2;
            // get the angle formed between selection's center and current path's center
            var angle = get2pointAngle ([cx,cy], [px,py]);
            // the distance to move is "stepNum" in the same direction as the angle found previously, get x and y vectors
            var dx = stepNum*Math.cos(angle);// distance x
            var dy = stepNum*Math.sin(angle);// distance y
            var moveMatrix = app.getTranslationMatrix(dx, dy);
            p.transform(moveMatrix);
            //stepNum+=stepNum;
    // return the angle from p1 to p2 in Radians. p1 is the origin, p2 rotates around p1
    function get2pointAngle(p1, p2) {
        var angl = Math.atan2(p2[1] - p1[1], p2[0] - p1[0]);
        if (angl<0) {   // atan2 returns angles from 0 to Pi, if angle is negative it means is over 180 deg or over Pi, add 360 deg or 2Pi, to get the absolute Positive angle from 0-360 deg
            angl = angl + 2*Math.PI;
      return angl;

  • Math help needed

    I have the following problem:
    I've written some code which should be able to make a object move along a 3d-heading a,b. But the problem is is that it always moves down (v.yp increases) nomatter where i send the auto pilot.
    Can anyone please check the math of this program???
    package fleetcommanderserver;
    import java.io.*;
    import java.lang.*;
    import java.util.*;
    class Base {
      String Name;
      ArrayList TradeList, Banned;
      double balance, xp, yp, zp;
    class Vessel {
      String Name, Type, User, Validation;
      double xp=0, yp=0, zp=0, a=0, b=0, v=0;
      int AutoPilotMode=0, Damage=0, Shields=100, Armor=100;
      ArrayList CmdList=new ArrayList(), Cargo=new ArrayList(), TradeValues=new ArrayList();
    class User {
      String Name, Password, CallSign;
      double score, balance;
      int atBase;
      ArrayList Vessels;
    class TradeItem {
      String Description;
      double Buy, Sell;
      long Quantity;
    public class GameControl {
      ArrayList Bases, Users;
      long rate=100;
      ServerControl sc;
      public GameControl() {
        try {
          String str;
          Bases = new ArrayList();
          Users = new ArrayList();
          ArrayList Items = new ArrayList();
          FileReader fr = new FileReader("/sources/fleetcommanderserver/items.txt");
          BufferedReader br = new BufferedReader(fr);
          while ((str=br.readLine())!=null) {
            Items.add(str.trim());
          fr = new FileReader("/sources/fleetcommanderserver/src/fleetcommanderserver/basenames.txt");
          br = new BufferedReader(fr);
          while ((str = br.readLine())!=null) {
            Base b = new Base();
            b.Name = str.trim();
            b.xp = (Math.random() -.5)*1e10;
            b.yp = (Math.random() -.5)*1e10;
            b.zp = (Math.random() -.5)*1e10;
            b.balance = 1e18;
            b.TradeList = new ArrayList();
            for (int a=0; a<Items.size(); a++) {
              TradeItem i = new TradeItem();
              i.Description=(String)Items.get(a);
              i.Buy=(Math.random()*1e3);
              i.Sell=(Math.random()*1e3);
              i.Quantity=0;
              b.TradeList.add(i);
            b.Banned = new ArrayList();
            Bases.add(b);
          fr.close();
          fr = new FileReader("/sources/fleetcommanderserver/users.txt");
          br = new BufferedReader(fr);
          int a, b, c=10;
          while ((str = br.readLine())!=null) {
            User u = new User();
            a = 0;
            while (str.charAt( (int) a) != 32) a++;
            u.Name = str.substring(0,a);
            a++;
            b = a;
            while (str.charAt( (int) a) != 32) a++;
            u.Password = str.substring(b, a );
            a++;
            b = a;
            while (str.charAt( (int) a) != 32) a++;
            String s = str.substring(b, a );
            u.balance = Double.valueOf(s).doubleValue();
            u.score = 0;
            u.atBase = (int) (Math.random()*Bases.size()+1);
            u.Vessels = new ArrayList();
            Vessel v=new Vessel();
            v.Name="Vessel" + c++;
            u.Vessels.add(v);
            Users.add(u);
          CalcProgress cp = new CalcProgress ((GameControl)this);
          Timer t1 = new Timer();
          t1.scheduleAtFixedRate(cp, 0, rate);
        } catch (Exception e) {
          e.printStackTrace();
          System.exit(1);
    class CalcProgress
        extends TimerTask
        implements Runnable {
      GameControl gc;
      public CalcProgress(GameControl GC) {
        gc = GC;
      public void run() {
        int a, b;
        for (a = 0; a < gc.Users.size(); a++) {
          User u = (User) gc.Users.get(a);
          for (b = 0; b < u.Vessels.size(); b++) {
            Vessel v = ( (Vessel) u.Vessels.get(b));
            if (v.CmdList.size() >= 1) {
              String s[] = ((String)v.CmdList.get(0)).split(" ");
              int AutoPilotMode=0;
              if (s[0].equals("goto")) {
                AutoPilotMode=1;
              switch (AutoPilotMode) {
                case 1:
                  Base p=null, q=null;
                  for (int c=0; c<gc.Bases.size(); c++) {
                    p = (Base) gc.Bases.get(c);
                    if (s[1].equals(p.Name)) {
                      q=p;
                      break;
                  if(q!=null) {
                    v.a = (Math.atan((q.xp-v.xp)/(q.yp-v.yp))/(2*Math.PI))*360;
                    double r=Math.sqrt((q.xp-v.xp)*(q.xp-v.xp)+(q.yp-v.yp)*(q.yp-v.yp));
                    v.b = (Math.atan(r/(q.zp-v.zp))/(2*Math.PI))*360;
                    v.v = 1000000;
                  break;
            else {
              v.v = 0;
            double k = ((2 * Math.PI) / 360 )* v.a, l = ((2 * Math.PI) / 360 )* v.b;
            double vx = Math.sin(k) * Math.sin(l) * v.v/(double)gc.rate/1000,
                vy = Math.cos(k) * Math.sin(l) * v.v/((double)gc.rate/1000),
                vz = Math.cos(l) * v.v/(double)gc.rate/1000;
            if (vx==Double.NaN) vx=0;
            if (vy==Double.NaN) vy=0;
            if (vz==Double.NaN) vz=0;
            v.xp += vx;
            v.yp += vy;
            v.zp += vz;
    ps. I have checked: vy, vx or vz does nor become a NaN...thx in advance
    gr. Razorblade

    if (vx==Double.NaN) vx=0;
    if (vy==Double.NaN) vy=0;
    if (vz==Double.NaN) vz=0;
    ps. I have checked: vy, vx or vz does nor become a
    NaN...And how did you check? Because the above code will NEVER be true even if, for example, vx is NaN. And that is because NaN != Nan is always true (that is how it is defined to work.)
    You can validate this yourself with the following code....
    System.out.println("result=" + (Double.NaN == Double.NaN)); // false
    System.out.println("result=" + (Double.NaN != Double.NaN)); // true

  • Need math help, bit rates

    Sorry, I know this should be in the compressor or DVD SP forum, but there isn't enough traffic there and I need this ASAP. Hope someone knows bitrate calculations well. I have a file. The total bitrate is 7.15Mb/s. THe audio is 224Kb/s at 48KHz ac3. what is the video average bitrate?
    Streamclip tells me the video is 8Mb/s, so obviously it is a VBR file, cause if the entire thing is only 7.15, the video can't be 8 down the whole thing. So I need the average bitrate to match another file that I have yet to compress.
    Matt
    p.s. I wouldn't mind learning to fish as well, if you are so inclined...
    Message was edited by: RedTruck

    Hey,
    Thanks for the reply. The file was given to me on a DVD. I have permission to rip and re-burn along with another file that I am creating. It is obviously MPEG2, but I already ripped and demuxed, so I now have the m2v.
    I have another movie going on the same track (has to be a track so I can make a story in Studio Pro and have smooth playback for a presentation.)
    Using MPEG Streamclip for diagnosis, the m2v is 8 Mbs. The audio file is ac3 at 224 Kbs. The entire movie clocked out at 7.15 Mbs. So I need to calculate the average bit rate for the video so I can encode my movie at the same rate.
    The whole 1024 bits to bytes and 4.7GB on a disk which is actually 4.38... ah... bloowey... I can't figure out exactly the bit rate so they will fit in the same track. I am actually re-encoding her movie right now so I can just duplicate the setting. But I would still like to know how to get an accurate calculation for the future. I have had to do this before and I always wind up wasting time re-encoding.
    Thanks for any help you can give.
    Matt

  • In settings for display i believe i have trouble with calibrating the color contrast

    i i need help calibrating the color contrast...

    Hi trudyslater, 
    I apologize, I'm a bit unclear on the exact nature or context of your question. If you are having issues calibrating the display on your MacBook Pro, you may find the following article helpful:
    OS X Yosemite: Calibrate your display
    If you are having other display issues, you may find this article more useful:
    Apple computers: Troubleshooting issues with video on internal or external displays - Apple Support
    Regards,
    - Brenden

  • "battery not available", battery not charging

    I just bought a NuPower battery fo my IBook G4. It's been working fine for a month or so. However, now my computer won't charge the battery. Near the battery icon at the top of the screen, it at first says "caluculating..." and then says "battery not available". Further, sometimes even when the power cord is plugged in (and the LED's are lit up), it still runs on the battery power and says the power is not plugged in. And, the lighting on the LED's do not correspond at all with the battery charge(i.e. it is sometimes green even though there is no battery power). Maybe these are 2 different problems?
    Any advice would be appreciated-I'm no where near a MAC service provider.

    There are two things you could try.
    1. "Resetting PowerBook and iBook Power Management Unit" (PMU)
    Performing a PMU reset returns the iBook and PowerBook hardware, including NVRAM,
    to default settings and forces the computer to shut down. ...
    http://support.apple.com/kb/HT1431 - 36k - Cached - Similar pages
    2. "Calibrating your computer's battery for best performance"
    The battery needs to be recalibrated from time to time to keep the onscreen battery
    time and percent display accurate. With all iBooks and PowerBook G4 ...
    http://support.apple.com/kb/HT1490 - 27k - Cached - Similar pages
    "Mac OS X 10.4 Help: Calibrating an iBook or PowerBook battery"
    If you have an iBook or PowerBook portable computer, you should calibrate the
    battery to get the longest running life during the first week you have your ...
    http://docs.info.apple.com/article.html?path=Mac/10.4/en/mh1959.html -
    Also, you may see what the computer's power and battery life look like in
    the Profiler's energy/battery logs. Some widgets are good for battery info.
    The battery seller may have some kind of support, since that part is not
    an original replacement part and may have issues of its own. Sometimes
    the recalibration and pmu resets will help new batteries work properly.
    Good luck & happy computing!

  • What is Speech Recognition and how do you use it?

    Hello, people. I was on my System Preferences and just out of curiosity, I clicked on Speech. Then there was a tab on the right called Speech Recognition. What is Speech Recognition and how do you use it?

    When you turn it on the default should be listen only when ESC key is pressed. Hold the ESC key and say, in your normal voice, "show me what to say".
    For fun.. say "tell me a joke"
    Mac OS X 10.6 Help: About speech recognition
    About speech recognitionhttp://docs.info.apple.com/article.html?path=Mac/10.6/en/8355.html
    Mac OS X 10.6 Help: Speech Recognition Commands preferences
    Speech Recognition Commands preferenceshttp://docs.info.apple.com/article.html?path=Mac/10.6/en/8407.html
    Mac OS X 10.6 Help: Speech Recognition Settings preferences
    Speech Recognition Settings preferenceshttp://docs.info.apple.com/article.html?path=Mac/10.6/en/8408.html
    Mac OS X 10.6 Help: Calibrating speech recognition to your environment
    Calibrating speech recognition to your environmenthttp://docs.info.apple.com/article.html?path=Mac/10.6/en/8406.html
    Mac OS X 10.6 Help: If the Speech Recognition pane is empty
    If the Speech Recognition pane is emptyhttp://docs.info.apple.com/article.html?path=Mac/10.6/en/8907.html

  • Is it bad to (almost) always run MacBook Pro using the adapter?

    Question is in the title.
    If you always run your laptop with the adapter, would that have a negative impact on the battery life/performance due to not being used as much?
    15.4" Macbook Pro Intel Core 2 Duo   Mac OS X (10.4.8)  

    This is no problem, just make sure you calibrate your battery regulary! I do it at least every month!
    Quoted from Apple: Calibrate the battery in your MacBook or MacBook Pro every month or two to keep your battery functioning at its fullest capacity.
    Mac OS X 10.4 Help - Calibrating a MacBook or MacBook Pro battery:
    http://docs.info.apple.com/article.html?path=Mac/10.4/en/mh2339.html
    Hopefully this is helpfull or solved your problem.
    Please see the "helpfull" and "solved" button's on top off this message! Apple: Why reward points?

  • Algorithim on AC waveform

    Hello,
    I need some math help.
    I am measuring an AC waveform (see atached screenshot).  I need to detect "Events" i.e. a sinusoidal waveform with a different amplitude.  What math would I run to determine this.
    Any help would be appreciated.
    Thanks

    Try this. You can see in your output waveform that you have two stair steps. An easy way to detect those stair steps is with a derivative. As your slope changes from 0, you will notice a change in your derivative. I ran the Pt by Pt Derivative function on the output of the Pt by Pt RMS and was able to see two distinct spikes where your RMS is changing. You can run a threshold (just a simple >= function) or a Peak Detector to detect a change in RMS of that magnitiude. You can then run some other code based on whether this value is true or not. 
    This isn't a perfect solution, but it should get your closer to your goal. You will probably need to run some additional filtering to get some really clean peaks. The Peak Detector can handle some of that for you.
    www.movimed.com - Custom Imaging Solutions
    Attachments:
    test Count Events.vi ‏14 KB
    Calculate Events.vi ‏24 KB

  • Help with math / calculations in RTF templates

    Greetings,
    I know that there are math capabilities in the templates... I've seen the code samples in the Core Components guide.
    What this doesn't tell you is WHERE these things would go in a template. And... that... is my question.
    We are just starting to use BIP in conjunction with JDE EnterpriseOne (8.12, tool set 8.97.12). For our first attempt we're creating our template over a new report.
    I have a template where I sum two different repeating values (through the normal BI Properties) and place these values in two separate cells in a table. I want to sum the two of these together for a "grand" total.
    I've seen the "examples" but they really aren't very helpful. The xsfo, etc. for doing addition is fine, but WHAT are the values to add and WHERE does the code go?
    If anyone has done something like this or has experience using the embedded code I would appreciate hearing from you.
    Thanks in advance

    I see what you are saying about the spaces... but it made no difference... still got the error.
    The XML file is too large and convoluted to be pasted here.
    With reqards to the following snippet:
    COLA = <?sum(current-group()/COLA)?>
    COLB = <?sum(current-group()/COLB)?>
    Summ== <?sum(current-group()/COLA) + sum(current-group()/COLB)?>
    Where does THIS code go?
    Here is the error detail:
    ConfFile: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\config\xdoconfig.xml
    Font Dir: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    Template: C:\Documents and Settings\jdenison\My Documents\BIP Templates\R5642001\R5642001_TEMPLsave.rtf
    RTFProcessor setLocale: en-us
    FOProcessor setData: C:\Documents and Settings\jdenison\My Documents\BIP Templates\R5642001\R5642001_RICE0001_D081029_T144059683.xml
    FOProcessor setLocale: en-us
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.invokeProcessXSL(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLTWrapper.transform(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.createFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.generate(Unknown Source)
         at RTF2PDF.runRTFto(RTF2PDF.java:629)
         at RTF2PDF.runXDO(RTF2PDF.java:439)
         at RTF2PDF.main(RTF2PDF.java:289)
    Caused by: oracle.xdo.parser.v2.XPathException: Extension function error: Method not found 'sum'
         at oracle.xdo.parser.v2.XSLStylesheet.flushErrors(XSLStylesheet.java:1534)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:521)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:489)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:271)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:155)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:192)
         ... 15 more

  • Need help with Math functions for text-based calculator!!!

    I have the calculator working but I am having trouble figuring out thow to do a square root function, nth factorial, absolute value, and Fibonacci. Basically i got the easy part done. Also I am using the case to do the funtions but I am not sure if there are symbols on the keyboard that are commonly used for these funtions so i just made some up. I am new to java and this is only my second assignment so any help would be appreciated. Thanks
    import java.util.*;
    import java.math.*;
    public class calculator
    static Scanner console=new Scanner(System.in);
    public static void main(String[]args)
    double num1=0,num2=0;
    double result=0;
    char expression;
    char operation;
    String Soperation;
    System.out.println("Enter ? for help or enter the operation in which to be processed");
    Soperation=console.next();
    operation = Soperation.charAt(0);
    switch(operation)
    case '+':
    System.out.println("Please the first number");
    num1=console.nextInt();
    System.out.println("Please enter the second number");
    num2=console.nextInt();
    result=num1+num2;
    break;
    case'-':
    System.out.println("Please the first number");
    num1=console.nextInt();
    System.out.println("Please enter the second number");
    num2=console.nextInt();
    result=num1-num2;
    break;
    case'*':
    System.out.println("Please the first number");
    num1=console.nextInt();
    System.out.println("Please enter the second number");
    num2=console.nextInt();
    result=num1*num2;
    break;
    case'/':
    System.out.println("Please the first number");
    num1=console.nextInt();
    System.out.println("Please enter the second number");
    num2=console.nextInt();
    if(num2==0)
    System.out.println("Cannot Divide by Zero");
    result=num1/num2;
    break;
    //square root
    case'^':
    System.out.println("Please enter a number");
    break;
    //fibonacci     
    case'#':
    System.out.println("Please enter the position of the Fibonacci number");
    break;
    //factorial
    case'!':
    System.out.println("Please enter the number for factoring");
    break;
              //absolute value
    case'&':
    System.out.println("Please enter a number");
    num1=console.nextInt();
    result=num1;
    break;
         // help funtion
    case'?':
    System.out.println("Type + for addition, - for subtraction");
    System.out.println("* for multipliction, / for division,^ for the square root");
    System.out.println(" & for absolute value, # for fibonacci,and ! for factorial");
    break;
    System.out.println("The result is:"+result);     
    }

    rmabrey wrote:
    I have the calculator working but I am having trouble figuring out thow to do a square root function, nth factorial, absolute value, and Fibonacci. java.lang.Math.sqrt()
    nothing for factorial - write your own.
    java.lang.Math.abs()
    nothing for Fibonacci - write your own.
    %

  • Help with math.random!

    I'm trying to replace all even numbers in a string with odd numbers that are produced from a random generator. I have somewhat of an idea of how to do it as far as creating an array of 5 characters(1,3,5,7,9) and then implement the math.random to take random numbers from that array. i just dont know how to execute that. for example:
    "adam123456789" -->should be "adam153157739"
    whereas, the underlined(5,1,7,3) should be random numbers(i just picked these for an instance). is it possible to do any form of :
    Methods...
    char [ ] ary = {1,3,5,7,9};
    String line = "adam123456789";
    line = line.replaceAll("[0,2,4,6,8]", Math.round(Math.random()*[ary]));
    return line;**i'm a beginner, so i dont really know what im talking about. just seeking help. thanks!

    ok. this is the class with all of my methods in there. just excuse the rest of it..
    import java.util.Random;
    public class NoVowelNoEven {
      private String str = "";
      NoVowelNoEven() {
        str = "hello";
      NoVowelNoEven(String newString) {
        str = newString;
      String getOriginal() {
        return str;
      static String getValid(String newString) {
        char[] arr = newString.toCharArray();
        String str2 = "";
        for (int i = 0; i < arr.length; i++) {
          if (isValid(arr)) {
    str2 += arr[i];
    return str2;
    static int countValidChar(String newString) {
    String validString = getValid(newString);
    return validString.length();
    static String replaceWithYAndOdd(String newString) {
         char [] ary = {1,3,5,7,9};
         String str3 = newString;
    str3 = str3.replaceAll("[a,e,i,o,u]","y");
    str3 = str3.replaceAll("[A,E,I,O,U]","Y");
         //str3 = str3.replaceAll("[0,2,4,6,8]", );
    return str3;
    static boolean isValid(char char2) {
    switch (Character.toLowerCase(char2)) {
    case 'a':
    return false;
    case 'e':
    return false;
    case 'i':
    return false;
    case 'o':
    return false;
    case 'u':
    return false;
    case '0':
    return false;
    case '2':
    return false;
    case '4':
    return false;
    case '6':
    return false;
    case '8':
    return false;
    default:
    return true;

  • Please help.  Photoshop isn't displaying colors correctly after new monitor/calibration

    When I open JPEGS or RAW images in photoshop they have a dull, flat color to them.  This is happening after recently buying a NEW PA271W wide-gamut display and calibrating it using Spectraview 2.  It doesn't matter whether I have the Working Space in PS set to Adobe RGB or sRGB under color settings... The only way I can make my image look normal is to go under settings and ASSIGN PROFILE to Adobe RGB.  It looks fine then.  I could live with that, except the bigger problem is that I begin my editing process in RAW, where the colors are also looking flat.  The best I can tell, there is no way to assign a profile at this stage... and I don't even know if that would help. 
    I've been working in photoshop many years and I do know that RAW images have a 'flatter' appearance to being with, but this is something completely different.  For example, when I slide photoshop onto my other monitor next to it (I have multiple monitors) - the color reverts to the normal color I want .  And if I then slide photoshop back onto my new NEC monitor, the normal color actually stays intact for about two seconds, then reverts back to the dull color.  So I am unable to begin my work process in RAW since the colors are wrong.  Also, I know that my new monitor is capbable of displaying my images in their proper colors because when I use any of several different image viewers I have - irfanview, etc. - everything is fine.  It's only in photoshop.  Any help will be greatly appreciated.  Thanks, Chance.  Oh, and I have CS5 and I'm using Windows 7.

    What you're describing sounds like your display profile is incorrect.
    Don't mess with the working space, don't assign profiles -- just fix the display profile.

Maybe you are looking for

  • Upgrade error in Phase STARTSAP_NBAS

    Dear Experts, We are doing ECC 5.0 upgrade to ERP6.0 SR3 and during STARTSAP_NBAS phase DDIC locking out and cant start SAP original system. We tried to unlock the password and also did the reset using SAPup reset DDICpwd. But its still locking out.

  • L540 Can external monitor/TV be connected?

    I'm aware of connecting an external monitors such as a tv thru an HDMI connector but the L540 that I'm looking to buy doesn't seem to have one.  I'm not so good with the hardware tech terms (letters) to know if there is something on the L540's that w

  • Problems with a report generated as PDF

    I am having a problem with my report when it is generated as a PDF file from the reports server. A space is added soon after the letter w in all the words where there is letter w; for example, the word awake appears as aw ke, will appears as w ill, e

  • Posture Assessment with ISE for smartphones

    Hi support community.. I would like to know if is posible to implement NAC for smartphones (android phones, iphone, ipads basically) using the ISE. the primary goal would be check that the smartphone has a Antivirus installed. Many Thanks in advance.

  • RA&R Rule Script assistance required

    Hi Forum guru's, We are customising RA&R, Ver 5.3, SP 10 and require some assistance with the SQL script.  We are attempting to disable +-4600 rules at ACTION LEVEL and the tables we are referering to in the script are AC_RULE & AC_HEADER. The script