Solving differential equations

I m working on a project of fluids and i wannu use java programming for solving various equations..please teel me how to solve differential equation using java(partial diffential equations and integration also).thanx

Hi!!
Thanx for ur reply...but I have seen a program on net called JMatLink...which uses JAVA program to opens MATLAB and get the result from MATLAB and show it on its on GUI.I dont know the exact structure but i suggest u to check it and tell me how it works if u know.Sorry for bothering u again and again...but i need it badly for my project.
explore the following link.
http://www.held-mueller.de/JMatLink/
Thanx

Similar Messages

  • Solving Differential Equation - getting strange results.

    Hi, i am using LabView to model the mathematic pendulum which comes down to solving the quation numericaly:
    where w is constant and 0 is an angle between the pendulum's cord and the vertical which i want to plot against time. I built this very simple model to solve this equation (this is what our teacher showed us) [x is the angle]
    and this is what i get:
    "fi" is the starting angle. The result is a cosine , as it is to be expected, with the right period, but why the amplitude is so low? Am i missing something here? No matter how i change the initial value, the amplitude is always 5 oders of magnitude lower. It wouldnt be a problem, since what we are required is to solve the equation, but when i want to factor that in the equation above 0 should be sin0 , the problem arises - sinx for so low x , is...x. So my questions are:
    - am i setting the initial conditions wrong?
    - has the value of dt anything to do with it?
    - is the method correct?
    - am i clueless? 
    A week ago i had no idea what LabView is. We were all thrown into the deep water, we were shown the method, but were not teached how the LabView works,so please, be kind.
    Thank You in advance .
    Attachments:
    pendulum.vi ‏14 KB

    Hello;
    Noise is a difficult issue to advise about.
    There are some things you can try, but the result will depend on different factors, such as, environment, lenght of cables, equipment on vicinity, etc.
    Anyways, you can try to hook up a BIAS resistor in between the ch- and AIGND on your BNC device. That resistor will bleed out the common voltage current and help on noise balancing. Another thing you can try is to hook up a simple RC low pass filter at the analog input. That might help to get rid of that noise.
    I'm also attaching an App Note that talks about Noise and some ways to get around it.
    Hope this helps.
    Filipe A.
    Applications Engineer
    National Instruments
    Attachments:
    Field_Wiring_and_Noise_Considerations.zip ‏196 KB

  • Implementing Differential Equations using Labview fpga modules on PXI-7811R

    Dear,
        I am working on   implementing dynamic systems modeled ordinary  differential equations on PXI-7811R FPGA using labview FPGA. Is there any body who can help me how to implement differential equation on PXI devices uding Labview FPGA, please? Is there any integrator in Labview FPGA, module. I used Discrete Integerator in LAbview FPGA  module in Maths palette, but i hesistated if it really works . I really appreciate your help,
                                        Gammee

    Thank you for posting on the discussion forum.
    You can solve differential equations using LabVIEW FPGA but you may run into some significant difficulties in doing so. If you are not tied to using FPGA, you could try using LabVIEW real-time, which may make things much easier. But if you would like to stick with FPGA, see the link below for a list of examples that may be helpful:
    http://search.ni.com/nisearch/app/main/p/bot/no/ap/tech/lang/en/pg/1/sn/ssnav:ipn/q/differential%20e...
    Below is a link that you can review to better understand the functionality of the discrete integrator should you choose to go that route:
    http://zone.ni.com/reference/en-XX/help/371599B-01/lvfpga/discrete_normalized_integrator/
    I hope that helps.
    Best,
    Rachel
    Rachel D.
    Applications Engineer
    National Instruments

  • Need Help Solving a 2nd order Differential Equation

    I need to write a computer program in MATLAB to solve the following 2nd order differential equation:
         y" + (1/r)y' + (200/80) = 0
    I can't remember which method I'm supposed to use to get an equation for y(r)? Once I know the method... I'm sure I can implement it.
    Thanks for your time

    You can implement Java code in MATLAB??? Is that what you're saying? If so, please tell me how because that would be helpful to me!

  • Differential Equations - Data from file

    Hi
    I am trying to solve a differential equation in LabVIEW. I have tried to modify an example from NI help and attached my VI to this email.
    I have a set on constants for the equation but I also have variables to which the values are stored in a lvm file V and dV. i want to use the value of V for each iteration of t and also the derivitive of V for each value of t. This does not appear to be working.
    Thanks
    Message Edited by scottcolston on 02-27-2008 04:08 AM
    Message Edited by Support on 02-28-2008 08:40 AM

    Hi Ravi,
    I think you need to use this.
    DATA:
            server type string VALUE 'Read the data.
    Server Path'.
      CLEAR itab.  REFRESH itab.
      OPEN DATASET dsn FOR INPUT IN BINARY MODE.
      DO.
        READ DATASET dsn INTO str.
        IF sy-subrc = 0.
          APPEND itab.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE DATASET dsn.
    If you mean application server by network drive.
    Thanks,
    Sai
    Edited by: Sai Krishna Kowluri on Dec 3, 2008 11:13 AM

  • Differential equations

    hi..
    i'm newbies in labview..just want to ask a few questions. i have 4 differential equations (non-linear), and it is a mass balance eqn. of activated sludge process. my question is how to design the block diagram(diff eqn) and then connect all together to get one output?

    Hi,
    You can use formula node to write equations.
    Check here
    Gaurav k
    CLD Certified !!!!!
    Do not forget to Mark solution and to give Kudo if problem is solved.

  • Is there a limit on the size of the input for the Solve Linear Equations block?

    Hello,
    I'm trying to figure out why the Solve Linear Equations block will properly function with some sets of data and why it won't with others. What my program is doing is taking a signal and comparing it with a batch of sine and cosine waves to try and pick out patterns in the data. I have different sample sizes and it seems to work when I throw 3900 points at it. However, I have another set with 4550 points and it gives me incorrect amplitudes for my sinusoids.  Is there some limit to the size of the matrices that I can give this block? Or is there some other workaround that still allows me to keep all of my data?
    Thanks,
    David Joseph

    Well, the best way to show what I expect is to see the entire program. It's pretty evident that when looking at the graphs, something isn't right. What is supposed to happen is that the runout amplitudes are found, and then those sinusoids are subtracted from the initial data, leaving tooth to tooth data and noise. When I use the larger arrays, it seems as though not all of the data gets through (count the peaks on the product gear runout graph vs. initial) and the amplitudes are much to small, such that nothing is really taken out and the tooth to tooth data looks like the initial data.
    Also, we will also be using an FFT, but it will be limited to only determining the frequencies we should check. I've fought with the fft blocks quite a bit and I just prefer to not use them. Plus, the guy I'm writing this for wants exact answers and does not want to pad or resample the data or use windows.
    The exact number of data points isn't important (ie. 4550 vs 4551) since I use the array size block to index the for loop.
    As for typical values, they can change a lot based on materials. But, the original 3900 data point sets and the 4550 data point sets used practically identical gears. So, use the original 3900 sets I've included as references (check the RO array block numbers to compare).
    I've included 3 3900 samples, 3 4550 samples, and 3 4550 samples that have been truncated to 3900 or so as constants on the block diagram.
    Also, the check for additional runouts (like 3 per rev, 4 per rev, etc..) is optional, but if you choose to use it, use positive integers only.
    I don't know how much of this program will make sense and I have wires running everywhere.. so good luck. Keep in mind I'm only a student and I hadn't touched Labview until about 2 or 3 months ago.
    Thanks,
    David Joseph
    Attachments:
    Full example.vi ‏139 KB

  • Solving Cubic equation

    Hello!
    I am trying to create an applet which solves cubic equations. I have managed to create the layout
    but the maths is causing problems. Well, I am a newbie and don't know much yet.
    Here's what I've done so far:
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    public class CubicEquation extends java.applet.Applet implements ActionListener
      TextField aTxt, bTxt, cTxt, dTxt;
      int a, b, c, d;
      double f, g, h;
      Button graphBtn;
      int size = 750;
      public void init()
        setLayout(null);
        resize(1000, 800);
        Label Albl = new Label("a:");
        Albl.setBounds(780, 40, 15, 20);
        Label Blbl = new Label("b:");
        Blbl.setBounds(780, 70, 15, 20);
        Label Clbl = new Label("c:");
        Clbl.setBounds(780, 100, 15, 20);
        Label Dlbl = new Label("d:");
        Dlbl.setBounds(780, 130, 15, 20);
        Label Rlbl = new Label("Range:");
        Rlbl.setBounds(760, 170, 45, 20);
        aTxt = new TextField();
        aTxt.setBounds(800, 40, 80, 20);
        bTxt = new TextField();
        bTxt.setBounds(800, 70, 80, 20);
        cTxt = new TextField();
        cTxt.setBounds(800, 100, 80, 20);
        dTxt = new TextField();
        dTxt.setBounds(800, 130, 80, 20);
        graphBtn = new Button("Graph it");
        graphBtn.setBounds(810, 250, 55, 20);
        add(Albl);
        add(aTxt);
        aTxt.addActionListener(this);
        add(Blbl);
        add(bTxt);
        bTxt.addActionListener(this);
        add(Clbl);
        add(cTxt);
        cTxt.addActionListener(this);
        add(Dlbl);
        add(dTxt);
        dTxt.addActionListener(this);
        add(Rlbl);
        add(graphBtn);
        graphBtn.addActionListener(this);
        public void displayGraph(Graphics g)
          g.setColor(Color.cyan);
          for (int y = 0; y <= size; y = y + 10)            //Draw Grid//
            g.drawLine(1, y, size, y);
          for (int x = 0; x <= size; x = x + 10)
            g.drawLine(x, 1, x, size);
          g.setColor(Color.black);
          g.drawLine(size / 2, 0, size / 2, size);
          for (int i = 0; i <= size; i = i + 20)            //Draw y axis//
            g.drawLine(size / 2 - 5, i, size / 2 + 5, i);
         g.setColor(Color.black);
         g.drawLine(0, size / 2, size, size / 2);
         for (int j = 0; j <= size; j = j + 20)             //Draw x axis//
           g.drawLine(j, size / 2 - 5, j, size / 2 + 5);
      public void paint(Graphics g)
       f = ((3*c/a) - (b*b/a*a)) / 3;
       g = ((2*(b*b*b)) / (a*a*a)) - ((9*b*c)/(a*a)) + (27*d)/a)) / 27;
       h = ((g*g)/4) + (f*f*f)/27;
    public void actionPerformed(ActionEvent e) {
           if (e.getSource() == graphBtn) {
           a = Double.valueOf(aTxt.getText()).intValue();
           b = Double.valueOf(bTxt.getText()).intValue();
           c = Double.valueOf(cTxt.getText()).intValue();
           d = Double.valueOf(dTxt.getText()).intValue();
           if (aTxt.getText().equals("")) {
                a = 0;
           repaint();
    }Can anyone help please?

    The easiest + best way by far to solve polynomial problems is to use matrices.
    Search around on the web and see if you can find a matrix package - I think NASA had an open source free one; you might want to see if you can find that.
    Given
    |a b c|       |x|
    |d e f|    =  |y|
    |g h i|        |z|
    there is a formula that uses determinants somehow that finds the values of all the variables

  • How do I solve simultaneous equation with 3 unknowns ?

    I need to solve simultaneous equations with 3 unknowns . Can any body help out on how to go about this? Thanx.

    You did not specify what kind of equations you have....
    Are your equations linear? Check the linear algebra palette and a look at "solve linear equations:.
    LabVIEW Champion . Do more with less code and in less time .

  • Solve Linear Equations NaN return

    I've implemented a modified Linear Levenberg Marquardt function for gauss fitting of spectral data, but have problems from time to time where I simply can't fit a specific data set.
    I've traced the problem to the function "Solve Linear Equations" outputting NaN for one or more solution vectors (Not all) which then plays havok with my function.
    I've located a data set which is initially OK, but which after solving the linear equations has NaN as the second element of the solution vector array. Changing the matrix type to something other than "generic" gets rid of the NaN for this particular data set, but gives problems with others which work with the "generic" matrix type.
    Since my mathematics lectures in college are a few years away now, I'm asking someone out there if they can help me with my problem. I can supply a "corrupting" data set if this would help, or maybe someone knows this problem and has a work-around?
    I've thought of leaving the matrix type to "generic" and checking the output to see if there's a NaN present, and if so, then re-calculate with another matrix type until there's no NaN. This is most likely not very sound mathematically, but it might reduce the number of rogue data sets.
    Thanks in advance
    Shane.
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)

    Hi Altenbach,
    The data can have a significant amount of overlap. Typically three to four groups of peaks fully resolved, but each group can have up to 4-5 peaks in them, partially visible only as shoulders.
    The start value "problem" is more or less solved (but as usual, not yet finished).
    I've got an approximate first-guess peak find running which does a pretty good job of finding the peaks I need, and I then fit the height and FWHM first before doing a full optimisation (The Sub-VI approach allows much more flexible fitting models).
    The fitting works well on almost all data sets. There are simply some spectra which (although visibly hardly different to others which work perfectly) do not fit, i.e. generate the NaN response from the "solve linear equations" function. It's a numeric problem (bug?), I'm sure, and not strictly a peak location or resolution problem. then again, I may be wrong.
    I refer to the standard "LevMar" VI as being linear, because it assumes a linear relationship between the variable variation and the end mse used for optimisation. This is where the "Solve linear Equations" comes in. Since the relationship is almost certainly not linear (foe example when peaks overlap), I thought maybe the non-linear coefficient guess may yield better results. I've had a quick look through the non-linear LEV-MAR function, but don't understand it yet ot the extent I understand the linear one. It does indeed seem to take a slightly different approach (once you look past the whole parsing code of the "linear" function.
    I'll need some time to get some understanding of the non-linear code.
    Attached are some example spectra (One which works, and one which doesn't).
    Thanks again
    Shane
    Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
    Attachments:
    Spectra.zip ‏3 KB

  • Solve 'String Equation' at the run time

    Can any one help me how to solve String Equation. I get equation and its respective values from database table and i want to solve the equation at run time.
    Ex: (round (x * y) / 1000) /1000
    Please help me as i am new to Java envionment.
    Thanks
    Raveesh

    For a small footprint Java interpreter have a look at BeanShell.
    kind regards,
    Jos

  • How to solve this equation?

    can anybody help me, solve this problem in as3 ?
    x+y+z=8000;
    0.17*x + 0.35*y +0.08*z =960
    thanks very much!!!

    this gives a little more explanation, although doesn't actually complete for me there are too many permitations
    you are also going to have to worry about the number representation issue using floating points numbers
    it might be better to convert the second equations to something equivalent which uses ints
    package
              import flash.display.Sprite;
              public class Main extends Sprite
                        //x+y+z=8000;
                        //0.17 * x + 0.35 * y +0.08 * z = 960
                        public function Main()
                                  // consider each equation in the form a.x + b.y + c.z = d
                                  // we have 3 unknowns x, y, z so we need 3 nested for loops to run over all possibilities
                                  // then the maximum value x can be is d/a
                                  // maximum y = d/b
                                  // maximum z = d/c
                                  // now if we have 2 equations we need to take the maximum for each known from either equation
                                  // so in your case with maximum x is the maximum of 8000/1 and 960/0.17 =
                                  // maximum y is the maximum of 8000/1 and 960/0.35
                                  // maximum z is the maximum of 8000/1 and 960/0.08
                                  // all these maximums should be rounded down to the nearest integer
                                  //max x = 8000
                                  //max y = 8000
                                  //max z = 12000
                                  //we use these maximum values for the nested for loop limits
                                  var maxX:int = Math.max(8000 / 1, 960 / 0.17);
                                  var maxY:int = Math.max(8000 / 1, 960 / 0.35);
                                  var maxZ:int = Math.max(8000 / 1, 960 / 0.08);
                                  trace("max values: ", maxX, maxY, maxZ);
                                  for (var i:int = 0; i < maxX; i++)
                                            for (var j:int = 0; j < maxY; j++)
                                                      for (var k:int = 0; k < maxZ; k++)
                                                                // this if statement is a representation of if the values for x, y and z we are trying
                                                                // actually solve the equations
                                                                // so in your case use the following
                                                                if ((i + j + k == 8000) && (0.17*i + 0.35*j + 0.08*k) == 960)
                                                                          trace("x=", i, ", y=", j, ", z=", k);
                                  trace("done");

  • Help with solving Riccati Equation

    Hoping someone can help me out with solving this equation.  The continous algebraic riccati equation is set up in the form A'*X + X*A - X*B*X + Q.     There is a riccati solver in the control and simuation toolkit but the equation is set up as A'*X + X*A - [X*B + N]*inv(R)*[X*B + N]' + Q = 0.  Default for R is just the identtity matrix, and default for N is empty matrix so does this reduce to A'*X + X*A - X*B*B'*X + Q  ?  (Not 100% on that.)   So is there anyway to use labviews CD Continuous Algebraic Riccati Equations VI on my equation?
    Thanks so much for any help.

    I think you are correct.  I think that technically the last X is transposed, but since X is symetric X' = X, so it makes no difference.

  • Solve linear equations vs pseudoinverse memory issues

    Hello,
    I am trying to solve a Ax
    = b system, and have setup my algorithm to use the LU decomposition
    followed by the appropriate use of the "Solve Linear Equations" VI. I
    then check the error output from this VI, and if there is an error I
    try using the "PseudoInverse Matrix" VI.
    I am doing this in a loop with a progressively larger matrix for each iteration.
    This
    works great EXCEPT for when my algorithm gets close to the maximum
    memory allowed (i.e. - the iteration BEFORE I get an error message
    stating that the VI has run out of memory).Then, although I do NOT get
    an error code from my "PseudoInverse Matrix" VI, the values output from
    this VI are complete garbage (really really large values).
    Has
    anyone come across a similar issue before? Is there a way around this?
    i.e. - I would like to know when/if the  "PseudoInverse Matrix" VI will
    not provide valuable data output so I can stop my algorithm the
    iteration beforehand.
    Thanks!

    Zamjir,
            Can you post the VI and the matrix needed to replicate the issue? I didn't find any other instances of this happening but that doesn't mean that it's not expected. I understand that things ramp up in memory and just before it tops out it shows large (not correct) values but I don't know if this is expected and is just LabVIEW's way of letting us know that it's about to error out (in case you wanted to build in a shut down program you could base it off of these large values) or if it is a bug. If you could post the code so I can take a look at it and also a screenshot of the "out of memory" error you see, I will see what I can find out for you. 
    Grant H.
    National Instruments
    LabVIEW Product Marketing Manager

  • Can labview solve this equation?

    Hello,
    I need to solve this equation in labview to t. X and Y are known values.
    And if this part can't be larger then 1. If it is, it should be made 1.
    I have really no idea where to begin to solve this problem.
    Thanks in advance!

    If you are actually trying to solve it recursively, then Newton's Method should work.
    Actually after checking it, it's obvious the that any value of t at the
    input will give you the correct value of t at the output.
    Message Edited by rpursley8 on 11-21-2005 12:09 PM
    Randall Pursley

Maybe you are looking for

  • Program for finding mandatory fields of an infotype.

    Hi all, I am trying to retrieve the mandatory fields for specific infotypes.Can anyone suggest a code for this??? When we hire one employee using PA40,some screens of various infotypes will be active which contains some mandatory fileds... For this p

  • Inserting multiple data in a single textfield

    is it possible?? something like "select name from table where department_id = 2" and put it in a textfield(or any prefered item) and the output would be like "sanchez , goodyear , hillman" <-- data shud be also separated by comma.

  • How can I force Itunes to show me the missing music in my library?

    How can I force Itunes to show me the missing music in my library? Somwhere I found that if you Select all, Ctrl-I it would do it. But it did not help. I need to find the broken ones! Help!

  • Very Urgent!!  Static LOV with Sort by Option with column names

    Hi All, Can we have am Static LOV with an order by option according to the column names in an Report.. If so can you share with me, waiting for your reply and thanks in Advance.. Select name, creator, date_created, NVL(Comp_type,Del_TYPE) FORMAT, fro

  • SID - details

    Dear all, In Bi we come across a term called SID - what is the use of this and how this functions.Further there are tables called "F" and "E" what are they and how these functions. Your answers will be of much help Regards, M.M