Register to reply 
3d plot in scilab 
Share this thread: 
#1
Feb1512, 02:43 PM

PF Gold
P: 3,207

I just downloaded scilab because Wolfram Alpha wouldn't want to plot the function I'd like.
In a physics problem I've found the temperature distribution of a 2 dimensional system. I'd like to visualize this function in 3d. The function I want to plot is [itex]u(x,y)=\frac{1}{\pi} \arctan \left ( \frac{y+a}{x} \right )+\frac{1}{\pi} \arctan \left ( \frac{ay}{x} \right )[/itex]. I've read the help file of scilab of how to plot but I'm getting lost very quickly. Any help is appreciated! Edit: so far I have



#2
Feb1512, 05:19 PM

P: 885

Don't know scilab, but your second 'atan' has a '2' in the denominator...shouldn't that be 'x'?
what do the single apostrophes do? what do you think you are accomplishing with z=... ? are x and y traversed independently as if they were in 2 nested doloops...or is it just a onetoone? In other words, is z also just a vector? or are you getting a matrix? try to input one line at a time and find out what you get back after each....don't jump all the way to plotting...baby steps, baby steps! 


#3
Feb1512, 06:45 PM

PF Gold
P: 3,207

Here is an example they give, from which I've been inspired:



#4
Feb1512, 07:13 PM

P: 885

3d plot in scilab
ok, so, did the example work? Did you get a surface plot?
I think the apostrophe means transpose. In the example where they multiply sin times cos, notice how they pass t to one function and t' to the other...the fact that these two vectors are orthogonal (one is a column vector and the other a row vector) may be what makes it produce a square matrix for z....in other words, the expression is evaluated as in a double loop. So, go back to your own problem and pass y and x' and see what you get...see if you can display the z matrix before plotting to see if in fact is a square matrix. 


#5
Feb1512, 08:24 PM

Sci Advisor
PF Gold
P: 1,474

look at the function meshgrid if it exists in scilab (it is a matlab function), you need a 2d grid to properly plot in 3d



#6
Feb1512, 08:40 PM

PF Gold
P: 3,207




#7
Feb1512, 09:03 PM

PF Gold
P: 3,207

In analogy to their working example:



#8
Feb1512, 10:05 PM

P: 885

I think the reason you are getting a flat surface is because you have yet another typo which effectively makes the summation be zero...
in your numerators, you have Y2 and 2Y ...you should have Y+2 and 2Y and, for completeness, you may want to put back the division by PI 


#9
Feb1512, 10:23 PM

PF Gold
P: 3,207

Using the meshgrid I get a somehow decent surface, but doesn't work well for the plot3d command so far. Here are 2 screenshots. 


#10
Feb1512, 11:36 PM

P: 885

Hhhmm...here it is what it looks like with python and matplotlib.



Register to reply 
Related Discussions  
I need help for scilab?  Math & Science Software  0  
Rasterized density plot + countour plot in Mathematica (to solve EPS issues)  Math & Science Software  0  
[help] using scilab to plot the direction fiel of ode  Precalculus Mathematics Homework  0  
Ode (scilab) problem  Engineering, Comp Sci, & Technology Homework  0 