help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running Octave through a WWW server


From: John Judge
Subject: Re: Running Octave through a WWW server
Date: Fri, 21 Nov 1997 15:25:36 +1100 (EST)

Jarrett,

If you are using apache or similar Web server have a look at the 
error log file and see if it contains a clue to your problem. I think you 
are right to suspect something like file/directory permissions 
as your CGI script runs as user 'nobody' (or simliar user as specified 
in the Web server configuration file).

You could also make the process a little easier by using gnuplot 3.6 which
lets you have a gif terminal. i.e.

gset terminal gif

and avoids the pbm to gif conversion. To size the gif try something like:

gset terminal gif size 640,480

John Judge
Telecommunications and Information Techonology Research
University of Wollongong
email : address@hidden
phone : +61 42 21 4630
fax   : +61 42 21 3236


> From address@hidden Fri Nov 21 06:58 EST 1997
> Resent-Date: Thu, 20 Nov 1997 13:56:19 -0600
> X-Sender: address@hidden
> X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.3 (32)
> Date: Thu, 20 Nov 1997 13:52:11 -0600
> To: address@hidden
> From: "W. Jarrett Campbell" <address@hidden>
> Subject: Running Octave through a WWW server
> Mime-Version: 1.0
> Resent-Message-ID: <"T7yFwNdVWoI.A.v1G.jXJd0"@bevo.che.wisc.edu>
> Resent-From: address@hidden
> X-Mailing-List: <address@hidden> 
> X-Loop: address@hidden
> Resent-Sender: address@hidden
> Sender: address@hidden
> 
> I just signed up to this list so please forgive me if a similar item has
> been discussed before.  I'm currently working on a project that works as
> follows:
> 
> 1. Submit parameter values over a WWW form
> 2. a PERL/CGI script parses the data, opens OCTAVE and pipes in the data
> 3. OCTAVE opens an m-file, uses the data and lsode to solve some diff. eqs.
> 4. OCTAVE output a plot as a pbm file using gnuplot
> 5. ppmtogif is used to convert the pbm to gif format
> 6. The output is displayed in a web browser.
> 
> I successfully have done this using MATLAB/GNUPLOT but I am having some
> difficulty with the OCTAVE implementation.
> 
> When I run the cgi script from the unix command line, everything works
> fine.  But when I call the cgi from the web browser, my pbm and gif files
> have file size 0 (zero).  I expect it has something to do with permissions,
> but can't solve the mystery.  Yes, the output directories have 777
> permissions (like I said, it works with MATLAB).
> 
> Here's a list of commands being sent to OCTAVE through the pipe:
> 
>              set term pbm
>              set output "$output_ppm"
>              cd $mfiles
>             A0=$A0;
>              A1=$A1;
>              A2=$A2;
>              B0=$B0;
>              B1=$B1;
>              B2=$B2;
>              B3=$B3;
>              w=$w;
>              K=$K;
>              pilot;     
>              exit
> 
> 
> where $XX are previously defined perl variabless and pilot is my m-file
> (below)
> 
> global A2 A1 A0 B0 B1 B2 B3 K w
> 
> function xdot2=f2(x,t)
>   global A2 A1 A0 B0 B1 B2 B3 K w
>   xdot2(1)=x(2);
>   xdot2(2)=-A1/A2*x(2)-A0/A2*x(1)+K/A2*(B0+B1*t+B2*t^2+B3*sin(w*t));
> endfunction
> 
> function xdot1=f1(x,t)
>   global A2 A1 A0 B0 B1 B2 B3 K w
>   xdot1(1)=-A0/A1*x(1)+K/A1*(B0+B1*t+B2*t^2+B3*sin(w*t));
> endfunction
> 
> 
> if A2 == 0
>      taut = 10*A1/A0;
>      x = lsode("f1", [0], (t = linspace (0, taut, 200)'));
>      y = x;
> else
>      taut = 10*sqrt(A2);
>      x = lsode("f2", [0; 0], (t = linspace (0, taut, 200)'));
>      y = x(:,1);
> end
> 
> 
> set title "Dynamic Response"
> set xlabel "Time"
> set ylabel "Output"
> set border
> set nogrid
> set nokey
> plot(t,y)
> 
> 
> 
> 
> Also, when just using GNUPLOT, I can use the size property to scale the
> image.  But in OCTAVE, size has another meaning.  Is there some way to
> scale the output?
> 
> Any help would be greatly appreciated.
> 
> Jarrett Campbell
> address@hidden
> 
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]