Answered

Erasing part of contourf diagram (L-shaped diagram using contourf)

try ind = x_points > 2 & y_points < 2; temp(ind) = nan;

Erasing part of contourf diagram (L-shaped diagram using contourf)

try ind = x_points > 2 & y_points < 2; temp(ind) = nan;

29 days ago | 0

Answered

I am new to matab. I tried to solve a non linear equation with newton raphson and modified newton raphson method but got different solution. could you please help me find the error? please note I tried to run the code in two separate files.

Plot each iteration to see what it going on fplot(f,[-5 5]) hold on for i = 1:maxiteration; % computations ... yy =...

I am new to matab. I tried to solve a non linear equation with newton raphson and modified newton raphson method but got different solution. could you please help me find the error? please note I tried to run the code in two separate files.

Plot each iteration to see what it going on fplot(f,[-5 5]) hold on for i = 1:maxiteration; % computations ... yy =...

29 days ago | 0

Answered

solve on vector equation

Try this (solution exists not for any s1 vector) function main nt = 1; ni = 2; s1 = [1 2 2]; s1 = s1/norm(s1); fun...

solve on vector equation

Try this (solution exists not for any s1 vector) function main nt = 1; ni = 2; s1 = [1 2 2]; s1 = s1/norm(s1); fun...

1 month ago | 0

Answered

How to detect these points in red circle from point cloud. The attached data.txt is the point cloud data. Many thanks.

Here is an idea: load data.txt x = data(:,1); y = data(:,2); z = data(:,3); plot3(x,y,z,'.r') axis equal datacursormode...

How to detect these points in red circle from point cloud. The attached data.txt is the point cloud data. Many thanks.

Here is an idea: load data.txt x = data(:,1); y = data(:,2); z = data(:,3); plot3(x,y,z,'.r') axis equal datacursormode...

1 month ago | 0

| accepted

Answered

Determine cross sectional area from patch data

I think there is no built-in function for your purpose Try to search something like THIS

Determine cross sectional area from patch data

I think there is no built-in function for your purpose Try to search something like THIS

1 month ago | 0

| accepted

Answered

slice plot gives black surfaces

