Risposto
non linear implicit equation
Surprisingly, this has an explicit solution for y (I didn't use Matlab to get it as I don't have the symbolic toolbox to hand) ....

quasi 6 anni fa | 1

| accettato

Risposto
How to write the codes for this gamma function?
Compare your coded value of 154056.7 with the equation's value of 154.056.

quasi 6 anni fa | 0

Risposto
Poisson Boltzmann eq. with an infinite boundary condition
I suspect the initial gradient required to get zero at infinity is an irrational number (or possibly a rational number with a la...

quasi 6 anni fa | 0

| accettato

Risposto
How to solve s system of coupled nonlinear ODES already given the state vector
You need to solve for all xdots simultaneously - this is done in matrix format below. There were also a number of errors in you...

quasi 6 anni fa | 1

| accettato

Risposto
How to round UP to 1 decimal value?
ceil(x*10)/10

quasi 6 anni fa | 0

| accettato

Risposto
Generate and Plot N Points Picking Random Points on Triangle
More like the following; rng('shuffle'); n = 1000; % Set number of points as desired % Let (0,0) be vertex 1, (0,2) be verte...

quasi 6 anni fa | 0

| accettato

Risposto
Finding the streamlines of a complex potential for a Joukowsky transform from a unit circle to a flat plate.
x=0:. There was a strange vertical line that O thought was related to this. However, you could put it back and see if it makes a...

quasi 6 anni fa | 1

Risposto
Finding the streamlines of a complex potential for a Joukowsky transform from a unit circle to a flat plate.
There are some typos in the paper by Smith et al, and some steps left out. I think the following generates figure 18: x = [-2:...

quasi 6 anni fa | 1

| accettato

Risposto
How to do write the codes for this summation problem?
Having defined n and T then B = 1./(log(T) - mean(log(T))); Note that in Matlab, log is log to base e.

quasi 6 anni fa | 0

Risposto
how to graph this system of questions into mathlab
You can define the function as follows f = @(v) (-0.001778*v.^2+0.05333*v).*(v<30); The (v<30) part simply multiplies the rest...

quasi 6 anni fa | 0

Risposto
Initialize values at time = 0
You probably want to replace if (lambda(:,1) == lambda(1,1)) & (lambda(:,2) == lambda(1,2)) by if (lambda(r,1) == lambda(1,1)...

quasi 6 anni fa | 0

| accettato

Risposto
ode arguments error in function
For the last line in your function you need dYfuncvecdW = [dXdW; dydW]; Notice the semicolon after dXdW Also your plot comman...

quasi 6 anni fa | 0

Risposto
How do I solve Time dependent parameter in ODE
Perhaps your code needs to be structured more along the following lines; tspan = ..... y0 = ..... options = ..... [t, ymod...

quasi 6 anni fa | 0

| accettato

Risposto
How to plot min and max values on graph
If you meant you want to highight all the peaks and troughs then the following will do it (assuming you haven't got the findpeak...

quasi 6 anni fa | 0

Risposto
Plotting a rankine half body
Try this m=3; %strength U = 20;%positive x-axis %Mesh for fourth quadrant and corresponding stream value function [X1,Y1] = ...

quasi 6 anni fa | 1

| accettato

Risposto
Integration by numerical methods
Something like this: z = 0.01:0.01:1; I = zeros(1,numel(z)); for i = 1:numel(z) I(i) = integral(@(x) sqrt(x)./(exp(x)./z(i) ...

quasi 6 anni fa | 0

| accettato

Risposto
Can someone help me write out this equation for chi-square please
As long as y, m and err_y have the same number of elements then your expression should work ok.

quasi 6 anni fa | 0

Risposto
How to solve two coupled differential equations using ode45.
The following should help: % tspan = [0 tend]; % IC = [1 0 0]; % initial conditions % [t, X] = ode45(@fn, tspan, IC);...

quasi 6 anni fa | 0

| accettato

Risposto
Index in position 2 exceeds array bounds (must not exceed 14).
Odd! It works for me: >> C(1,1)= 1; C(1,10) =-1; C(1,16) = 1; C(2,2) = 1; C(2,10) = 1; C(2,11) =-1; C(3,3) = 1; C(3,11) = 1;...

quasi 6 anni fa | 0

Risposto
how to find a root of polynomial using matlab
Or directly y = sqrt(2)*atan(-1/3);

quasi 6 anni fa | 0

Risposto
How to give input function dz/dt=Z*omega*cos(omega) to state space system?
Do you mean something along these lines: tspan = [0 2]; % Or whatever you need IC = [1 0]; % Set your own initial conditi...

quasi 6 anni fa | 0

| accettato

Risposto
how can i solve nonliner equation?
look at documentation on the "roots" function, (ie type help roots).

quasi 6 anni fa | 0

| accettato

Risposto
I am not getting graph for RK4
Looks like you are confusing Y with y.

quasi 6 anni fa | 0

Risposto
How do I solve this bvp4c error ?
You have a division by sinh(k) .../(2*sinh(k)))... Since k is zero, sinh(k) is zero and the resuting expression for vel is NaN...

quasi 6 anni fa | 0

| accettato

Risposto
Simulate a 2-input linear system with with ode45
More like this: tspan = [0 50]; x0 = [0; 0; 0]; u = [10; 10]; [t,x] = ode45(@(t,x) odefun(t,x,u),tspan,x0); x = x'; My = [...

quasi 6 anni fa | 0

| accettato

Risposto
How to extract non complex number from an array?
A(imag(A)==0)

quasi 6 anni fa | 1

Risposto
Adding Labels to PDE Graph
One way is to do the following with your plot command: plot(x,sol); lg1 = ['t = ',num2str(t(1))]; lg2 = ['t = ',num2str(t(2)...

quasi 6 anni fa | 0

| accettato

Risposto
How can I get values for n=500, 1000 and 2000 ? only getting values for n=4000!
Your assignments T.Euler_1(p) = abs(init_cond(1) - z(end,1)); etc. are all outside of the for p = ... loop, hence they just re...

quasi 6 anni fa | 1

| accettato

Risposto
why this error ??
You have defined x as a 1x25 vector, but you are calling it with two arguments. You need to call it with x(n), rather than x(1,n...

quasi 6 anni fa | 0

Risposto
How to find x-values when y-function equals a set value?
With your particular function you can get both values of x immediately from x = b1 + c1*sqrt(log(a1/0.7))*[1, -1];

quasi 6 anni fa | 0

Carica altro