Planes are not black. THe mesh is just too fine Add to your code h = slice(z,y,x,abs(Eg(:,:,:)),zslice,yslice,xslice); set(h,...

slice plot gives black surfaces

Planes are not black. THe mesh is just too fine Add to your code h = slice(z,y,x,abs(Eg(:,:,:)),zslice,yslice,xslice); set(h,...

1 month ago | 0

| accepted

Answered

ODE solver - division by zero at time boundaries

As I see it, the problem is at t = 0, y(1,2) = 0 Can you replace 0 with 1e-3?

ODE solver - division by zero at time boundaries

As I see it, the problem is at t = 0, y(1,2) = 0 Can you replace 0 with 1e-3?

1 month ago | 0

| accepted

Answered

Solving a system of ODEs with conditionally defined coefficient

replace f=piecewise(0<=t<1, -2*t^2+3*t, t>=1, 1/t); with if t >= 1 f = 1/t; else f = -2*t^2+3*t; end

Solving a system of ODEs with conditionally defined coefficient

replace f=piecewise(0<=t<1, -2*t^2+3*t, t>=1, 1/t); with if t >= 1 f = 1/t; else f = -2*t^2+3*t; end

1 month ago | 0

| accepted

Answered

How to implement Forward Euler Method on a system of ODEs

I've tried and reached a success par_c.k = 14.39964548; % electronvolt per AngstrÃ¶m par_c.xj = [0 0]; % position of particle j...

How to implement Forward Euler Method on a system of ODEs

I've tried and reached a success par_c.k = 14.39964548; % electronvolt per AngstrÃ¶m par_c.xj = [0 0]; % position of particle j...

1 month ago | 0

| accepted

Answered

Solving two second order BVPs and the boundary conditions are related

How to set up initial guess? Any ideas? function main %-----------------------------------------------------------------------...

Solving two second order BVPs and the boundary conditions are related

How to set up initial guess? Any ideas? function main %-----------------------------------------------------------------------...

1 month ago | 1

| accepted

Answered

Position of elements'nodes intersected by a line

Look HERE Check each triangle/element. If intersection exists then pick/highlight this element/triangle

Position of elements'nodes intersected by a line

Look HERE Check each triangle/element. If intersection exists then pick/highlight this element/triangle

1 month ago | 1

| accepted

Answered

Plot dB/dt vs. time by ODE45 (with dB/dt on the y axis and time on the x axis)

What I would like to do is also plot dB/dt vs. time pvar = gradient(varsol(:,3)); dt = gradient(tsol); dB = pvar./dt; plot(t...

Plot dB/dt vs. time by ODE45 (with dB/dt on the y axis and time on the x axis)

What I would like to do is also plot dB/dt vs. time pvar = gradient(varsol(:,3)); dt = gradient(tsol); dB = pvar./dt; plot(t...

1 month ago | 1

| accepted

Answered

Heat transfer differential equation

Call the function this way: [t,y] = ode45(@f,[0,5],1673)

Heat transfer differential equation

Call the function this way: [t,y] = ode45(@f,[0,5],1673)

1 month ago | 0

Answered

2D information to 1D colorplot

Simple example x = 0:10; y = x.^2; temp = rand(1,10); % temperature cm = jet(10); % colormap ind = 1+rou...

2D information to 1D colorplot

Simple example x = 0:10; y = x.^2; temp = rand(1,10); % temperature cm = jet(10); % colormap ind = 1+rou...

1 month ago | 0

Answered

Quiver with a system of ODEs.

For vector field u = x'; v = y'; To plot the curve [T,Y] = ode45 ... plot(Y(:,1),Y(:,2)) % (x,y) I suppose x and y depen...

Quiver with a system of ODEs.

For vector field u = x'; v = y'; To plot the curve [T,Y] = ode45 ... plot(Y(:,1),Y(:,2)) % (x,y) I suppose x and y depen...

1 month ago | 0

Answered

Solving nonLinear equation and Linearized Eqaution using ODE45

YOu have to express , and . Solve the system function du = nonlin(t,y) fi = y(1); psi = y(2); theta = y(3); ...

Solving nonLinear equation and Linearized Eqaution using ODE45

YOu have to express , and . Solve the system function du = nonlin(t,y) fi = y(1); psi = y(2); theta = y(3); ...

1 month ago | 0

| accepted

Answered

How to plot magnitude and directions between 2 points?

try this (not tested) data = load ('Input.txt'); [row, col] = size (data); Y2 = data (:,1); X2 = data (:,2); Y1 = data (:,3...

How to plot magnitude and directions between 2 points?

try this (not tested) data = load ('Input.txt'); [row, col] = size (data); Y2 = data (:,1); X2 = data (:,2); Y1 = data (:,3...

1 month ago | 0

| accepted

Answered

surface fixed point value Z

I want to know the value of Z from the surfc function Here is it

surface fixed point value Z

I want to know the value of Z from the surfc function Here is it

2 months ago | 0

Answered

Where are the bugs for this ODE finite difference problem that solve using Newton Raphson method?

Here is my attempt clc,clear N = 10; % 10 Set parameters L = 16*0.3048; %meter b = 19.625 * 0.0254; d = 1.625 * 0.0254; ...

Where are the bugs for this ODE finite difference problem that solve using Newton Raphson method?

Here is my attempt clc,clear N = 10; % 10 Set parameters L = 16*0.3048; %meter b = 19.625 * 0.0254; d = 1.625 * 0.0254; ...

2 months ago | 1

| accepted

Answered

I am receiving the error message Index exceeds the number of array elements (1) when trying to use ode45.

Try @(V,T)

I am receiving the error message Index exceeds the number of array elements (1) when trying to use ode45.

Try @(V,T)

2 months ago | 0

| accepted

Answered

I have a 14 equation system of second order differential equations which I am trying to solve using dsolve. The program just keeps running without finishing ?

alpha and E should be numerical function main m = 15000; k = 150000; n = 14; A = zeros(n); A(n,n) = -k/m; A(n,n-1) = k/m;...

I have a 14 equation system of second order differential equations which I am trying to solve using dsolve. The program just keeps running without finishing ?

alpha and E should be numerical function main m = 15000; k = 150000; n = 14; A = zeros(n); A(n,n) = -k/m; A(n,n-1) = k/m;...

2 months ago | 0

Answered

Euler 3D rotation between two vectors

Here is rotation using Rodriguez matrix Here is rotation about Y axis and Z. Here is the difference between them See ...

Euler 3D rotation between two vectors

Here is rotation using Rodriguez matrix Here is rotation about Y axis and Z. Here is the difference between them See ...

2 months ago | 0

| accepted

Answered

Simultaneous differential equations - derivative of y^3 wrt t

Just get dydt(1)=(-3*D*Cs/rho/r0^2)*y(1)*(1-y(2)); dydt(1)=nthroots(dydt(1),3);

Simultaneous differential equations - derivative of y^3 wrt t

Just get dydt(1)=(-3*D*Cs/rho/r0^2)*y(1)*(1-y(2)); dydt(1)=nthroots(dydt(1),3);

2 months ago | 0

Answered

Numerically derive a continous, non-symbolic function

Derivative is (if you have numerical data) dy = (y(i)-y(i-1)) / (t(i)-t(i-1)); Maybe diff (if you have a function) ? syms x ...

Numerically derive a continous, non-symbolic function

Derivative is (if you have numerical data) dy = (y(i)-y(i-1)) / (t(i)-t(i-1)); Maybe diff (if you have a function) ? syms x ...

2 months ago | 0

Answered

3D Point Cloud - Gaussian Curvature

one way clc,clear % generate some data r = 3; t = linspace(0,10)'; x = r*cos(t); y = r*sin(t); z = sin(1*t); t1 = ...

3D Point Cloud - Gaussian Curvature

one way clc,clear % generate some data r = 3; t = linspace(0,10)'; x = r*cos(t); y = r*sin(t); z = sin(1*t); t1 = ...

2 months ago | 0

Answered

Runge Kutta for system of eqs

I wrote function in the way similar to ode45 y_dot = @(x,dx)[dx; -4*dx-5*x]; %insert function to be solved for i = 1:n k1...

Runge Kutta for system of eqs

I wrote function in the way similar to ode45 y_dot = @(x,dx)[dx; -4*dx-5*x]; %insert function to be solved for i = 1:n k1...

2 months ago | 0

Answered

The problem of finding intersection point of triangle mesh

To check every edge: for j = 1:size(face,2) i1 = 1; for i2 = [2 3 1] % checking edges [1 2], [2 3], [3 1...

The problem of finding intersection point of triangle mesh

To check every edge: for j = 1:size(face,2) i1 = 1; for i2 = [2 3 1] % checking edges [1 2], [2 3], [3 1...

2 months ago | 1

| accepted

Answered

How can i solve a system which contains matrices

Here is the best way i know: A = [5 3 1 1 1 1 3 1 2]; B = [c1(:) c2(:) c3(:)]'; C = inv(A) * B;

How can i solve a system which contains matrices

Here is the best way i know: A = [5 3 1 1 1 1 3 1 2]; B = [c1(:) c2(:) c3(:)]'; C = inv(A) * B;

2 months ago | 1

| accepted

Answered

Using a for-loop to score values in different intervals

Correct form if 0 <= x(i) && x(i) < 1

Using a for-loop to score values in different intervals

Correct form if 0 <= x(i) && x(i) < 1

2 months ago | 0

| accepted

Answered

Intersection between line and circle when line ends inside circle (using geom2d)

Someone should copy their comment to the answers section so it can be accepted. It should be me % Position of line: x1 = [0...

Intersection between line and circle when line ends inside circle (using geom2d)

Someone should copy their comment to the answers section so it can be accepted. It should be me % Position of line: x1 = [0...

2 months ago | 1

| accepted